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

Edition 3 post-2 build-dependencies problem #1303

Closed
GloamXun opened this issue Mar 3, 2024 · 4 comments
Closed

Edition 3 post-2 build-dependencies problem #1303

GloamXun opened this issue Mar 3, 2024 · 4 comments

Comments

@GloamXun
Copy link

GloamXun commented Mar 3, 2024

Hi, I'm trying to follow the guide in edition 3 post-2. After I add build-dependencies as blog_os crate is, the cargo build command doesn't compile kernel and bootloader_api.

[build-dependencies]
kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none" }

My Cargo.toml is:

[package]
name = "my_os"
version = "0.1.0"
edition = "2021"

[workspace]
members = ["kernel"]

[dependencies]

[build-dependencies]
kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none" }

And the Cargo.toml in kernel crate is:

[package]
name = "kernel"
version = "0.1.0"
edition = "2021"

[dependencies]
bootloader_api = "0.11"

The output of cargo build is:

cargo build 
Compiling my_os v0.1.0 (/home/gloamxun/Project/my_os)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s

And when I try to get the output of 'cargo tree', it goes like this:

cargo tree
thread 'main' panicked at src/cargo/core/resolver/features.rs:323:14:
activated_features for invalid package: features did not find PackageId { name: "kernel", version: "0.1.0", source: "/home/gloamxun/Project/my_os/kernel" } HostDep
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is there something wrong with my configuration?

@GloamXun
Copy link
Author

GloamXun commented Mar 4, 2024

Sorry to bother you. I continue to follow the rest of the post. I finish the build.rs. I found that the cargo tree command still had the same problem, but It was finally built.

@GloamXun GloamXun closed this as completed Mar 4, 2024
@phil-opp
Copy link
Owner

phil-opp commented Mar 4, 2024

cargo tree currently has a problem with artifact dependencies, see rust-lang/cargo#10593. There is an open PR to fix this, but it's still waiting for review.

@GloamXun
Copy link
Author

GloamXun commented Mar 4, 2024

cargo tree currently has a problem with artifact dependencies, see rust-lang/cargo#10593. There is an open PR to fix this, but it's still waiting for review.

Thank you for your reply. It seems like it's not a big problem, the whole project works fine. By the way, when edition 3 is fully completed, I can assist with Chinese translation.

@phil-opp
Copy link
Owner

phil-opp commented Mar 4, 2024

Thank you!

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