-
Notifications
You must be signed in to change notification settings - Fork 42
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
Use default-members in Cargo workspace #58
Conversation
Cargo.toml
Outdated
[profile.dev] | ||
panic = "abort" | ||
lto = true | ||
rpath = false |
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.
rpath can be removed I think?
@@ -1,3 +1,4 @@ | |||
{ | |||
"rust-analyzer.linkedProjects": ["Cargo.toml", "{{project-name}}-ebpf/Cargo.toml"] | |||
"rust-analyzer.checkOnSave.allTargets": false, |
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.
why do we need to set this to false?
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.
because it suppresses a really annoying "cannot find module for test
" message in RA - which happens because it's attempting to analyze the bpf crates as x86_64. There isn't a way (yet) to say these crates are only supported on these subset of targets as far as RA is concerned.
@@ -1,3 +1,4 @@ | |||
{ | |||
"rust-analyzer.linkedProjects": ["Cargo.toml", "{{project-name}}-ebpf/Cargo.toml"] | |||
"rust-analyzer.checkOnSave.allTargets": false, | |||
"rust-analyzer.checkOnSave.command": "clippy" |
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.
is this not the default?
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.
@dave-tucker I tested this a bit. This syntax
only affects the single module in the workspace but not its dependencies. This means for example that a dependency of {{project-name}} like I got my test project to work by adding I have seen that cargo |
Adds bpf code to the workspace and is excluded by default. This allows for all deps to be managed in Cargo.lock and for cargo update to work as expected from the root. Similarly, rustfmt and clippy can operate on the whole workspace. Signed-off-by: Dave Tucker <[email protected]>
d329ae2
to
098879e
Compare
Yeah this is unfortunate. Feel free to test again - this has now been added into the |
This doesn’t seem like a great idea, it breaks profiles and at the moment is only needed for debug support, which we don’t support yet. I don’t think we should do this as part of this PR. |
Never mind I missed the other comment about cfg syntax not working for profiles. Omg so many papercuts |
"-C", "lto=yes", | ||
"-C", "embed-bitcode=yes", | ||
"-C", "debuginfo=2", |
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.
We should not turn this on now. It’ll make building slower for no reason
Consider rebasing this after #123. |
This will be closed by #124. |
Adds bpf code to the workspace and is excluded by default.
This allows for all deps to be managed in Cargo.lock and for cargo
update to work as expected from the root.
Similarly, rustfmt and clippy can operate on the whole workspace.
Signed-off-by: Dave Tucker [email protected]