Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version:
format: 1
# Minimum zepter version that is expected to work. This is just for printing a nice error
# message when someone tries to use an older version.
binary: 0.13.2

# The examples in the following comments assume crate `A` to have a dependency on crate `B`.
workflows:
check:
- [
"lint",
# Check that `A` activates the features of `B`.
"propagate-feature",
# These are the features to check:
"--features=64-bit,m,a,c,test-utils",
# Do not try to add a new section into `[features]` of `A` only because `B` exposes that feature. There are edge-cases where this is still needed, but we can add them manually.
"--left-side-feature-missing=ignore",
# Ignore the case that `A` is outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
"--left-side-outside-workspace=ignore",
# Only check normal dependencies.
# Propagating to dev-dependencies leads to compilation issues.
"--dep-kinds=normal:check,dev:ignore",
"--show-path",
"--quiet",
]
default:
# Running `zepter` with no subcommand will check & fix.
- [$check.0, "--fix"]

# Will be displayed when any workflow fails:
help:
text: |
Brisc uses the Zepter CLI to detect abnormalities in Cargo features, e.g. missing propagation.

It looks like one more checks failed; please check the console output.

You can try to automatically address them by installing zepter (`cargo install zepter --locked`) and simply running `zepter` in the workspace root.
links:
- "https://github.com/ggwpez/zepter"
17 changes: 17 additions & 0 deletions .github/workflows/rust_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,20 @@ jobs:
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

zepter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install zepter
run: |
cargo install zepter -f --locked
zepter --version
- name: Format features
run: |
zepter format features
- name: Lint features
run: |
zepter
12 changes: 6 additions & 6 deletions crates/emu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ rstest.workspace = true
criterion.workspace = true

[features]
default = ["64-bit", "m", "a", "c"]
test-utils = ["dep:rstest"]
default = [ "64-bit", "a", "c", "m" ]
test-utils = [ "dep:rstest" ]

# Architecture features
64-bit = ["brisc-hw/64-bit"]
m = ["brisc-hw/m"]
a = ["brisc-hw/a"]
c = ["brisc-hw/c"]
64-bit = [ "brisc-hw/64-bit" ]
m = [ "brisc-hw/m" ]
a = [ "brisc-hw/a" ]
c = [ "brisc-hw/c" ]

[[bench]]
harness = false
Expand Down
10 changes: 5 additions & 5 deletions crates/hw/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ cfg-if.workspace = true
rstest.workspace = true

[features]
default = ["64-bit", "m", "a", "c"]
default = [ "64-bit", "a", "c", "m" ]

# Architecture features
64-bit = ["brisc-isa/64-bit"]
m = ["brisc-isa/m"]
a = ["brisc-isa/a"]
c = ["brisc-isa/c"]
64-bit = [ "brisc-isa/64-bit" ]
m = [ "brisc-isa/m" ]
a = [ "brisc-isa/a" ]
c = [ "brisc-isa/c" ]
2 changes: 1 addition & 1 deletion crates/isa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ num-traits.workspace = true
rstest.workspace = true

[features]
default = ["64-bit", "m", "a", "c"]
default = [ "64-bit", "a", "c", "m" ]
64-bit = []
m = []
a = []
Expand Down