diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 671591d6e1..d47e8222ed 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -24,7 +24,7 @@ jobs: bencher-api-token: ${{ secrets.BENCHER_API_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }} adapter: rust_criterion - bench-command: cargo bench --bench ${{ matrix.rust_bench }} -- --quick + bench-command: cargo bench --frozen --bench ${{ matrix.rust_bench }} -- --quick web_benchmarks_with_bencher: name: web benchmarks with bencher diff --git a/.github/workflows/build-jvm-linux.yml b/.github/workflows/build-jvm-linux.yml index e235e88d62..ac8fe4caf8 100644 --- a/.github/workflows/build-jvm-linux.yml +++ b/.github/workflows/build-jvm-linux.yml @@ -24,7 +24,7 @@ jobs: run: | cd crypto-ffi cargo make jvm-linux - - name: upload static rust library + - name: upload dynamic library uses: actions/upload-artifact@v4 with: name: jvm-linux-so-file-${{ github.run_id }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 11e31c04f8..dc8fbe33e9 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -29,7 +29,7 @@ jobs: - name: install cargo-nextest uses: taiki-e/install-action@nextest - name: generate code coverage - run: cargo llvm-cov nextest --workspace --lcov --exclude interop --output-path lcov.info + run: cargo llvm-cov nextest --frozen --workspace --lcov --exclude interop --output-path lcov.info - name: upload to codecov.io uses: codecov/codecov-action@v5 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5dfad59833..a656089c3f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -27,9 +27,9 @@ jobs: tool: - name: fmt trailer: --all -- --check - - name: clippy + - name: clippy --frozen trailer: -- -D warnings - - name: check + - name: check --frozen trailer: --tests target: ["", "--target wasm32-unknown-unknown"] exclude: @@ -54,9 +54,9 @@ jobs: rustflags: '' - uses: taiki-e/install-action@nextest - name: "test corecrypto" - run: cargo nextest run --verbose + run: cargo nextest run --verbose --frozen - name: "test corecrypto documentation" - run: cargo test --doc + run: cargo test --doc --frozen - name: "upload test results" if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 @@ -73,7 +73,7 @@ jobs: - name: "test keystore regressions" run: | cd extras/keystore-regression-versions - cargo run + cargo run --frozen proteus-test: runs-on: ubuntu-latest @@ -84,7 +84,7 @@ jobs: rustflags: '' - uses: taiki-e/install-action@nextest - name: "test corecrypto's proteus implementation" - run: cargo nextest run --verbose --features proteus,cryptobox-migrate,proteus-keystore proteus + run: cargo nextest run --frozen --verbose --features proteus,cryptobox-migrate,proteus-keystore proteus wasm-test: runs-on: ubuntu-latest diff --git a/crypto-ffi/Makefile.toml b/crypto-ffi/Makefile.toml index 5d3b2da18f..6e49d41eac 100644 --- a/crypto-ffi/Makefile.toml +++ b/crypto-ffi/Makefile.toml @@ -1,6 +1,6 @@ [env] ANDROID_NDK_PREFER_VERSION = "25.2" -LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "so", mapping = { "linux" = "so", "macos" = "dylib", "windows" = "dll" } } +LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", mapping = { "linux" = "so", "macos" = "dylib" } } ##################################### DOCS #################################### @@ -85,7 +85,7 @@ args = [ command = "wasm-pack" args = [ "build", - "--locked", + "--frozen", "--no-pack", "--out-dir", "bindings/js/src", "--out-name", "core-crypto-ffi", @@ -105,7 +105,7 @@ args = ["run", "--cwd", "bindings/js", "build"] command = "cargo" args = [ "run", - "--locked", + "--frozen", "--release", "--features", "uniffi/cli", "--bin", "uniffi-bindgen", @@ -125,7 +125,7 @@ script = ''' command = "cargo" args = [ "run", - "--locked", + "--frozen", "--release", "--features", "uniffi/cli", "--bin", "uniffi-bindgen", @@ -140,7 +140,7 @@ args = [ command = "cargo" args = [ "run", - "--locked", + "--frozen", "--release", "--features", "uniffi/cli", "--bin", "uniffi-bindgen", @@ -157,16 +157,21 @@ dependencies = ["bindings-kotlin-android", "bindings-kotlin-jvm"] dependencies = ["bindings-swift", "bindings-kotlin"] ##################################### iOS ##################################### - -[tasks.ios-env] -plugin = "detect-release" - [tasks.ios-device] dependencies = ["bindings-swift"] env = { "IPHONEOS_DEPLOYMENT_TARGET"="16.0" } condition = { platforms = ["mac"] } command = "cargo" -args = ["rustc", "--target", "aarch64-apple-ios", "--crate-type=cdylib", "--crate-type=staticlib", "--release", "--locked", "--", "-C", "strip=symbols"] +args = [ + "rustc", + "--frozen", + "--target", "aarch64-apple-ios", + "--crate-type=cdylib", + "--crate-type=staticlib", + "--release", + "--", + "-C", "strip=symbols" +] [tasks.ios-simulator-x86] dependencies = ["bindings-swift"] @@ -174,7 +179,7 @@ condition = { platforms = ["mac"] } command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "x86_64-apple-ios", "--crate-type=cdylib", "--crate-type=staticlib", @@ -191,7 +196,7 @@ condition = { platforms = ["mac"] } command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "aarch64-apple-ios-sim", "--crate-type=cdylib", "--crate-type=staticlib", @@ -222,7 +227,7 @@ plugin = "android-env" command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "armv7-linux-androideabi", "--crate-type=cdylib", "--crate-type=staticlib", @@ -236,7 +241,7 @@ dependencies = ["android-env"] command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "aarch64-linux-android", "--crate-type=cdylib", "--crate-type=staticlib", @@ -250,7 +255,7 @@ dependencies = ["android-env"] command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "x86_64-linux-android", "--crate-type=cdylib", "--crate-type=staticlib", @@ -271,7 +276,7 @@ dependencies = ["android-armv7", "android-armv8", "android-x86"] command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "x86_64-apple-darwin", "--crate-type=cdylib", "--crate-type=staticlib", @@ -286,7 +291,7 @@ condition = { platforms = ["mac"] } command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "aarch64-apple-darwin", "--crate-type=cdylib", "--crate-type=staticlib", @@ -297,11 +302,11 @@ args = [ dependencies = ["bindings-kotlin-jvm"] condition = { platforms = ["mac"] } -[tasks.jvm-x86-linux] +[tasks.jvm-linux] command = "cargo" args = [ "rustc", - "--locked", + "--frozen", "--target", "x86_64-unknown-linux-gnu", "--crate-type=cdylib", "--crate-type=staticlib", @@ -315,9 +320,6 @@ condition = { platforms = ["linux"] } [tasks.jvm-darwin] dependencies = ["jvm-aarch64-darwin", "jvm-x86-darwin"] -[tasks.jvm-linux] -dependencies = ["jvm-x86-linux"] - [tasks.jvm] dependencies = ["jvm-darwin", "jvm-linux"] @@ -330,34 +332,13 @@ dependencies = ["android", "ios"] dependencies = ["mobile", "wasm"] ################################### Plugins ################################### -[plugins.impl.detect-release] -script = ''' -index = array_contains ${task.args} "--release" -if index - set_env IS_RELEASE_BUILD "release" - println -c bright_blue "Release mode detected!" -end - -release_path = set IS_RELEASE_BUILD or "debug" - -# index_target = array_contains ${task.args} "--target" -# if index_target -# target = array_get ${task.args} ${${index_target} + 1} -# set_env CORECRYPTO_TARGET_FOLDER "../target/${target}/${release_path}" -# else -# set_env CORECRYPTO_TARGET_FOLDER "../target/${release_path}" -# end -''' - [plugins.impl.android-env] script = ''' exit_on_error true fn update_android_env platform = os_family - if eq ${platform} "windows" - platform_dir = set "windows-x86_64" - elseif eq ${platform} "linux" + if eq ${platform} "linux" platform_dir = set "linux-x86_64" elseif eq ${platform} "mac" platform_dir = set "darwin-x86_64" @@ -385,7 +366,6 @@ fn update_android_env set_env CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_ANDROID_NDK "${base_ndk_path}" set_env CARGO_TARGET_AARCH64_LINUX_ANDROID_ANDROID_NDK "${base_ndk_path}" set_env CARGO_TARGET_X86_64_LINUX_ANDROID_ANDROID_NDK "${base_ndk_path}" - set_env CARGO_TARGET_I686_LINUX_ANDROID_ANDROID_NDK "${base_ndk_path}" end fn autodetect_android_env @@ -397,10 +377,7 @@ fn autodetect_android_env platform = os_family sdk_folder = set "Sdk" - if eq ${platform} "windows" - platform_dir = get_home_dir - platform_dir = set "${platform_dir}/AppData/Local" - elseif eq ${platform} "linux" + if eq ${platform} "linux" platform_dir = get_home_dir elseif eq ${platform} "mac" platform_dir = get_home_dir