From 048d11b88c50abb7d00123818a29991337526fc4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 7 Nov 2024 03:58:33 +1000 Subject: [PATCH 1/2] Fix which macOS arch is used for binary builds (#1705) --- .github/workflows/binaries.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/binaries.yml b/.github/workflows/binaries.yml index f2f53bd78..25cea7366 100644 --- a/.github/workflows/binaries.yml +++ b/.github/workflows/binaries.yml @@ -33,9 +33,9 @@ jobs: - os: ubuntu-20.04 # Use 20.04 to get an older version of glibc for increased compat target: aarch64-unknown-linux-gnu - os: macos-14 - target: x86_64-apple-darwin - - os: macos-12 target: aarch64-apple-darwin + - os: macos-12 + target: x86_64-apple-darwin - os: windows-latest target: x86_64-pc-windows-msvc ext: .exe From 1fc9c343798657952a6a2bae8350589c096389e0 Mon Sep 17 00:00:00 2001 From: Gleb Date: Wed, 6 Nov 2024 13:54:46 -0800 Subject: [PATCH 2/2] Cleanup unit testing/add ARM support (#1691) * WIP: check make test * Update makefile * Cleanup * Deprecation fix * Add build target * Add libssl-dev * Print openssl dir * cfg path * cfg path * Add sysroot * libssl * ls * fix apt * ln * libssl * arm * ... * tmate * apt sources * Remove tmate * libudev arm64 * Change runner to arm * Fix rust job * Update rust-cache * Uncomment other OSes * Cleanup apt * Update rust-cache * Unpin rust-cache version --- .github/workflows/rust.yml | 14 +++++--------- Makefile | 2 +- .../tests/fixtures/test-wasms/swap/src/test.rs | 4 +++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ae750a77..7b046c8c3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -47,7 +47,7 @@ jobs: sys: - os: ubuntu-latest-16-cores target: x86_64-unknown-linux-gnu - - os: ubuntu-latest-16-cores + - os: ubuntu-jammy-16-cores-arm64 target: aarch64-unknown-linux-gnu - os: macos-latest target: x86_64-apple-darwin @@ -79,14 +79,10 @@ jobs: - if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libudev-dev - run: cargo clippy --all-targets --target ${{ matrix.sys.target }} - - run: make build-test - # TODO: enable ARM linux - - if: startsWith(matrix.sys.target, 'x86_64') || runner.os == 'macOS' - # specify directories explicitly (otherwise it will fail with missing symbols) - run: | - for I in cmd/soroban-cli cmd/crates/* cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world ; do - cargo test --target ${{ matrix.sys.target }} --manifest-path $I/Cargo.toml - done + - run: make test + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + CARGO_BUILD_TARGET: ${{ matrix.sys.target }} publish-dry-run: if: github.event_name == 'push' || startsWith(github.head_ref, 'release/') diff --git a/Makefile b/Makefile index f534410e0..92cdacd73 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ generate-full-help-doc: cargo run --bin doc-gen --features clap-markdown test: build-test - cargo test + cargo test --workspace e2e-test: cargo test --features it --test it -- integration diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/src/test.rs b/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/src/test.rs index e32b45e0a..5c973880e 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/src/test.rs +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/src/test.rs @@ -11,7 +11,9 @@ use token::Client as TokenClient; use token::StellarAssetClient as TokenAdminClient; fn create_token_contract<'a>(e: &Env, admin: &Address) -> (TokenClient<'a>, TokenAdminClient<'a>) { - let contract_address = e.register_stellar_asset_contract(admin.clone()); + let contract_address = e + .register_stellar_asset_contract_v2(admin.clone()) + .address(); ( TokenClient::new(e, &contract_address), TokenAdminClient::new(e, &contract_address),