Skip to content

Commit

Permalink
fix(ci): build packages separately to bypass feature unification process
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Mar 14, 2024
1 parent 68c06d3 commit 42360f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ jobs:
shell: bash
run: if [[ ! $(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].features.default[]? | select(. == "local-discovery")') ]]; then echo "local-discovery is not a default feature in any package."; else echo "local-discovery is a default feature in at least one package." && exit 1; fi

# In a cargo workspace, feature unification can occur, allowing a crate to be built successfully even if it
# doesn't explicitly specify a feature it uses, provided another crate in the workspace enables that feature.
# To detect such cases, we must build each crate using `--package` flag, building all packages at once does not work.
- name: Check the whole workspace can build
run: cargo build --all-targets --all-features
shell: bash
run: |
for package in $(cargo metadata --no-deps --format-version=1 | jq -r '.packages[].name'); do
cargo build -p "$package"
done
unit:
if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
Expand Down
3 changes: 2 additions & 1 deletion sn_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ sn_peers_acquisition= { path="../sn_peers_acquisition", version = "0.2.8" }
sn_client = { path = "../sn_client", version = "0.104.29" }
sn_logging = { path = "../sn_logging", version = "0.2.23" }
sn_networking = { path = "../sn_networking", version = "0.13.33" }
sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = ["rpc"]}
sn_protocol = { path = "../sn_protocol", version = "0.15.4"}
sn_registers = { path = "../sn_registers", version = "0.3.10" }
sn_transfers = { path = "../sn_transfers", version = "0.16.4" }
sn_service_management = { path = "../sn_service_management", version = "0.1.0" }
Expand All @@ -76,6 +76,7 @@ color-eyre = "0.6.2"
assert_matches = "1.5.0"
reqwest = { version="0.11.18", default-features=false, features = ["rustls"] }
serde_json = "1.0"
sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = ["rpc"]}
tempfile = "3.6.0"
# Do not specify the version field. Release process expects even the local dev deps to be published.
# Removing the version field is a workaround.
Expand Down
4 changes: 1 addition & 3 deletions sn_node_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
service-manager = "0.6.0"
sn_peers_acquisition = { path = "../sn_peers_acquisition", version = "0.2.8" }
sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = [
"rpc",
]}
sn_protocol = { path = "../sn_protocol", version = "0.15.4" }
sn_service_management = { path = "../sn_service_management", version = "0.1.0" }
sn-releases = "0.1.7"
sn_transfers = { path = "../sn_transfers", version = "0.16.4" }
Expand Down
4 changes: 1 addition & 3 deletions sn_service_management/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
semver = "1.0.20"
service-manager = "0.6.0"
sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = [
"rpc",
] }
sn_protocol = { path = "../sn_protocol", version = "0.15.4", features = ["rpc"] }
sysinfo = "0.29.10"
thiserror = "1.0.23"
tokio = { version = "1.32.0", features = ["time"] }
Expand Down

0 comments on commit 42360f0

Please sign in to comment.