jj/.github
Austin Seipp 3f7b5a75e7 github(nix): don't build everything twice
When running the `nix build`, the `buildRustPackage` function -- which builds
the `jj` crates -- calls `cargo build --release` with flags like `HOST_CXX`
set. This is called the `buildPhase`. Then, it runs the `checkPhase`, which
calls `cargo nextest`, in our case. However, it does not set `HOST_CXX`, for
some reason.

The intent of `buildRustPackage` is that the `buildPhase` and `checkPhase`
have their compilation options fully aligned so that they reuse the local cargo
`target/` cache directory, avoiding a full recompilation. However, the lack
of `HOST_CXX` above among others causes a cache miss, and a bunch of cascading
recompilations. The net impact is that we compile all of the codebase once in
`buildPhase`, then again in `checkPhase`, making the Nix CI build 2x slower on
average than the other Linux runners; 2-3 minutes versus 7 minutes, on average.

Instead, re-introduce a 'check' into the Flake directly, which overrides the
`jujustsu` package, but stubs out the `buildPhase`. This means it will only run
`checkPhase`, which is what we want. Then, modify the CI to run `nix flake check`
again, like it used to in the past.

Unfortunately, this doesn't fix the cache miss when running `nix build`
yourself, it recompiles from scratch in both phases still. That needs to be
fixed in the future, but it's tolerable for now.

This reverts most of 71a3045032.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-02-24 13:56:03 -06:00
..
ISSUE_TEMPLATE github: add feature request issue template 2023-03-30 11:49:04 -07:00
scripts website: Stop mike from always changing sitemaps.xml.gz 2023-11-06 17:10:27 -08:00
workflows github(nix): don't build everything twice 2024-02-24 13:56:03 -06:00
dependabot.yml github: reenable grouped cargo updates 2023-12-16 14:40:39 +09:00
PULL_REQUEST_TEMPLATE.md docs: Fix missed paths from src->cli/src move 2023-08-18 14:35:19 +02:00