Bruno has been helping me test https://github.com/rrthomas/libpaper on various systems. (Many thanks, Bruno!) On Wed, 1 Feb 2023 at 12:39, Bruno Haible wrote: > On GNU/Hurd and Cygwin, I see 9 test failures. Such as > > --- expected-fixed.txt 2023-02-01 03:02:44.000000000 +0100 > +++ default-size-no-default-paper-output-fixed.txt 2023-02-01 > 03:02:44.000000000 +0100 > @@ -1 +1 @@ > -paper: no default paper size is set > +/home/bruno/libpaper-2.0.5/build/tests/default-size-no-default-paper.9592/home/bruno/bin/paper: > no default paper size is set > FAIL default-size-no-default-paper.sh (exit status: 1) > > [snip] > > Apparently the program name includes its path here. Probably because on > these platforms, the Gnulib --enable-relocatable support leads to the > creation of 2 installed programs: paper.bin and paper. (The latter is a > trampoline that invokes paper.bin.) > I would like to make the error messages look nice for the user (rather than just fixing the tests). I could use some help here, as I don't understand what's going on! I use the relocatable-prog gnulib module, and specifically the function set_program_name_and_installdir(). Looking at its source in gnulib/lib/progreloc.c, it has code specifically to strip off a ".bin" suffix. I can't see why this isn't happening on Cygwin (I have code in my main.c such that _WIN32 is defined, then the name passed to the function is just "paper", whereas if it isn't, then ".bin" should be stripped out). Then there's the trampoline, in progreloc.c. This sets argv[0] of the program it calls to get_full_program_name () plus the .bin suffix. This seems unfortunate, as progname.c's set_program_name, called by set_program_name_and_installdir from progreloc.c, deliberately doesn't remove an absolute path from the start of the executable name. Should the trampoline not attempt to hide itself, and keep the argv[0] of the process it execv's the same as its own? (I'm conscious that Bruno wrote the code in question, but it seemed more correct to post the question to bug-gnulib than simply reply to him!) -- https://rrt.sc3d.org