-
Notifications
You must be signed in to change notification settings - Fork 3
ext-cli: resolve $CC from the cross-canadian bindir, not the target sysroot #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
03a770c
ext-cli: resolve $CC from the cross-canadian bindir, not the target s…
mobileoverlord 215e2f3
ext-cli: install the C cross-canadian toolchain
mobileoverlord 60953ec
ext-cli: require the SDK env vars before deriving the cross bindir
mobileoverlord a4910bf
ext-cli: qemuarm64 for the cross-arch leg, and harden the compiler guard
mobileoverlord a9feb3a
compile: name the cross compiler from CROSS_COMPILE, not $CC
mobileoverlord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty
CC_BINmakes-xtest the bindir dir, so the guard passesWhen
$CC's first token resolves to empty,[ ! -x "$CROSS_BINDIR/$CC_BIN" ]tests$CROSS_BINDIRitself, and-xis true for any searchable directory - so the guard silently passes on exactly the case it exists to catch.Reproduced against this logic: with the toolchain genuinely absent and
CC=" aarch64-avocado-linux-gcc -mcpu=cortex-a57"(leading space),${CC:-...}does not fire because the value is non-empty, and${CC_BIN%% *}yields the empty string. The control run printsGUARD FIRED; the leading-space run printsGUARD PASSEDand proceeds tocargo buildwithCC_BIN=[]. The build then dies insideaws-lc-syswith the opaqueToolNotFoundthis block was added to pre-empt.Worth noting cc-rs handles this input fine -
cc-1.2.61src/lib.rs:3224trims and:3225returnsNoneon empty. Only the guard does not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a9feb3a. This is the one that mattered most — a guard that reports success on the exact condition it was added to catch is worse than no guard.
Reproduced your leading-space case first (
CC=" aarch64-avocado-linux-gcc -mcpu=cortex-a57", toolchain absent →PASSED), then confirmed it fires after the change.-xon a searchable directory being true is an easy thing to write twice, so it is worth having in the thread.