Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github(nix): don't build jj twice when testing #3118

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nix-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@cd46bde16ab981b0a7b2dce0574509104543276e
- uses: DeterminateSystems/magic-nix-cache-action@eeabdb06718ac63a7021c6132129679a8e22d0c7
- run: nix build --print-build-logs --show-trace
- run: nix flake check -L --show-trace
21 changes: 20 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
version = "unstable-${self.shortRev or "dirty"}";

buildFeatures = [ "packaging" ];
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
cargoBuildFlags = [ "--bin" "jj" ]; # don't build and install the fake editors
useNextest = true;
src = filterSrc ./. [
".*\\.nix$"
Expand Down Expand Up @@ -110,11 +110,30 @@
};
default = self.packages.${system}.jujutsu;
};

apps.default = {
type = "app";
program = "${self.packages.${system}.jujutsu}/bin/jj";
};

formatter = pkgs.nixpkgs-fmt;

checks.jujutsu = self.packages.${system}.jujutsu.overrideAttrs ({ ... }: {
# FIXME (aseipp): when running `nix flake check`, this will override the
# main package, and nerf the build and installation phases. this is
# because for some inexplicable reason, the cargo cache gets invalidated
# in between buildPhase and checkPhase, causing every nix CI build to be
# 2x as long.
thoughtpolice marked this conversation as resolved.
Show resolved Hide resolved
#
# upstream issue: https://github.com/NixOS/nixpkgs/issues/291222
buildPhase = "true";
installPhase = "touch $out";
# NOTE (aseipp): buildRustPackage also, by default, runs `cargo check`
# in `--release` mode, which is far slower; the existing CI builds all
# use the default `test` profile, so we should too.
cargoCheckType = "test";
});

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
# The CI checks against the latest nightly rustfmt, so we should too.
Expand Down