Skip to content

debugflags: ensure to only append debug flags once when building

During a package build we call prepare_buildenv in multiple stages of the process. For debug packages, one of the hooks is buildenv_debugflags which populates the debug flags to the according variables.

The issue is that the behavior of the current implementation of buildenv_debugflags is not idempotent, so consecutive calls will append the same flags again. In certain cases this isn't an issue, however for context aware build frontends like cargo any change of the build inputs leads to a fresh build. This means that any invocation of such a build ecosystem inside the package() function will trigger a full rebuild, which is not desired.

To fix this issue, this commit makes buildenv_debugflags idempotent by only appending flags once to the target variables.

Signed-off-by: Levente Polyak anthraxx@archlinux.org

Merge request reports