-
Notifications
You must be signed in to change notification settings - Fork 261
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
"Cargo has produced more than one binary artifact" error even though only one kind: "bin"
target is logged
#104
Comments
The trouble is that cargo's json format is barely documented, so I have to go by trial-and-error to figure out the possible values in its output. And I did not test on MaxOS yet. Can you try adding |
If you can tell me how you parse cargo's messages (or point me to the right place in the code), I can follow up with the cargo team, if you want. |
@killercup: yeah, it'd be nice if cargo had a story for IDE integration. The code is here. I'm assuming that each filename in the "compiler-artifact" message corresponds to a target kind. This is probably wrong... as your example shows. |
I'm pretty sure better IDE and build system integration is on the agenda of the cargo team. :) I'll try to look into this, but for now I'll cc @rust-lang/cargo Edit: Ah, hm, cross-project mentioning of teams doesn't work? Well, in that case, I choose: |
Heh, I think we have had exactly the same issue in IntelliJ Rust. Here's how we handle it: https://github.com/intellij-rust/intellij-rust/blob/c90bbc7fed95eeb2e603fbb102f88839488ff303/debugger/src/main/kotlin/org/rust/debugger/runconfig/RsDebugRunner.kt#L140-L157 |
@matklad: lol. Ok, I guess I'm gonna have to filter on file names too. Is there an RFC yet for cargo integration with external build systems / IDEs? (hmm, are those the same thing?) Edit: Is it this one: rust-lang/rfcs#2136 ? |
The RFC for build systems is rust-lang/rfcs#2136. I don't think there were plans for better integration with IDEs specifically. At least to me, the IDE part seems to be a mostly solved problem, modulo lack of the docs. RLS links directly to Cargo, so it has everything available. IntelliJ uses The docs are here, but they are "here's the entry point, go figure out everything else yourself": https://doc.rust-lang.org/cargo/reference/external-tools.html :-( I am the person to ping on GitHub/Gitter/IRC if more details are needed :) |
I would disagree on this one. Yes, we've coded up something that seems to work. But I would expect new edge cases to keep falling out, especially as rustc/cargo evolve. Heuristics like "files ending with dSYM are not runnable binaries" are fragile. |
No disagreement here! I've meant that the basic building blocks are in place, so we only need to fix existing bugs, smooth rough edges and keep up with Cargo's own evolution, and that we don't need an RFC which proposes radically new ways for interaction between Cargo and IDE (which we do need for build-systems stuff). I've filed rust-lang/cargo#5426 for this specific problem. For build scripts issue, a somewhat similar thing was tried in rust-lang/cargo#3866: in some cases the environment is important for running the actual binary itself. We eventually postponed that, because that was a fix for a niche problem for integration that hadn't been implemented at that time! Build scripts are an interesting variation of that problem, in that we need the same data (binary + args + env), but, at the same time, we don't want to actually prevent Cargo from running the binaries itself! |
This should've been fixed in one of the updates. |
What is the problem and how did you get there:
Wanted to try the new release of vscode-lldb by debugging the
cli
binary from rust-fuzz/targets#103. I added a new "LLDB" configuration from the debug menu, was very positively surprised to see all the cargo targets automatically added (3.5k lines in this particular case), selected "Debug cli" and pressed play.A model alert told me
while the Output panel for LLDB (opened automatically) shows:
What did you expect to have happened instead: Not getting an error
I assume that the dSYM artifact can be skipped safely?
The text was updated successfully, but these errors were encountered: