Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -36,28 +36,34 @@ jobs:
name: Test
strategy:
matrix:
os: [ubuntu-22.04]
os: [ubuntu-24.04]
features: ["--features targets", "--features metadata", null]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --target x86_64-unknown-linux-gnu
- name: Install nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
# When using the sparse index, we need to do this additional fetch so that
# the entries we want are in the sparse cache, otherwise the bug_repro test
# fails.
- run: |
- name: fetch
run: |
cargo fetch --target x86_64-unknown-linux-gnu
cargo fetch --manifest-path tests/bug/Cargo.toml
cargo fetch --manifest-path tests/features/Cargo.toml
cargo fetch --manifest-path tests/feature-bug/Cargo.toml
cargo fetch --manifest-path tests/features-2/Cargo.toml
cargo fetch --manifest-path tests/feature-bug-2/Cargo.toml
- name: cargo test build
run: cargo build --tests --release ${{ matrix.features }}
- name: cargo test
run: cargo test --release ${{ matrix.features }}
run: cargo nextest run --release ${{ matrix.features }}

deny-check:
name: cargo-deny
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
Expand All @@ -66,11 +72,17 @@ jobs:

publish-check:
name: Publish Check
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo fetch
- name: cargo publish check
run: cargo publish --dry-run

test_success:
runs-on: ubuntu-24.04
needs: [lint, test, deny-check, publish-check]
steps:
- run: echo "All test jobs passed"
51 changes: 30 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cargo_metadata = { version = "0.19", default-features = false, optional = true }
# ...but it's not actually in the public API :p
cargo-platform = { version = "0.1", default-features = false, optional = true }
# Used to parse and evaluate cfg() expressions for dependencies
cfg-expr = "0.19"
cfg-expr = "0.20"
# Used to create and traverse graph structures
petgraph = { version = "0.8", default-features = false }
# Used for checking version requirements
Expand All @@ -51,7 +51,7 @@ similar-asserts = "1.6"
# Used to deserialize test files into metadata we can load
serde_json = "1.0"
# index metadata retrieval
tame-index = "0.20"
tame-index = "0.21"

[profile.dev.package.insta]
opt-level = 3
Expand Down
6 changes: 2 additions & 4 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ impl Builder {
// encountered it in testing (eg. the `md-5` crate names its lib target `md5`, and you
// can have a dependency on the `md5` crate, they both get resolved to the same name, but
// then rustc can't compile `md5::compute` because there are two libs that satisfy that name)
let source_matches = dep.source.as_deref().is_none_or(|dsrc| {
dep.source.as_deref().is_none_or(|dsrc| {
let psrc = rdep.pkg.source();
if let Some((dgit, pgit)) = dsrc.strip_prefix("git+").zip(psrc.strip_prefix("git+")) {
// The opaque git sources can have the full revision spec at the end, which is not part of
Expand All @@ -1256,9 +1256,7 @@ impl Builder {
} else {
dsrc == psrc
}
});

source_matches
})
})
.unwrap_or_else(|| panic!("cargo metadata resolved a dependency for a dependency not specified by the crate: {rdep:?}"));

Expand Down
Loading