ci(nix): Migrate to crane (and speed up Nix CI)
Closes #411 Closes #464
TODO
- [ ] Fix failing tests
- [x] clippy
- [x] trycmd
- ~~Cross compilation. https://crane.dev/examples/cross-rust-overlay.html~~ should be done in a extra PR
- ~~Maybe optional musl cross compilation~~
- [x] add clippy to packages
- [x] add
zip - [x] use flake parts
- [x] Check for name changes in outputs breaking the Justfile
- [x] apply patch from cafkafk for the Justfile.
- [x] bring back Pre-commit-hooks checks
- [x] rime (error 520?)
- [x] treefmt packages refactor
- [x] dev shell
Changes interesting for review
- eza.meta is generated from cargo toml in favor of hard coding it
- version changed from latest to "${version}-git"
- cargo plugins used in
Justfileadded to dev shell
Notes (links for me to keep in mind)
NOTE
due to nix fmt only running statix fix statix lint's which don't have quickfixes will not be fixed by nix fmt and will throw an error at the pre-commit-hooks
I want to do cross compilation in a separate PR.
This is cool, thanks for doing this ❤️
I wonder what's causing this:
The new test runner mostly looks good, but wonder if we can fix this output being slightly broken. Honestly I'm fine with it being a little broken over not having colors thou.
Also, why are those tests skipped?
No idea why the tests are skipped but I'm looking into it now.
Really Weird
Also it says that 0 tests were skipped. But a few lines before it says skipped.
@cafkafk I modified some of the apparently skipped tests to fail. This also mad the CI fail. I assume the skipped is just a visual bug. when installing the cargo-nextest plugin and running the command manually not through nix there's no skipped text.
@cafkafk I modified some of the apparently skipped tests to fail. This also mad the CI fail. I assume the skipped is just a visual bug. when installing the cargo-nextest plugin and running the command manually not through nix there's no skipped text.
Hmm, if it's just a visual bug we can live with it for now. Where should we mention this bug so upstream can fix it?
@cafkafk I modified some of the apparently skipped tests to fail. This also mad the CI fail. I assume the skipped is just a visual bug. when installing the cargo-nextest plugin and running the command manually not through nix there's no skipped text.
Hmm, if it's just a visual bug we can live with it for now. Where should we mention this bug so upstream can fix it?
We should do that but saying it only happens in crane seems like not enough information. I want to investigate it further first.
I also think we should change this in the Justfile, seems like the current glob catches unix
diff --git a/Justfile b/Justfile
index e048b95a..d50984f6 100644
--- a/Justfile
+++ b/Justfile
@@ -265,8 +265,8 @@ gen_test_dir:
#
# WARNING: this can cause loss of work
@idump:
- rm ./tests/cmd/*nix.stderr -f || echo
- rm ./tests/cmd/*nix.stdout -f || echo
+ rm ./tests/cmd/*_nix.stderr -f || echo
+ rm ./tests/cmd/*_nix.stdout -f || echo
nix build -L ./#trydump
- cp ./result/dump/*nix.* ./tests/cmd/
+ cp ./result/dump/*_nix.* ./tests/cmd/
(I can't push to this PR for some reason so here's a patch)
Sorry for making your life harder, but I changed the flake a bit in #476 >_<
I realized today that we should probably add zip to the devshell, the justfile uses it for the gh-release recipe
@cafkafk I added flake-compat last commit. I think there's nothing wrong with it since it allows non flake users to also use the flake through legacy nix. If you have any issues with flake-compat we can also remove it.
@cafkafk I added flake-compat last commit. I think there's nothing wrong with it since it allows non flake users to also use the flake through legacy nix. If you have any issues with flake-compat we can also remove it.
No I have no problem with adding it, the more can use the flake the better IMO!
Sorry for the colosing and reopening. I was trying to rename this branch due to it causing confusion to me being named main. GitHub doesn't like this tho.
@cafkafk I added eza-trycmd eza-trydump and eza-trycmd-local. Could you please take a look at it and check rather they work properly?
@MartinFillon the code I edited was all formatting/suggestions from clippy. Clippy was (prior to this PR) set up t not check the tests.
Just FYI #592 is coming
Just FYI #592 is coming
Would you prefer to merge #592 first? I'd be fine with that.
well it is you think it is better as I aim to delete regular nix itest and move them to generated dir with time. But now that I think about it my pr just separating both doesnt makes sense, I shall just migrate everything in one batch.
@cafkafk this should be ready to merge now.
I'm not sure why (except for one version test), but the integration tests fail. I'll try to regenerate them and see if it works.
There are still at least two failures, I'm not sure why they fail thou >_<
I'm not sure why (except for one version test), but the integration tests fail. I'll try to regenerate them and see if it works.
@cafkafk Are the integration tests just trycmd or also trycmd-local? The trycmd-local tests complain about sudo not being found but that's also the case on the main branch iirc.
the tests run in ci are trycmd and trycmd-local also calls ptests so that ci is not too long @9glenda
I'm not sure why (except for one version test), but the integration tests fail. I'll try to regenerate them and see if it works.
@cafkafk Are the integration tests just trycmd or also trycmd-local?
IIRC it should be just trycmd, and trycmd-local should be reserved for being run locally, but my memory may fail me.
The trycmd-local tests complain about sudo not being found but that's also the case on the main branch iirc.
Yes, it shouldn't be a blocking problem I think?


