CI: Simulate Pikaur flag duplication in Arch Linux builds (fix #55) #108
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/pikaur-parity-arch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR introduces a simulation layer in the Arch Linux CI runner to detect build failures caused by Pikaur's flag duplication bug. This ensures that any code change which causes a flag collision (e.g.,
-D_FORTIFY_SOURCEconflicts) will be caught in CI before it breaks the build for our Arch users.The Problem
Pikaur's
makepkg_config.pyhas a cascading logic flaw: it pulls flags from/etc/makepkg.confand merges them into the build environment.This creates a collision when our project's
Makefile.amdefines its own flags. For example, if the system defines-D_FORTIFY_SOURCE=3and our Makefile defines-D_FORTIFY_SOURCE=2, the resulting compiler command contains both, causing a "variable redefined" error. Currently, our CI is "too clean"—it uses a standard environment that doesn't trigger this bug, allowing broken code to pass CI and fail in the hands of users.The Solution
I have updated
ci-build.shto mimic a "dirty" Pikaur environment specifically when running on Arch Linux.Key Changes:
grepidentifiesID=archin/etc/os-release. This prevents accidental corruption of Debian/Ubuntu CI runs.get_flaghelper usingsedto flatten multi-line variables in/etc/makepkg.conf. This correctly handles trailing backslashes (\) and whitespace, preventing syntax errors in the exported strings.exports the systemCFLAGSandLDFLAGSdirectly into the shell. This allowsconfigureandmaketo pick up the "corrupt" flags naturally, exactly as they would in a real Pikaur session.How to Verify
Makefile.am(e.g., a different version of a macro used inmakepkg.conf). The Arch CI should now fail.Fixes #55
ci: simulate Pikaur flag duplication in Arch Linux CIto CI: Simulate Pikaur flag duplication in Arch Linux builds (fix #55)Last build should fail, indicating parity with Pikaur builds
As expected, build failed on Arch (only on Arch, confirming that Ubuntu and Debian are not affected). Code Coverage job has also failed due to the fact that it's also run on Arch. Collision and neutrality tests are passed.
4611bd339dto8c6c9f4f428c6c9f4f42to7ef45977c84a59ccaa80to04dafdf36fNotes:
After review by @jabber.developer2, it was decided to use
source /etc/makepkg.confmethod instead. It was also tested via the same method. Results:set -a, the parity is not achieved since variable set in themakepkg.confare not propagated furtherset -a, the first run of the job 336 failed due to CI issue. Runners were restarted. The second time, it failed as expected (arch & code coverage).Tests have shown that this implementation is valid.
04dafdf36fto0feacbc9da