-
Notifications
You must be signed in to change notification settings - Fork 0
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
Problem with rustflags
in .cargo/config
#4
Comments
Thanks for opening the issue. I have found workspaces are often problematic in embedded projects and tend to avoid them when possible, so didn't consider others would use it like this. I think I can probably just move the linker script configuration into a build script instead, which should I hope resolve the issue. Will take a look into it when I get a chance. |
Well, I thought this should be simple. Unfortunately, it's seemingly impossible to pass the If anybody has a solution to this I'm all ears, but at least from reading the documentation I'm not seeing a path forward. All I can do is recommend avoiding workspaces for embedded projects. Hopefully one day Cargo is more flexible. |
In my case, I wasn't really using workspaces. I had a cargo directory setup on the top level, and another one (for lower level C bindings) as a subdirectory. Have split this to two folders, so btw. |
I'm placing my code on this template, and noticed one gotcha which I think you should know about.
The problem is,
.cargo/config
s of parent folders affect subprojects, and there's seemingly no way to cut this chord. In my case, a subproject does a "raw" (C to Rust) binding that the main project would then like to use.So: what's the actual problem?
When doing
cargo build
in the subproject, I get a linkage error:That subproject doesn't need
defmt
at all. It's very weird (imho) that the parent folder affects this way, but the ideology behind.cargo/config.toml
seems to be that environment stuff goes there, not project specific stuff. I'm trying to find a way to moverustflags
..away from there and into
Cargo.toml
- but there might not be such a way.Work-around
Obviously, I can make the parent project into a sister folder, like
main
andraw
. Currently, I am not aware of another means to bypass this. The issue on doing something about incargo
is open since Nov'19.The text was updated successfully, but these errors were encountered: