@@ -184,34 +184,36 @@ unit-tests:
184184unit-tests-flaky :
185185 cargo test -p gix --features async-network-client-async-std
186186
187- # Depend on this to pre-generate metadata , and/or use it inside a recipe as `"$({{ j }} dbg)"`
187+ # Extract cargo metadata, excluding dependencies , and query it
188188[private ]
189- dbg :
190- set -eu; \
191- target_dir=" $(cargo metadata --format-version 1 | jq -r .target_directory)" ; \
192- test -n " $target_dir" ; \
193- echo " $target_dir/debug"
189+ query-meta jq -query :
190+ meta=" $(cargo metadata --format-version 1 --no-deps)" && \
191+ printf ' %s\n' " $meta" | jq --exit-status --raw-output -- {{ quote (jq-query) }}
192+
193+ # Get the path to the directory where debug binaries are created during builds
194+ [private ]
195+ dbg : (query-meta ' .target_directory + "/debug"' )
194196
195197# Run journey tests (`max`)
196- journey-tests : dbg
198+ journey-tests :
197199 cargo build --features http-client-curl-rustls
198200 cargo build -p gix-testtools --bin jtt
199201 dbg=" $({{ j }} dbg)" && tests/ journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" max
200202
201203# Run journey tests (`max-pure`)
202- journey-tests-pure : dbg
204+ journey-tests-pure :
203205 cargo build --no-default-features --features max-pure
204206 cargo build -p gix-testtools --bin jtt
205207 dbg=" $({{ j }} dbg)" && tests/ journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" max-pure
206208
207209# Run journey tests (`small`)
208- journey-tests-small : dbg
210+ journey-tests-small :
209211 cargo build --no-default-features --features small
210212 cargo build -p gix-testtools
211213 dbg=" $({{ j }} dbg)" && tests/ journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" small
212214
213215# Run journey tests (`lean-async`)
214- journey-tests-async : dbg
216+ journey-tests-async :
215217 cargo build --no-default-features --features lean-async
216218 cargo build -p gix-testtools
217219 dbg=" $({{ j }} dbg)" && tests/ journey.sh " $dbg/ein" " $dbg/gix" " $dbg/jtt" async
@@ -238,16 +240,25 @@ cross-test-android: (cross-test 'armv7-linux-androideabi' '--no-default-features
238240check-size :
239241 etc/ check-package-size.sh
240242
241- # This assumes the current default toolchain is the Minimal Supported Rust Version and checks
242- # against it. This is run on CI in `msrv.yml`, after the MSRV toolchain is installed and set as
243- # default, and after dependencies in `Cargo.lock` are downgraded to the latest MSRV-compatible
244- # versions. Only if those or similar steps are done first does this work to validate the MSRV.
245- #
246- # Check the MSRV, *if* the toolchain is set and `Cargo.lock` is downgraded (used on CI)
247- ci-check-msrv :
248- rustc --version
249- cargo build --locked -p gix
250- cargo build --locked -p gix --no-default-features --features async-network-client,max-performance
243+ # Report the Minimum Supported Rust Version (the `rust-version` of `gix`) in X.Y.Z form
244+ msrv : (query-meta '''
245+ .packages[]
246+ | select(.name == " gix" )
247+ | .rust_version
248+ | sub(" (?<xy>^[0-9]+[.][0-9]+$)" ; " \( .xy).0" )
249+ ''' )
250+
251+ # Regenerate the MSRV badge SVG
252+ msrv-badge:
253+ msrv="$({{ j }} msrv)" && \
254+ sed "s/{MSRV}/$msrv/g" etc/msrv-badge.template.svg >etc/msrv-badge.svg
255+
256+ # Check if `gix` and its dependencies, as currently locked, build with `rust-version`
257+ check-rust-version rust-version:
258+ rustc +{{ rust-version }} --version
259+ cargo +{{ rust-version }} build --locked -p gix
260+ cargo +{{ rust-version }} build --locked -p gix \
261+ --no-default-features --features async-network-client,max-performance
251262
252263# Enter a nix-shell able to build on macOS
253264nix-shell-macos:
0 commit comments