Compare commits

..

1 Commits

Author SHA1 Message Date
7ef45977c8 ci: simulate Pikaur flag duplication in Arch Linux CI
Some checks failed
CI Code / Code Coverage (pull_request) Successful in 2m46s
CI Code / Linux (debian) (pull_request) Successful in 4m48s
CI Code / Linux (arch) (pull_request) Successful in 5m30s
CI Code / Check spelling (pull_request) Failing after 13m14s
CI Code / Check coding style (pull_request) Failing after 13m18s
CI Code / Linux (ubuntu) (pull_request) Failing after 13m23s
Inject system flags from /etc/makepkg.conf into the CI environment to
detect build collisions caused by Pikaur's configuration bug.

Pikaur's cascading logic causes flags from /etc/makepkg.conf to be
merged into the build environment. This creates collisions with flags
defined in the project's Makefile.am (e.g., duplicate -D_FORTIFY_SOURCE
definitions), which can cause builds to fail for users.

By exporting these flags in the CI environment, we ensure that any
code change that is sensitive to flag duplication will trigger a
failure in our Arch Linux CI matrix, preventing broken builds from
reaching users.

Implementation details:
- Detects Arch Linux via /etc/os-release.
- Uses a sed-based flattener to handle multi-line variables and
  trailing backslashes in makepkg.conf.
- Exports the flags to the shell environment so that 'configure'
  and 'make' inherit them naturally, maintaining parity with a
  real Pikaur session.
2026-04-19 13:13:51 +00:00

View File

@@ -207,17 +207,7 @@ case "$ARCH" in
if grep -q 'ID=arch' /etc/os-release 2>/dev/null && [ -f /etc/makepkg.conf ]; then
echo "--> [Parity Mode] Simulating Pikaur collision..."
get_flag() {
sed ':a;N;$!ba;s/\\\n[[:space:]]*/ /g' /etc/makepkg.conf | \
grep "^$1=" | cut -d'=' -f2- | tr -d '"' | tr -d "'" | xargs
}
export CFLAGS=$(get_flag "CFLAGS")
export LDFLAGS=$(get_flag "LDFLAGS")
echo " Environment CFLAGS: $CFLAGS"
echo " Environment LDFLAGS: $LDFLAGS"
source /etc/makepkg.conf
fi
;;
darwin*)