Skip to content

Commit d92fb2f

Browse files
committed
Add slang feature to disable slang build
1 parent a8e840c commit d92fb2f

6 files changed

Lines changed: 19 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
toolchain: ${{ matrix.rust}}
2929
components: rustfmt
3030
- name: Build
31-
run: cargo build
31+
run: cargo build --all-features
3232
- name: Cargo Test
33-
run: cargo test --all
33+
run: cargo test --workspace --all-features
3434
- name: Format (fix with `cargo fmt`)
3535
run: cargo fmt -- --check
3636
- name: Run unit-tests
@@ -49,7 +49,7 @@ jobs:
4949
- name: Build
5050
run: cargo build
5151
- name: Cargo Test
52-
run: cargo test --all
52+
run: cargo test
5353
- name: Run unit-tests
5454
run: tests/run_all.sh
5555
shell: bash
@@ -64,9 +64,9 @@ jobs:
6464
with:
6565
toolchain: stable
6666
- name: Build
67-
run: cargo build
67+
run: cargo build --all-features
6868
- name: Cargo Test
69-
run: cargo test --all
69+
run: cargo test --workspace --all-features
7070
- name: Run unit-tests
7171
run: tests/run_all.sh
7272
shell: bash

.github/workflows/cli_regression.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
toolchain: stable
1717
- name: Run CLI Regression
18-
run: cargo test --test cli_regression -- --ignored
18+
run: cargo test --all-features --test cli_regression -- --ignored
1919
env:
2020
BENDER_TEST_GOLDEN_BRANCH: ${{ github.base_ref }}
2121

@@ -43,6 +43,6 @@ jobs:
4343
with:
4444
toolchain: stable
4545
- name: Run CLI Regression
46-
run: cargo test --test cli_regression -- --ignored
46+
run: cargo test --all-features --test cli_regression -- --ignored
4747
env:
4848
BENDER_TEST_GOLDEN_BRANCH: ${{ github.base_ref }}

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
-v "$GITHUB_WORKSPACE/target/$platform/$tgtname:/source/target" \
7777
--platform $full_platform \
7878
$tgtname-$platform \
79-
cargo build --release;
79+
cargo build --release --all-features;
8080
shell: bash
8181
- name: OS Create Package
8282
run: |
@@ -121,7 +121,7 @@ jobs:
121121
-v "$GITHUB_WORKSPACE/target/$platform/$tgtname:/source/target" \
122122
--platform $full_platform \
123123
$tgtname-$platform \
124-
cargo build --release;
124+
cargo build --release --all-features;
125125
shell: bash
126126
- name: OS Create Package
127127
run: |
@@ -170,7 +170,7 @@ jobs:
170170
-v "$GITHUB_WORKSPACE/target/amd64:/source/target" \
171171
--platform linux/amd64 \
172172
manylinux-amd64 \
173-
cargo build --release;
173+
cargo build --release --all-features;
174174
- name: GNU Create Package
175175
run: .github/scripts/package.sh amd64
176176
shell: bash
@@ -215,7 +215,7 @@ jobs:
215215
-v "$GITHUB_WORKSPACE/target/arm64:/source/target" \
216216
--platform linux/arm64 \
217217
manylinux-arm64 \
218-
cargo build --release;
218+
cargo build --release --all-features;
219219
- name: GNU Create Package
220220
run: .github/scripts/package.sh arm64
221221
shell: bash
@@ -240,7 +240,7 @@ jobs:
240240
rustup target add aarch64-apple-darwin
241241
cargo install universal2
242242
- name: MacOS Build
243-
run: cargo-universal2 --release
243+
run: cargo-universal2 --release --all-features
244244
- name: Get Artifact Name
245245
run: |
246246
if [[ "$GITHUB_REF" =~ ^refs/tags/v.*$ ]]; then \

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rust-version = "1.85.1"
1717
members = ["crates/bender-slang"]
1818

1919
[dependencies]
20-
bender-slang = { path = "crates/bender-slang" }
20+
bender-slang = { path = "crates/bender-slang", optional = true}
2121

2222
serde = { version = "1", features = ["derive"] }
2323
serde_yaml_ng = "0.10"
@@ -54,3 +54,6 @@ dunce = "1.0.4"
5454
[dev-dependencies]
5555
assert_cmd = "2.1.1"
5656
pretty_assertions = "1.4"
57+
58+
[features]
59+
slang = ["dep:bender-slang"]

src/cli.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ enum Commands {
104104
Init,
105105
Snapshot(cmd::snapshot::SnapshotArgs),
106106
Audit(cmd::audit::AuditArgs),
107+
#[cfg(feature = "slang")]
107108
Pickle(cmd::pickle::PickleArgs),
108109
#[command(external_subcommand)]
109110
Plugin(Vec<String>),
@@ -328,6 +329,7 @@ pub fn main() -> Result<()> {
328329
Commands::Fusesoc(args) => cmd::fusesoc::run(&sess, &args),
329330
Commands::Snapshot(args) => cmd::snapshot::run(&sess, &args),
330331
Commands::Audit(args) => cmd::audit::run(&sess, &args),
332+
#[cfg(feature = "slang")]
331333
Commands::Pickle(args) => cmd::pickle::run(args),
332334
Commands::Plugin(args) => {
333335
let (plugin_name, plugin_args) = args

src/cmd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub mod init;
1919
pub mod packages;
2020
pub mod parents;
2121
pub mod path;
22+
#[cfg(feature = "slang")]
2223
pub mod pickle;
2324
pub mod script;
2425
pub mod snapshot;

0 commit comments

Comments
 (0)