On Thu, Apr 10, 2025 at 02:18:01PM +0200, Paolo Bonzini wrote:
> On 4/8/25 22:14, Joel Granados wrote:
> > Use "#!/usr/bin/env bash" instead of "#!/bin/bash". This is necessary
> > for nix environments as they only provide /usr/bin/env at the standard
> > location.
> 
> I am confused, how does this not break everything else?  All the test
> scripts in tests/docker/test-* have "#!/bin/bash", and configure has
> "/bin/sh".
Not sure what "break" means here, but the "env" shebang should just work
in distros that follow (or try to) POSIX. AFAIK, to be POSIX compliant,
you need to provide an "env" for command invocation [1]. The two
previous changes that I know of [2], [3] have not had any adverse
effects that I'm aware of.

> How is the environment that runs scripts/archive-source.sh
> different, and why should it be fixed in scripts/archive-source.sh?
It is different from the other files in that I hit the issue only on
that file. I'm happy to provide a treewide change if it would make more
sense.

> 
> These are genuine questions - it would help if the commit message explained
> those...
I can weave the explanation into the commit for V2.

> In fact, what is a nix overlay and why would you use
> scripts/archive-source.sh to prepare one? :)
I now realize that mentioning a nix overlay in the commit message might
be to far from a general context. How about if I change the commit
message of the second patch to:

```
  The archive-source script appends everything directly on the tar root
  making it unsuitable for cases where a different directory structure
  is expected, like during nix packages customization.

  Add a "-d|--dir" argument that places all files under a custom root.
  Behaviour is unchanged when the argument is not given.
```

To answer the question of what an nix overlay is: It is a way of
customizing nix packages. I use it to override specific elements from a
nix package and replace them with my stuff [4]. I am working with the qemu
package and am overriding the qemu tarbal.

Best

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/env.html
[2] 
https://lore.kernel.org/all/20250122-jag-nix-ify-v1-1-addb3170f...@kernel.org/
[3] 
https://lore.kernel.org/all/20240817215025.161628-1-kent.overstr...@linux.dev/
[4] https://nixos.wiki/wiki/Overlays
-- 

Joel Granados

Attachment: signature.asc
Description: PGP signature

Reply via email to