Skip to content

Commit

Permalink
Merge pull request #3931 from Scille/fix-ci-packaging
Browse files Browse the repository at this point in the history
Fix CI packaging
  • Loading branch information
TimeEngineer authored Jan 20, 2023
2 parents 5dd3f59 + 585c286 commit f73346b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/actions/paths-filter/filters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/**
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion oxidation/libparsec/crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ pub async fn list_available_devices(_config_dir: &Path) -> Vec<AvailableDevice>
device.device_id,
device.human_handle,
device.device_label,
// There are no legacy device
device.slug.unwrap(),
device.slug,
),
DeviceFile::Recovery(device) => (
DeviceFileType::Recovery,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit f73346b

Please sign in to comment.