[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The case for moving raw binaries
From: |
Liliana Marie Prikler |
Subject: |
Re: The case for moving raw binaries |
Date: |
Thu, 04 Aug 2022 18:53:58 +0200 |
User-agent: |
Evolution 3.42.1 |
Am Donnerstag, dem 04.08.2022 um 10:54 +0200 schrieb Ludovic Courtès:
> Hi,
>
> Liliana Marie Prikler <liliana.prikler@gmail.com> skribis:
>
> > Am Freitag, dem 29.07.2022 um 17:20 -0400 schrieb Philip McGrath:
> > > Hi,
> > >
> > > [...]
> > > I was mildly annoyed recently with several programs that use the
> > > ".foo-real" name in their `--help` output, for example:
> > >
> > > ```
> > > $ guix shell --pure reuse -- reuse -h
> > > usage: .reuse-real [-h] [--debug] [--include-submodules]
> > > ```
> > >
> > > I wondered about just changing `wrap-program` to put the real
> > > program
> > > at `.real/foo` instead of `.foo-real`. One advantage is that it
> > > wouldn't need any special cooperation like setting up an output
> > > or an
> > > environment variable.
> > Even as the one who made the suggestion that issue has an easier
> > workaround: Use exec -a to pass the 0th argument unchanged.
>
> That’s already happening:
>
> --8<---------------cut here---------------start------------->8---
> $ head -3 < $(guix build reuse)/bin/reuse | tail -1
> exec -a "$0" "/gnu/store/iwsddc43xqxz4ibncrd7cgv4qjdy0jjd-reuse-
> 1.0.0/bin/.reuse-real" "$@"
> --8<---------------cut here---------------end--------------->8---
>
> I’m not sure why it doesn’t have the desired effect though.
I found out: it's because reuse is a python script and the exec -a hack
stops working because python initializes sys.args using the filename.
Cheers