-
Notifications
You must be signed in to change notification settings - Fork 295
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
chore: Fixed incorrect use of cfg! macro and update build.rs to support arm target #1458
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
48a5ffc
chore: Fixed incorrect use of cfg! macro and update build.rs to suppo…
Chiichen 6a62664
chore: fix the gn/ninja install path
Chiichen 746ab7b
chore: revert clang submodule update
Chiichen f2db4cf
Merge branch 'main' into fix-build-script
Chiichen 4e30365
style: resolve clippy warnings
Chiichen a9ab682
Update build.rs
mmastrac edf9b88
ci: use macos12 to ensure that the host's architecture is x86-64
Chiichen 0b5bf66
chore: update rust targets in rust-toolchain.toml
Chiichen 5164e89
Merge branch 'main' into fix-build-script
mmastrac File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Submodule clang
updated
from 5016a8 to 3344dd
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.
Can you add a few lines here with a note explaining why
cfg!
isn't appropriate for future contributors to this file? The commentary from the PR description will work.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.
Of course! Actually #[cfg(...)] attributes don't work as expected from build.rs -- they refer to the configuration of the host system which the build.rs script will be running on. In short,
cfg!(target_<os/arch>)
is actually thehost os/arch
instead of target os/arch while cross compiling. Instead, Environment viariables is the officially approach to get the target os/arch in build.rs.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.
Maybe some parts of the original code that use the cfg!(target_<os/arch>) macro are used to obtain the host <os/arch>, but I think using this ambiguous syntax is not conducive to long-term maintenance. It's highly recommended to use the
HOST
environment variable to get the host triplet or use cfg!(target_<os/arch>) with explicit annotation