Skip to content

Commit

Permalink
chore(workspace): Exclude all crates except kona-common from cannon…
Browse files Browse the repository at this point in the history
…/asterisc lint job (#168)

Optimizes the lint jobs by only including the crates with
architecture-specific code (`kona-common`) in the `lint-asterisc` and
`lint-cannon` recipes. All other crates will be linted entirely with the
native lint recipe.

We still include all `no_std` crates in the `build` recipes for `cannon`
/ `asterisc` targets, as these crates still need build coverage to
ensure that they always compile to our required targets.
  • Loading branch information
clabby authored Apr 28, 2024
1 parent c80b713 commit acbd292
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ default:
# Run all tests
tests: test test-online test-docs

# Test for the native target
# Test for the native target with all features
test *args='':
cargo nextest run --workspace --all --all-features $@
cargo nextest run --workspace --all --all-features $@

# Run online tests
test-online:
Expand All @@ -30,23 +30,23 @@ fmt-native-check:
lint-native: fmt-native-check
cargo +nightly clippy --workspace --all --all-features --all-targets -- -D warnings

# Lint the workspace (mips arch)
# Lint the workspace (mips arch). Currently, only the `kona-common` crate is linted for the `cannon` target, as it is the only crate with architecture-specific code.
lint-cannon:
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/:/workdir \
-w="/workdir" \
ghcr.io/ethereum-optimism/kona/cannon-builder:main cargo +nightly clippy --workspace --all --all-features --target /mips-unknown-none.json -Zbuild-std --exclude kona-derive --exclude kona-host -- -D warnings
ghcr.io/ethereum-optimism/kona/cannon-builder:main cargo +nightly clippy -p kona-common --all-features --target /mips-unknown-none.json -Zbuild-std -- -D warnings

# Lint the workspace (risc-v arch)
# Lint the workspace (risc-v arch). Currently, only the `kona-common` crate is linted for the `asterisc` target, as it is the only crate with architecture-specific code.
lint-asterisc:
docker run \
--rm \
--platform linux/amd64 \
-v `pwd`/:/workdir \
-w="/workdir" \
ghcr.io/ethereum-optimism/kona/asterisc-builder:main cargo +nightly clippy --workspace --all --all-features --target riscv64gc-unknown-linux-gnu -Zbuild-std --exclude kona-derive -- -D warnings
ghcr.io/ethereum-optimism/kona/asterisc-builder:main cargo +nightly clippy -p kona-common --all-features --target riscv64gc-unknown-linux-gnu -Zbuild-std -- -D warnings

# Lint the Rust documentation
lint-docs:
Expand All @@ -63,7 +63,7 @@ build: build-native build-cannon build-asterisc
build-native *args='':
cargo build --workspace --all $@

# Build for the `cannon` target
# Build for the `cannon` target. Any crates that require the stdlib are excluded from the build for this target.
build-cannon *args='':
docker run \
--rm \
Expand All @@ -72,7 +72,7 @@ build-cannon *args='':
-w="/workdir" \
ghcr.io/ethereum-optimism/kona/cannon-builder:main cargo build --workspace --all -Zbuild-std $@ --exclude kona-host

# Build for the `asterisc` target
# Build for the `asterisc` target. Any crates that require the stdlib are excluded from the build for this target.
build-asterisc *args='':
docker run \
--rm \
Expand Down

0 comments on commit acbd292

Please sign in to comment.