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.
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.