Skip to content
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

Support building workspace with separate build-std parameters #57

Closed
jschwe opened this issue Jun 14, 2020 · 2 comments
Closed

Support building workspace with separate build-std parameters #57

jschwe opened this issue Jun 14, 2020 · 2 comments

Comments

@jschwe
Copy link

jschwe commented Jun 14, 2020

Suppose we have a workspace with crate A, that should build with build-std=core,alloc and crate B with build-std=std,core,alloc, [...]. Additionally crate B links with / depends on crate A.
It would be great if there was a way to configure separate build-std parameters for each crate directly in cargo, without resorting to a custom-build script or a RUSTC_WRAPPER.

Motivation

In my case crate A would be a [no_std] (uni-)kernel and crate B some application, that links to the kernel. Currently linking is done via a build-script, but in the long-term I'm hoping it's possible to support such a configuration directly in cargo.
There is a similar (open) issue in cargo regarding supporting separate targets for each crate when calling cargo build. The motivation is similar and I suspect implementing a solution would be similar for both issues too.

@Ericson2314
Copy link

I think what you want is #5 --- way to specify the standard library depencies in Cargo.toml like any other dependency. build-std=.* is blatantly non-compositional, and only was included for sake of getting a prototype out there.

@Ericson2314
Copy link

See also #51 for what amounts to the build of rustc and the standard library itself hitting this issue.

@jschwe jschwe closed this as completed Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants