Repository navigation
build: keep TARGET out of Buildroot's environment - #2795
Merged
Merged
Conversation
`make TARGET=...` exported TARGET to every recipe and passed it to sub-makes through MAKEFLAGS, so it reached each package's configure. host-libffi's AX_ENABLE_BUILDDIR treats $TARGET as a build subdirectory, then re-runs ../../configure from inside it and fails with exit 127. That broke the multi-board pattern CLAUDE.md recommends for any board that pulls in host-python3. Buildroot already gets O=$(TARGET), and repack-final passes TARGET explicitly, so drop it from MAKEOVERRIDES and unexport it. Fixes #2794
openipc-ai
requested review from
cronyx,
flyrouter and
viktorxda
as code owners
November 8, 2026 06:52
PR Summary by QodoPrevent TARGET from leaking into Buildroot builds
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can pick a display mode instead of tweaking every Display option by hand |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2794.
Symptom
make BOARD=<board> TARGET=$(PWD)/output-<board>fails in host-libffi on any board that pulls in host-python3. CLAUDE.md recommends this pattern for building more than one board locally. Reported by DeathCamel58 in #2793.Cause
A variable set on the make command line is exported to every recipe and passed to sub-makes through
MAKEFLAGS. So ourTARGETreached Buildroot and every package's configure. host-libffi is autoreconf'd, and itsAX_ENABLE_BUILDDIRreads$TARGETas the name of a build subdirectory: it creates it,cds in, and re-runs../../…/configure, which isn't there for an absolute path.Fix
MAKEOVERRIDES := $(filter-out TARGET=%,$(MAKEOVERRIDES))andunexport TARGET, right afterTARGET ?=. OurMakefilestill usesTARGETas before. Buildroot is told where to build byO=$(TARGET), and the one recursive call into this file that needsTARGET(repack-final) already passes it explicitly. Nothing undergeneral/or.github/scripts/readsTARGETfrom the environment.Evidence
make BOARD=s3l_ultimate TARGET=<dir> br-host-libffifrom a clean output directory, with the sameBR2_DL_DIR:master
Makefile:This branch: exit 0.
host-libffi-3.4.4reaches.stamp_configured,.stamp_builtand.stamp_host_installed.A probe sub-make shows the propagation directly. On master,
make TARGET=/x/output-boardgives the sub-makeMAKEFLAGS=[... BOARD=s3l_ultimate TARGET=/x/output-board]andenv TARGET=/x/output-board. With this change, both are gone. The same holds whenTARGETcomes from the environment rather than the command line.Scope
Build system only. CI runs plain
make BOARD=..., whereTARGETcomes from?=and was never exported, so CI builds see no difference, and image contents can't change from this. Nothing here runs on a camera, so there's no hardware evidence to give.ci-matrix.py --self-testpasses. The selector builds every board for aMakefilechange, as it should.