diff --git a/.github/actions/paths-filter/filters.yml b/.github/actions/paths-filter/filters.yml index 4d922926f91..9c23d2c0ee3 100644 --- a/.github/actions/paths-filter/filters.yml +++ b/.github/actions/paths-filter/filters.yml @@ -9,6 +9,9 @@ rust: - Cargo.lock - rust-toolchain.toml +rust-platform-web: &rust-platform-web + - oxidation/libparsec/crates/platform_*/src/web/** + python: - *shared - parsec/** @@ -33,11 +36,12 @@ client-common: &client-common - oxidation/client/capacitor.config.ts - oxidation/client/babel.config.js - oxidation/client/tsconfig.json - - oxidation/bindings/common/** + - oxidation/bindings/generator/** client-web: - *shared - *client-common + - *rust-platform-web - oxidation/bindings/web/** - oxidation/client/tests/** - oxidation/client/jest.config.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34b47f4c847..8f65c29f0f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -373,6 +373,10 @@ jobs: shell: bash run: echo OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl >> $GITHUB_ENV + - name: Additional Check (for packaging) + if: startsWith(matrix.os, 'ubuntu') + run: cargo check --profile ci-rust --no-default-features --features use-sodiumoxide + - name: Test rust codebase if: steps.rust-changes.outputs.run == 'true' shell: bash @@ -408,7 +412,6 @@ jobs: id: web-change if: >- steps.changes.outputs.client-web == 'true' - || steps.changes.outputs.client-common == 'true' || github.ref == 'refs/heads/master' run: echo "run=true" >> $GITHUB_OUTPUT shell: bash diff --git a/build.py b/build.py index 024de30a104..3cc127c46a9 100644 --- a/build.py +++ b/build.py @@ -64,14 +64,11 @@ def build(): # native module and discard the rest ! maturin_build_profile = "--profile=" + os.environ.get("CARGO_PROFILE", DEFAULT_CARGO_PROFILE) - features = ( - "--no-default-features --features use-sodiumoxide" - if maturin_build_profile == "--profile=release" - else "" - ) + maturin_build_extra_args = os.environ.get("CARGO_EXTRA_ARGS", "") + with tempfile.TemporaryDirectory() as distdir: run( - f"maturin build {maturin_build_profile} --interpreter {PYTHON_EXECUTABLE_PATH} --out {distdir} {features}" + f"maturin build {maturin_build_profile} {maturin_build_extra_args} --interpreter {PYTHON_EXECUTABLE_PATH} --out {distdir}" ) outputs = list(pathlib.Path(distdir).iterdir()) diff --git a/oxidation/libparsec/crates/core/Cargo.toml b/oxidation/libparsec/crates/core/Cargo.toml index 2a3cee9fece..26ee4ccd587 100644 --- a/oxidation/libparsec/crates/core/Cargo.toml +++ b/oxidation/libparsec/crates/core/Cargo.toml @@ -20,7 +20,7 @@ use-sodiumoxide = ["libparsec_crypto/use-sodiumoxide"] libparsec_client_types = { path = "../client_types", default-features = false } libparsec_crypto = { path = "../crypto", default-features = false } libparsec_platform_async = { path = "../platform_async" } -libparsec_platform_device_loader = { path = "../platform_device_loader" } +libparsec_platform_device_loader = { path = "../platform_device_loader", default-features = false } libparsec_protocol = { path = "../protocol", default-features = false } libparsec_types = { path = "../types", default-features = false } diff --git a/oxidation/libparsec/crates/platform_device_loader/src/web/local_device.rs b/oxidation/libparsec/crates/platform_device_loader/src/web/local_device.rs index b9b5e62004c..d0f74ad5eb6 100644 --- a/oxidation/libparsec/crates/platform_device_loader/src/web/local_device.rs +++ b/oxidation/libparsec/crates/platform_device_loader/src/web/local_device.rs @@ -15,7 +15,7 @@ pub fn load_device_with_password(slug: &str, password: &str) -> LocalDeviceResul DeviceFile::Password(x) => Some(x), _ => None, }) - .find(|x| x.slug.as_ref().map(|x| x.as_str()) == Some(slug)) + .find(|x| x.slug.as_str() == slug) .ok_or_else(|| LocalDeviceError::NotFound { slug: slug.into() })?; return load_device_with_password_core(password, &device_file); diff --git a/oxidation/libparsec/crates/platform_device_loader/src/web/local_device_file.rs b/oxidation/libparsec/crates/platform_device_loader/src/web/local_device_file.rs index 0e8437a77b8..899efd7083e 100644 --- a/oxidation/libparsec/crates/platform_device_loader/src/web/local_device_file.rs +++ b/oxidation/libparsec/crates/platform_device_loader/src/web/local_device_file.rs @@ -19,8 +19,7 @@ pub async fn list_available_devices(_config_dir: &Path) -> Vec device.device_id, device.human_handle, device.device_label, - // There are no legacy device - device.slug.unwrap(), + device.slug, ), DeviceFile::Recovery(device) => ( DeviceFileType::Recovery, diff --git a/pyproject.toml b/pyproject.toml index 4f70927c200..aef90fa2ad8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -166,6 +166,7 @@ test-command = "parsec --version && parsec core list_devices" # non-existent and hence $PATH don't know about it (and maturin will fail when calling cargo). # For this reason we force $PATH to contain Rust bin dir. PATH = "$PATH:$HOME/.cargo/bin" +CARGO_EXTRA_ARGS = "--no-default-features --features use-sodiumoxide" [tool.maturin] features = ["extension-module"]