-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rustpkg needs to support building multiple interdependent crates #5808
Comments
Perhaps I'm misunderstanding, but as long as there are no cyclic dependencies between the crates, you should be able to just sequentially build and install each crate. Rust doesn't allow cyclic dependencies between crates. |
(This may be different from what I said the other day -- I think I didn't get it the first time you asked this question.) |
No, there are no cyclic dependencies. This is what happens when building my
|
Forgive me if this is obvious, but have you used a "-L" directive to tell rust where to find the compiled crate? I believe rust's usage follows the lead of most C linkers, here. |
What directive? I couldn't find it documented anywhere. Grepping "-L" through Rust source does not reveal anything relevant either. |
@mzabaluev, it's described in |
A more specific question would be: is there a way to pass linker flags in the context of |
@mzabaluev I understand what the problem is now. I think with rustpkg we'll want to make it so that you don't need to specify |
It could be as simple as: #[pkg_crate(file = "foo/foo.rc")];
#[pkg_crate(file = "bar/bar.rc")];
#[pkg_crate(file = "baz.rc",
link_opts(dir = "foo", dir = "bar"))];
// a rustc command line equivalent is -L foo -L bar |
I'm looking over the rustpkg bugs and I think #5681 covers this. Comment if you disagree. |
To truly support building packages containing multiple crates, rustpkg should have a way to link the constituent crates against one another as they are being built. A branch of my pet project captures what I was trying to do with a
pkg.rs
.The text was updated successfully, but these errors were encountered: