mirror of
https://github.com/BurntSushi/jiff.git
synced 2025-12-23 08:47:45 +00:00
I'm not sure when or how exactly it happened, but in the last weeks, I've noticed that `rustc` gets effectively stun-locked whenever I make a change to a source file in Jiff. A quick examination of what the fuck my computer is doing seems to reveal that it's spending oodles of time compiling diesel over and over. I have no idea why this is happening and I don't really care to spend the time unraveling the mysteries of diesel. So I took a hammer to the problem. I have effectively shunted all examples and all "integration" crates out of Jiff's core workspace and into their own little bloated fiefdoms. To compensate for the fact that `cargo test --all` no longer tests these things, I've added shell scripts to run the requisite tests. And those shell scripts are now run in CI. I'm now back to a state where I can save a file in Jiff and I get sub-second `cargo check` response times.
52 lines
1.6 KiB
Bash
Executable file
52 lines
1.6 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# This script tests "integration" crates explicitly.
|
|
#
|
|
# This isn't done as part of, e.g., `cargo build --all`, because we split these
|
|
# specific crates out of the main workspace to keep dependency trees smaller.
|
|
|
|
set -e
|
|
|
|
# cd to the directory containing this crate's Cargo.toml so that we don't need
|
|
# to pass --manifest-path to every `cargo` command.
|
|
cd "$(dirname "$0")/.."
|
|
|
|
integrations=(
|
|
"jiff-diesel mysql"
|
|
"jiff-diesel postgres"
|
|
"jiff-icu std"
|
|
"jiff-sqlx postgres"
|
|
# This is just utter nonsense, but
|
|
# sqlx-sqlite does not compile in it
|
|
# default feature configuration. This
|
|
# is utterly asinine. And it's completely
|
|
# undocumented. I had to go trawling through
|
|
# the top-level sqlx Cargo.toml to figure
|
|
# out which feature to enable.
|
|
"jiff-sqlx sqlite,sqlx-sqlite/bundled"
|
|
)
|
|
for v in "${integrations[@]}"; do
|
|
crate="$(echo $v | awk '{print $1}')"
|
|
feature="$(echo $v | awk '{print $2}')"
|
|
echo "===== TESTING INTEGRATION CRATE: $crate[$feature] ====="
|
|
cargo test \
|
|
--no-default-features \
|
|
--features "$feature" \
|
|
--manifest-path "crates/$crate/Cargo.toml"
|
|
done
|
|
|
|
# Same as above, but with `--lib` only. This is useful when we don't expect
|
|
# doctests to pass for certain feature combinations.
|
|
integrations=(
|
|
"jiff-icu alloc"
|
|
)
|
|
for v in "${integrations[@]}"; do
|
|
crate="$(echo $v | awk '{print $1}')"
|
|
feature="$(echo $v | awk '{print $2}')"
|
|
echo "===== TESTING INTEGRATION CRATE (--lib only): $crate[$feature] ====="
|
|
cargo test \
|
|
--lib \
|
|
--no-default-features \
|
|
--features "$feature" \
|
|
--manifest-path "crates/$crate/Cargo.toml"
|
|
done
|