Commit graph

17 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
8ddb0dd485 nix build: switch to upstream cargo2nix (branch release-0.11.0) 2025-01-12 18:16:23 +01:00
9d83605736 flake: update versions of nixpkgs and rust-overlay 2025-01-12 17:34:04 +01:00
8881930cdd
update nixpkgs and rust-overlay sources in flake.nix 2024-08-26 19:19:16 +02:00
b442b0e35e devShells.full: add rust-analyzer 2024-04-23 11:59:37 +03:00
9900368380
[nix-improvements] modernize Nix infrastructure 2024-02-09 11:10:13 +01:00
33e6db8b72
[dep-upgrade-202402] update rustc to 1.73 2024-02-08 12:33:09 +01:00
fe1af5d98b
[dep-upgrade-202402] refactor dependencies: move all as workspace deps 2024-02-05 13:02:02 +01:00
d50fa2a562
nix: add clang to flake.nix and shell.nix 2023-10-26 11:19:22 +02:00
d3fffd30dc use mold linker when invoking cargo manually (not in nix build scripts) 2023-10-10 13:56:48 +02:00
1bbf604224 flake.nix: switch to nix-community/flake-compat
edolstra/flake-compat is unmaintained.

cargo2nix also still pulls in edolstra/flake-compat, make it follow the
nix-community one.
2023-07-16 12:40:47 +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
d6ea0cbefa Add tests for rpc_secret_file 2023-01-07 14:19:36 +01:00
f2106c2733 Implement rpc_secret_file 2023-01-04 18:35:10 +01:00
60c26fbc62
Inject last modified date as git_version; flake cache uploading 2022-11-16 23:47:10 +01:00
e76dba9561
Make repository into a Nix flake 2022-11-16 23:25:34 +01:00