Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy committed Nov 28, 2023
1 parent b621a43 commit 14bd551
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 6 additions & 9 deletions docs/src/guides/languages/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,20 @@ VERSION 0.7
builder:
FROM ./../../earthly/rust+rust-base
DO ./../../earthly/rust+CP_SRC --src=".cargo, .config, benches, src, tests"
DO ./../../earthly/rust+CP_SRC --src="Cargo.lock, Cargo.toml"
DO ./../../earthly/rust+CP_SRC --src="clippy.toml, deny.toml, rustfmt.toml"
COPY --dir .cargo .config benches src tests .
COPY Cargo.lock Cargo.toml .
COPY clippy.toml deny.toml rustfmt.toml .
DO ./../../earthly/rust+SETUP
```

The first target `builder` is responsible for preparing an already configured Rust environment,
instal all needed tools and dependencies.

The fist step of the `builder` target is to prepare a Rust environment via `+rust-base` target.
Next step is to copy source code of the project with the help of `+CP_SRC` UDC target.
Next step is to copy source code of the project.
Note that you need to copy only needed files for Rust build process,
any other irrelevant stuff should omitted,
because it could overloads build process with unused files.
The `+CP_SRC` command has only argument `src` where you can provide files, directories separated by comma,
as it has been shown in example.

any other irrelevant stuff should omitted.
And finally finalize the build with `+SETUP` UDC target.
The `+SETUP` UDC target requires `rust-toolchain.toml` file,
with the specified `channel` option in it.
Expand Down
7 changes: 4 additions & 3 deletions examples/rust/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ VERSION 0.7
builder:
FROM ./../../earthly/rust+rust-base

DO ./../../earthly/rust+CP_SRC --src=".cargo, .config, benches, src, tests"
DO ./../../earthly/rust+CP_SRC --src="Cargo.lock, Cargo.toml"
DO ./../../earthly/rust+CP_SRC --src="clippy.toml, deny.toml, rustfmt.toml"
COPY --dir .cargo .config benches src tests .
COPY Cargo.lock Cargo.toml .
COPY clippy.toml deny.toml rustfmt.toml .

DO ./../../earthly/rust+SETUP

# Test rust build container - Use best architecture host tools.
Expand Down

0 comments on commit 14bd551

Please sign in to comment.