On 4/21/21 11:43 AM, morganamilo wrote:
Before, the functions would be run aphabetically.
Now we ensure buildflags and makeflags are wiped first, then we apply other options, before copying the buildflags into debugflags.
What's the practical effect you're trying to accomplish here? (It does not matter when we unset MAKEFLAGS, and to a lesser extent it does not matter whether we append to CFLAGS before or after unsetting it, since it will not be exported if it is unset.) How does this fit into people providing their own dropins? This is, in general, the same problem as https://bugs.archlinux.org/task/53770 And the same unsatisfying proposed solution too. If ordering matters, you can't assume sane ordering of the Arabic numerals and you definitely can't assume alphanumeric ordering is stable.
diff --git a/scripts/libmakepkg/buildenv.sh.in b/scripts/libmakepkg/buildenv.sh.in index b75d792a..a4f1c6f5 100644 --- a/scripts/libmakepkg/buildenv.sh.in +++ b/scripts/libmakepkg/buildenv.sh.in @@ -31,6 +31,7 @@ done readonly -a buildenv_functions build_options
prepare_buildenv() { +echo ${buildenv_functions[@]}
Debug print.
for func in ${buildenv_functions[@]}; do $func done diff --git a/scripts/libmakepkg/buildenv/buildflags.sh.in b/scripts/libmakepkg/buildenv/10-buildflags.sh.in similarity index 100% rename from scripts/libmakepkg/buildenv/buildflags.sh.in rename to scripts/libmakepkg/buildenv/10-buildflags.sh.in diff --git a/scripts/libmakepkg/buildenv/makeflags.sh.in b/scripts/libmakepkg/buildenv/20-makeflags.sh.in similarity index 100% rename from scripts/libmakepkg/buildenv/makeflags.sh.in rename to scripts/libmakepkg/buildenv/20-makeflags.sh.in diff --git a/scripts/libmakepkg/buildenv/compiler.sh.in b/scripts/libmakepkg/buildenv/30-compiler.sh.in similarity index 100% rename from scripts/libmakepkg/buildenv/compiler.sh.in rename to scripts/libmakepkg/buildenv/30-compiler.sh.in diff --git a/scripts/libmakepkg/buildenv/flags.sh.in b/scripts/libmakepkg/buildenv/40-flags.sh.in similarity index 100% rename from scripts/libmakepkg/buildenv/flags.sh.in rename to scripts/libmakepkg/buildenv/40-flags.sh.in diff --git a/scripts/libmakepkg/buildenv/lto.sh.in b/scripts/libmakepkg/buildenv/50-lto.sh.in similarity index 100% rename from scripts/libmakepkg/buildenv/lto.sh.in rename to scripts/libmakepkg/buildenv/50-lto.sh.in diff --git a/scripts/libmakepkg/buildenv/debugflags.sh.in b/scripts/libmakepkg/buildenv/60-debugflags.sh.in similarity index 100% rename from scripts/libmakepkg/buildenv/debugflags.sh.in rename to scripts/libmakepkg/buildenv/60-debugflags.sh.in diff --git a/scripts/libmakepkg/buildenv/meson.build b/scripts/libmakepkg/buildenv/meson.build index a69accb7..8ca2d085 100644 --- a/scripts/libmakepkg/buildenv/meson.build +++ b/scripts/libmakepkg/buildenv/meson.build @@ -1,12 +1,12 @@ libmakepkg_module = 'buildenv'
sources = [ - 'buildflags.sh.in', - 'compiler.sh.in', - 'debugflags.sh.in', - 'flags.sh.in', - 'lto.sh.in', - 'makeflags.sh.in', + '10-buildflags.sh.in', + '20-makeflags.sh.in', + '30-compiler.sh.in', + '40-flags.sh.in', + '50-lto.sh.in', + '60-debugflags.sh.in', ]
foreach src : sources
-- Eli Schwartz Bug Wrangler and Trusted User