-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
env!("OUT_DIR") macro #1967
env!("OUT_DIR") macro #1967
Conversation
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.
pls give a hint on how do we search for the OUT_DIR in the workspace given that we have
I don't have any better suggestions here than "look at what Cargo does, and do the same" :)
Highly relevant: https://github.com/rust-lang/cargo/blob/b03182a8ff0117ffa1c426119ae2b5a418776bbd/src/cargo/core/compiler/context/compilation_files.rs#L216-L220
If nightly cargo is used, { "invocations": [
{ "package_name": "this-package",
"target_kind": [ "custom-build" ],
"compile_mode": "run-custom-build",
"env": { "OUT_DIR": "/absolute/path/to/target/debug/build/this-package-hash/out" }
}
]} This is present even if the build is fresh and would not be rerun, but does seem to make the build stale and queue a new full rebuild 😞 I think the "best" option would to be adding |
Also related: intellij-rust's implementation of They use |
@eupn are you still interested in this patch? I'd be happy to continue to implement it. |
@edwin0cheng go ahead! |
Current status: OUT_DIR for a given build script is reported in the build script's build-script-executed message. rust-lang/cargo#7622 Here's IntelliJ Rust's (currently off-by-default) support for OUT_DIR: intellij-rust/intellij-rust#4734 (unless they've done more recently, ofc). |
Yeah, and the current status of RA part : We have implemented basic |
Hello,
This PR is related to the #1964.
@matklad pls give a hint on how do we search for the
OUT_DIR
in the workspace given that we have atarget_path
fromcargo metadata
and can use that.