perl-cross icon indicating copy to clipboard operation
perl-cross copied to clipboard

cnf/configure_mods.sh: sort the module lists

Open kanavin opened this issue 8 months ago • 2 comments

Sort the order of the module lists from configure_mods.sh since otherwise the result isn't the same leading to makefile differences, and breaks build reproducibility.

Reported upstream: https://github.com/arsv/perl-cross/issues/88

kanavin avatar Mar 31 '25 10:03 kanavin

Mon, Mar 31, 2025 at 03:58:13AM -0700, Alexander Kanavin wrote:

Sort the order of the module lists from configure_mods.sh since otherwise the result isn't the same leading to makefile differences, and breaks build reproducibility.

What's the setup where it's not getting sorted right?

The way it is written now, the order depends on shell pattern expansion and bash is explicitly stated to sort that in the docs. For dash, it is not documented but it seems to sort the expanded list as well.

I suspect the real fix there is the LANG=C part, but then it just needs to be moved before ./configure in the calling script, that's a good idea anyway. And the rest is just irrelevant.

arsv avatar Apr 14 '25 18:04 arsv

What's the setup where it's not getting sorted right? The way it is written now, the order depends on shell pattern expansion and bash is explicitly stated to sort that in the docs. For dash, it is not documented but it seems to sort the expanded list as well. I suspect the real fix there is the LANG=C part, but then it just needs to be moved before ./configure in the calling script, that's a good idea anyway. And the rest is just irrelevant.

bash and dash do sort the shell pattern, but they do it differently. E.g. bash:

$ echo ext/*
ext/Amiga-ARexx ext/Amiga-Exec ext/attributes ext/B ext/Devel-Peek ext/DynaLoader ext/Errno ext/ExtUtils-Miniperl ext/Fcntl ext/FileCache ext/File-DosGlob ext/File-Find ext/File-Glob ext/GDBM_File ext/Hash-Util ext/Hash-Util-FieldHash ext/I18N-Langinfo ext/IPC-Open3 ext/mro ext/NDBM_File ext/ODBM_File ext/Opcode ext/PerlIO-encoding ext/PerlIO-mmap ext/PerlIO-scalar ext/PerlIO-via ext/Pod-Functions ext/Pod-Html ext/POSIX ext/re ext/SDBM_File ext/Sys-Hostname ext/Tie-Hash-NamedCapture ext/Tie-Memoize ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE ext/XS-APItest ext/XS-Typemap

and dash:

$ echo ext/*
ext/Amiga-ARexx ext/Amiga-Exec ext/B ext/Devel-Peek ext/DynaLoader ext/Errno ext/ExtUtils-Miniperl ext/Fcntl ext/File-DosGlob ext/File-Find ext/File-Glob ext/FileCache ext/GDBM_File ext/Hash-Util ext/Hash-Util-FieldHash ext/I18N-Langinfo ext/IPC-Open3 ext/NDBM_File ext/ODBM_File ext/Opcode ext/POSIX ext/PerlIO-encoding ext/PerlIO-mmap ext/PerlIO-scalar ext/PerlIO-via ext/Pod-Functions ext/Pod-Html ext/SDBM_File ext/Sys-Hostname ext/Tie-Hash-NamedCapture ext/Tie-Memoize ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE ext/XS-APItest ext/XS-Typemap ext/attributes ext/mro ext/re

Somehow we (yocto project) ended up carrying two different fixes for this issue (this PR and #155 ), when one would be sufficient: either pin the shell to bash, or explicitly sort the output with external tools after the fact. But the key issue is in configure_mods.sh extdir():

extdir() {
        for i in $1/*; do
...

Probably should be fixed at this point somehow?

kanavin avatar May 02 '25 11:05 kanavin