forked from gnzlbg/jemallocator
-
Notifications
You must be signed in to change notification settings - Fork 100
passthrough cc env/args using native cc features #158
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
Open
PDXKimani
wants to merge
2
commits into
tikv:main
Choose a base branch
from
PDXKimani:cc-env-passthrough
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
🧩 Analysis chain
🌐 Web query:
cc crate Rust cflags_env cc_env methods version💡 Result:
In the Rust
cccrate,cc_envandcflags_envare methods oncc::Tool(not oncc::Build):Tool::cc_env() -> OsString: returns a string formatted like theCCenvironment variable (primarily useful whenCCis a wrapper likesccache cc), or an empty string if no such wrapper/CCenv was involved. [1]Tool::cflags_env() -> OsString: returns the tool’s computed compiler arguments formatted like theCFLAGSenvironment variable (note: it’s the tool’s internal args, not necessarily the user’sCFLAGS). [1]Typical usage:
What version added these methods?
They were added after
cc1.0.0 and are present bycc1.0.26:Toolhas nocc_env/cflags_env). [2]pub fn cc_envandpub fn cflags_envexist). [3]So, if you need these APIs, require
cc >= 1.0.26.Sources:
[1]
cc::Tooldocs (latest) showingcc_env/cflags_envand their semantics. (docs.rs)[2]
cc-rstagupstream/1.0.0src/lib.rs(nocc_env/cflags_env). (chromium.googlesource.com)[3]
cc-rstagupstream/1.0.26src/lib.rs(includescc_env/cflags_env). (chromium.googlesource.com)Citations:
🏁 Script executed:
Repository: tikv/jemallocator
Length of output: 110
🏁 Script executed:
Repository: tikv/jemallocator
Length of output: 1635
Update
ccdependency to require version 1.0.26 or later.The code uses
cc_env()andcflags_env()methods oncc::Tool, which were not available in cc 1.0.13 (the minimum version specified inCargo.toml). These methods were added in cc 1.0.26. Update the build-dependency tocc = "^1.0.26"to ensure the methods are available.🤖 Prompt for AI Agents
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.
These both exist in https://docs.rs/cc/1.0.13/cc/struct.Tool.html
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.
@PDXKimani, you are correct — I apologize for the incorrect review comment. Thecc_env()andcflags_env()methods oncc::Toolare present even in cc 1.0.10, and per the docs you linked, they are definitely available in cc 1.0.13 as well. No version bump is needed. My earlier concern was mistaken.✏️ Learnings added