On Monday, November 16th, 2026 at 9:39 AM, 
Gavin Smith <[email protected]> wrote:

> On Sun, Nov 15, 2026 at 09:17:02PM +0000, Heime wrote:
> > On Monday, November 16th, 2026 at 8:02 AM,
> > Gavin Smith <[email protected]> wrote:
> > > The -real suffix seems to be a Guix thing:
> > >
> > >     For a package writer, the goal is to make sure commands always work 
> > > the
> > >     same rather than depend on some external settings. One way to achieve
> > >     that is to wrap commands in a thin script that sets those environment
> > >     variables, thereby ensuring that those run-time dependencies are 
> > > always
> > >     found.
> > >
> > >     ...
> > >
> > >     For example, this call:
> > >
> > >         (wrap-program "foo"
> > >                       '("PATH" ":" = ("/gnu/.../bar/bin"))
> > >                       '("CERT_PATH" suffix ("/gnu/.../baz/certs"
> > >                                             "/qux/certs")))
> > >
> > >     will copy foo to .foo-real and create the file foo with the following 
> > > contents:
> > >
> > >         #!location/of/bin/bash
> > >         export PATH="/gnu/.../bar/bin"
> > >         export 
> > > CERT_PATH="$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs"
> > >         exec -a $0 location/of/.foo-real "$@"
> > >
> > > https://guix.gnu.org/manual/1.4.0/en/guix.html#Wrappers
> > >
> > > I am not sure if there is anything we can do.  Surely texi2any cannot
> > > be the only program with this issue with this Guix feature.
> > >
> > > The GNU Coding Standards say that the output of --version shouldn't depend
> > > on argv[0], and indeed the output of "texi2any --version" is the same as
> > > the output of "makeinfo --version" - always reporting the name of the
> > > program as "texi2any (GNU texinfo)".
> >
> > I do not see the problem with the above.  But for examples where users 
> > actually
> > input the syntax for running the program, should follow the name, not 
> > internal equivalents.
> 
> We can't get the name for running the program unless it is passed in argv.
> 
> Now looking at the Guix documentation above, it is supposed to be in argv[0]
> according to what the -a option to exec does:
> 
>     If ‘-a’ is supplied, the shell passes NAME as the zeroth argument
>     to COMMAND.
> 
> (from "(bash)Bourne Shell Builtins").
> 
> Could you report the output of the following?
> 
> $ file /gnu/store/5fxm6zc8gjyqz8lwplfppbzjk31d0b7z-texinfo-7.3/bin/texi2any
> $ cat /gnu/store/5fxm6zc8gjyqz8lwplfppbzjk31d0b7z-texinfo-7.3/bin/texi2any
> 
> This could give a clue if "exec -a" is being used.


hagbard@fuckup:~$ file 
/gnu/store/5fxm6zc8gjyqz8lwplfppbzjk31d0b7z-texinfo-7.3/bin/texi2any 

/gnu/store/5fxm6zc8gjyqz8lwplfppbzjk31d0b7z-texinfo-7.3/bin/texi2any: a 
/gnu/store/c6kh9i8hyi2ydkcykwi6fwfj0808hh82-bash-minimal-5.2.37/bin/bash 
script, ASCII text executable, with very long lines (406)

hagbard@fuckup:~$ cat 
/gnu/store/5fxm6zc8gjyqz8lwplfppbzjk31d0b7z-texinfo-7.3/bin/texi2any 

#!/gnu/store/c6kh9i8hyi2ydkcykwi6fwfj0808hh82-bash-minimal-5.2.37/bin/bash
export 
PERL5LIB="/gnu/store/qrlpxj5j2wbkb83kj6ba4ch64ap3962k-perl-archive-zip-1.68/lib/perl5/site_perl/5.36.0:/gnu/store/xpsd42896r2g8jzds4ljl84h4riwm810-perl-unicode-eastasianwidth-12.0/lib/perl5/site_perl:/gnu/store/m6b4d0fwbcbfpa17m1nw5crxj0jk6shl-perl-text-unidecode-1.30/lib/perl5/site_perl:/gnu/store/zxl0248qf05jpc6m7av83zch5ciqvv1p-perl-libintl-perl-1.32/lib/perl5/site_perl${PERL5LIB:+:}$PERL5LIB"
exec -a "$0" 
"/gnu/store/5fxm6zc8gjyqz8lwplfppbzjk31d0b7z-texinfo-7.3/bin/.texi2any-real" 
"$@"

 
> It may also be an issue with $0 in Perl, as this may not be set with the
> argument of "exec -a".  It may be relevant that texi2any is a Perl program
> beginning with the hash-bang "#!" to load the Perl interpreter.  I'm not
> sure exactly what happens with the argv array in that case but it's possible
> that argv[0] is lost.
>

Reply via email to