Skip to content

Commit

Permalink
Remove crate-type specs in Cargo.toml, pass as arg from Makefile for …
Browse files Browse the repository at this point in the history
….wasm contracts
  • Loading branch information
graydon committed Aug 21, 2023
1 parent bf7d42d commit d0077bb
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
with:
name: cargo-hack
version: 0.5.16
- run: cargo-hack hack build --target wasm32-unknown-unknown --profile release
- run: for i in $(ls test) ; do cargo-hack hack rustc --target wasm32-unknown-unknown --profile release --crate-type cdylib -p test_${i} ; done
- run: cargo-hack hack --feature-powerset --exclude-features docs build --target ${{ matrix.sys.target }}
- if: startsWith(matrix.sys.target, 'x86_64')
run: cargo-hack hack --feature-powerset --ignore-unknown-features --features testutils --exclude-features docs test --target ${{ matrix.sys.target }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test: fmt build
cargo hack --feature-powerset --ignore-unknown-features --features testutils --exclude-features docs $(CARGO_TEST_SUBCOMMAND)

build: fmt
cargo hack build --target wasm32-unknown-unknown --release
for P in $(shell ls tests) ; do cargo hack rustc --target wasm32-unknown-unknown --release --crate-type cdylib -p test_$$P; done
cd target/wasm32-unknown-unknown/release/ && \
for i in *.wasm ; do \
ls -l "$$i"; \
Expand Down
1 change: 0 additions & 1 deletion soroban-token-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ edition = "2021"
rust-version = "1.71"

[lib]
crate-type = ["cdylib", "rlib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/add_i128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/add_u128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/add_u64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/alloc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/contract_data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ rust-version = "1.71"
publish = false

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/empty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/empty2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
5 changes: 0 additions & 5 deletions tests/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
# Adding rlib is required so that the test_fuzz crate can be imported as a
# library into the fuzzing crate. However, having multiple crate types is a
# problem, it'll cause LTO optimizations to be disabled for the cdylib build.
# TODO: Figure out what to do about this.
crate-type = ["cdylib", "rlib"]
doctest = false

[features]
Expand Down
1 change: 0 additions & 1 deletion tests/import_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/invoke_contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/multiimpl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion tests/udt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false
rust-version = "1.71"

[lib]
crate-type = ["cdylib"]
doctest = false

[dependencies]
Expand Down

0 comments on commit d0077bb

Please sign in to comment.