Skip to content

Commit

Permalink
CI: Build libbpf-rs-test-project outside of libbpf-sys workspace
Browse files Browse the repository at this point in the history
Our libbpf-rs integration workflow fails when invoked on the publish
path, because, evidently, Cargo attempts to query the libbpf-sys of an
unpublished version from crates.io (or at least that is my reading of
it).
Work around this behavior by creating the test project outside of the
workspace.

Signed-off-by: Daniel Müller <deso@posteo.net>
  • Loading branch information
d-e-s-o authored and alexforster committed Jan 25, 2024
1 parent 8182047 commit cd9e2e6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,18 @@ jobs:
- name: Build libbpf-rs with libbpf-sys
run: |
dir=$(pwd)
cd /tmp/
cargo init --bin libbpf-rs-test-project
cd libbpf-rs-test-project
# Add the most recent *published* version of libbpf-rs (as opposed to,
# say, cloning a development snapshot, which would just introduce
# additional uncertainty into the process).
cargo add libbpf-rs
# Override libbpf-sys in use with our current one.
# Add libbpf-rs dependency and override libbpf-sys in use with our
# current one.
cat >> Cargo.toml <<EOF
libbpf-rs = "*"
[patch.crates-io]
libbpf-sys = { path = '..' }
libbpf-sys = { path = "${dir}" }
EOF
cargo update
cargo build
publish:
Expand Down

0 comments on commit cd9e2e6

Please sign in to comment.