Commit graph

16 commits

Author SHA1 Message Date
390a5d97fe nix, ci: build with Crane
This removes our dependency on cargo2nix, which was causing us some
issues. Whereas cargo2nix creates one Nix derivation per crate, Crane
uses only two derivations:

1. Build dependencies only
2. Build the final binary

This means that during the second step, no caching can be done. For
instance, if we do a change in garage_model, we need to recompile all of
the Garage crates including those that do not depend on garage_model.
On the upside, this allows all of the Garage crates to be built at once
using cargo build logic, which is optimized for high parallelism and
better pipelining between all of the steps of the build. All in all,
this makes most builds faster than cargo2nix.

A few other changes have been made to the build scripts and CI:

- Unit tests are now run within a Nix derivation. In fact, we have
  different derivations to run the tests using LMDB and Sqlite as
  metadata db engines.

- For debug builds, most CI steps now run in parallel (with the notable
  exception of the smoke test that runs after the build, which is
  inevitable).

- We no longer pass the GIT_VERSION argument when building debug builds
  and running the tests. This means that dev binaries and test
  binaries don't know the exact version of Garage they are from. That
  shouldn't be an issue in most cases.

- The not-dynamic.sh scripts has been fixed to fail if the file does not
  exist.
2025-02-03 16:39:50 +01:00
9900368380
[nix-improvements] modernize Nix infrastructure 2024-02-09 11:10:13 +01:00
79ca8e76a4 nix/common.nix: use pattern from nix-community/flake-compat
This is still a bit confusing, as normally the flake.defaultNix attrset
gets exposed via a top-level default.nix, but at least it brings us
closer to that.
2023-07-16 12:52:14 +03:00
5efcdc0de3 Update rust toolchain to 1.68 and simplify Nix stuff 2023-04-25 14:46:47 +02:00
f251b4721f Apply nixfmt to all .nix files; fix devshell and add it to cache 2023-01-26 12:25:48 +01:00
667ca9d3e3
Cleanup nix scripts 2022-10-18 12:48:31 +02:00
00cf076412
Fix cargo2nix feature discovery 2022-10-18 12:15:45 +02:00
e89e047c5a
Fix i386 build with custom toolchain (armv6 unknown state) 2022-10-14 18:10:24 +02:00
8d04ae7014
cargo2nix unstable (patched), rust 1.63.0, nixpkgs 22.05 (32-bit builds are broken) 2022-10-14 14:30:48 +02:00
5d065b8a0f
cargo2nix fix to fetchCrateGit 2022-08-29 17:24:53 +02:00
fcb04843f7
Run clippy in nix, leveraging nix caching ability 2022-07-26 18:27:52 +02:00
0529f3c34d Patch cargo2nix openssl override 2022-03-17 12:17:38 +01:00
5d19f3d2d7
Add integration tests to Drone 2022-02-10 17:55:50 +01:00
084dcdbd3a
Upgrade cargo2nix 2022-02-10 17:55:50 +01:00
cc1caa87fb
Use Rust binaries from Nix instead of rustup 2021-10-29 11:34:01 +02:00
dc017a0cab
Build Garage with Nix 2021-10-19 16:56:07 +02:00