Skip to content

Commit 2894fc9

Browse files
committed
Use -p where no longer ambiguous
The previous commit notes: > Before this, some actions we'd prefer to do by `<cmd> -p <crate>` > had to be done by `(cd <crate-dir>; <cmd>)`. This was needed to > operate on `gix-*` crates in the workspace that are also > dependencies, even transitively, of `gix-testtools`. All occurrences of `cd ...` followed immediately by a `cargo` command in the `justfile` and in `ci.yml` were for that reason. This commit changes them to use `-p` instead. The changes in the `justfile` affect both manual runs and runs on CI through the `test` job. The changes directly in `ci.yml` affect the `wasm` jobs. This is intended to be a refactoring. No change is anticipated in what tests are run, their features, or their behavior. The rationale is twofold: - Simplify the commands. This is the form most other such commmands were already written in. These seem to have been written in the `cd` form only as a workaround for the now-fixed `-p` ambiguity. - Verify that the fix actually works and that there is nothing else breaking these checks when they are run from the top level of the workspace.
1 parent 7e057f2 commit 2894fc9

File tree

2 files changed

+19
-29
lines changed

2 files changed

+19
-29
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ jobs:
370370
run: |
371371
set +x
372372
for crate in gix-sec; do
373-
(cd -- "$crate" && cargo build --target "$TARGET")
373+
cargo build -p "$crate" --target "$TARGET"
374374
done
375375
- name: crates without feature toggles
376376
run: |
@@ -401,22 +401,22 @@ jobs:
401401
)
402402
set +x
403403
for crate in "${crates[@]}"; do
404-
(cd -- "$crate" && cargo build --target "$TARGET")
404+
cargo build -p "$crate" --target "$TARGET"
405405
done
406406
- name: features of gix-features
407407
run: |
408408
set +x
409409
for feature in progress parallel io-pipe crc32 zlib cache-efficiency-debug; do
410-
(cd gix-features && cargo build --features "$feature" --target "$TARGET")
410+
cargo build -p gix-features --features "$feature" --target "$TARGET"
411411
done
412412
- name: crates with 'wasm' feature
413413
run: |
414414
set +x
415415
for crate in gix-pack; do
416-
(cd -- "$crate" && cargo build --features wasm --target "$TARGET")
416+
cargo build -p "$crate" --features wasm --target "$TARGET"
417417
done
418418
- name: gix-pack with all features (including wasm)
419-
run: cd gix-pack && cargo build --all-features --target "$TARGET"
419+
run: cargo build -p gix-pack --all-features --target "$TARGET"
420420

421421
check-packetline:
422422
strategy:

justfile

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,16 @@ check:
6363
cargo check -p gix-pack --no-default-features
6464
cargo check -p gix-pack --no-default-features --features generate
6565
cargo check -p gix-pack --no-default-features --features streaming-input
66-
cd gix-hash; \
67-
set -ex; \
68-
cargo check --all-features; \
69-
cargo check
70-
cd gix-object; \
71-
set -ex; \
72-
cargo check --all-features; \
73-
cargo check --features verbose-object-parsing-errors
74-
cd gix-attributes && cargo check --features serde
75-
cd gix-glob && cargo check --features serde
76-
cd gix-worktree; \
77-
set -ex; \
78-
cargo check --features serde; \
79-
cargo check --no-default-features;
80-
cd gix-actor && cargo check --features serde
81-
cd gix-date && cargo check --features serde
66+
cargo check -p gix-hash --all-features
67+
cargo check -p gix-hash
68+
cargo check -p gix-object --all-features
69+
cargo check -p gix-object --features verbose-object-parsing-errors
70+
cargo check -p gix-attributes --features serde
71+
cargo check -p gix-glob --features serde
72+
cargo check -p gix-worktree --features serde
73+
cargo check -p gix-worktree --no-default-features
74+
cargo check -p gix-actor --features serde
75+
cargo check -p gix-date --features serde
8276
cargo check -p gix-tempfile --features signals
8377
cargo check -p gix-tempfile --features hp-hashmap
8478
cargo check -p gix-pack --features serde
@@ -87,7 +81,7 @@ check:
8781
cargo check -p gix-pack --features object-cache-dynamic
8882
cargo check -p gix-packetline --features blocking-io
8983
cargo check -p gix-packetline --features async-io
90-
cd gix-index && cargo check --features serde
84+
cargo check -p gix-index --features serde
9185
cargo check -p gix-credentials --features serde
9286
cargo check -p gix-sec --features serde
9387
cargo check -p gix-revision --features serde
@@ -104,9 +98,7 @@ check:
10498
cargo check -p gix-features --features crc32
10599
cargo check -p gix-features --features zlib
106100
cargo check -p gix-features --features cache-efficiency-debug
107-
cd gix-commitgraph; \
108-
set -ex; \
109-
cargo check --all-features
101+
cargo check -p gix-commitgraph --all-features
110102
cargo check -p gix-config-value --all-features
111103
cargo check -p gix-config --all-features
112104
cargo check -p gix-diff --no-default-features
@@ -158,10 +150,8 @@ unit-tests:
158150
cargo nextest run -p gix-status-tests --features gix-features-parallel
159151
cargo nextest run -p gix-worktree-state-tests --features gix-features-parallel
160152
cargo nextest run -p gix-worktree-tests --features gix-features-parallel
161-
cd gix-object; \
162-
set -ex; \
163-
cargo nextest run; \
164-
cargo nextest run --features verbose-object-parsing-errors
153+
cargo nextest run -p gix-object
154+
cargo nextest run -p gix-object --features verbose-object-parsing-errors
165155
cargo nextest run -p gix-tempfile --features signals
166156
cargo nextest run -p gix-features --all-features
167157
cargo nextest run -p gix-ref-tests --all-features

0 commit comments

Comments
 (0)