diff --git a/docs/src/guides/languages/rust.md b/docs/src/guides/languages/rust.md index cb16f2ff1..5c131b9e2 100644 --- a/docs/src/guides/languages/rust.md +++ b/docs/src/guides/languages/rust.md @@ -55,7 +55,7 @@ VERSION 0.7 builder: FROM ./../../earthly/rust+rust-base - COPY --dir .cargo .config benches src tests . + COPY --dir .cargo .config crates . COPY Cargo.lock Cargo.toml . COPY clippy.toml deny.toml rustfmt.toml . @@ -145,12 +145,12 @@ The same approach we will see for the another targets of this guide. build-hosted: FROM +builder - DO ./../../earthly/rust+BUILD + DO ./../../earthly/rust+BUILD --libs="bar" --bins="foo/foo" - DO ./../../earthly/rust+SMOKE_TEST --bin=hello_world + DO ./../../earthly/rust+SMOKE_TEST --bin="foo" SAVE ARTIFACT target/$TARGETARCH/doc doc - SAVE ARTIFACT target/$TARGETARCH/release/hello_world hello_world + SAVE ARTIFACT target/$TARGETARCH/release/foo foo # Test which runs check with all supported host tooling. Needs qemu or rosetta to run. # Only used to validate tooling is working across host toolsets. diff --git a/examples/rust/Cargo.toml b/examples/rust/Cargo.toml index 9f4feef57..0dee97239 100644 --- a/examples/rust/Cargo.toml +++ b/examples/rust/Cargo.toml @@ -5,5 +5,10 @@ members = [ "crates/bar", ] +[workspace.package] +edition = "2021" +version = "0.0.1" +license = "MIT OR Apache-2.0" + diff --git a/examples/rust/Earthfile b/examples/rust/Earthfile index 7852e7956..4ac2d3dac 100644 --- a/examples/rust/Earthfile +++ b/examples/rust/Earthfile @@ -28,7 +28,7 @@ check-all-hosts: build-hosted: FROM +builder - DO ./../../earthly/rust+BUILD --bins="foo/foo" + DO ./../../earthly/rust+BUILD --libs="bar" --bins="foo/foo" DO ./../../earthly/rust+SMOKE_TEST --bin="foo" diff --git a/examples/rust/crates/bar/Cargo.toml b/examples/rust/crates/bar/Cargo.toml index 825efac34..69718b06b 100644 --- a/examples/rust/crates/bar/Cargo.toml +++ b/examples/rust/crates/bar/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "bar" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/examples/rust/crates/foo/Cargo.toml b/examples/rust/crates/foo/Cargo.toml index 4ddb40c85..a0596fb28 100644 --- a/examples/rust/crates/foo/Cargo.toml +++ b/examples/rust/crates/foo/Cargo.toml @@ -1,7 +1,8 @@ [package] name = "foo" -version = "0.1.0" -edition = "2021" +version.workspace = true +edition.workspace = true +license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html