env!("OUT_DIR") macro#1967
Conversation
matklad
left a comment
There was a problem hiding this comment.
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_DIRin the workspace given that we have atarget_pathfromcargo metadataand can use that.