rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwood9f2f9dae52b86e0f9a52adb0235473e2e11d5218
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "fc5dc9409d2ca6427a5124db4325e9a1f3cb89fc",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"title": "nix: Polish Flake",
"state": {
"status": "merged",
"conflicts": []
},
"before": "d56d619f5601ba456c7bb517be96a1418743cf9e",
"after": "9f2f9dae52b86e0f9a52adb0235473e2e11d5218",
"commits": [
"9f2f9dae52b86e0f9a52adb0235473e2e11d5218",
"bddf92e33ee0eb9055057c36b92d9eb985c5ed26",
"85911e3ae9b5254f5c601b0e0bcaa4cea73c4c99",
"82eb7ea8f549fcca8ff435fa85f5e434778d9a26",
"c16c39f721b9055f81ae82d5b08676b7cefac759",
"5b8647ceee26bdb3dcff860664a9c4de907b2f2d",
"56c81e552499be1ac3c2fc3d309e3cfd98628bfa",
"471352011245c16e75c83fe31acd2e07b5ac6618",
"9468e18445c7f63977ae86d75a84fb6862d257f6",
"854e625048542405d2a0c1cb0f458a0b2dcab769",
"955f2140bd9986378b9842636627de1151c96043",
"ce182193ccee474377f1e6648173674687b22f14",
"41fea8333274c33e235ce8ce040187b2aa97d8a7"
],
"target": "7e1cb406bb935c3de008d2171e8961f57b4336ea",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "fc5dc9409d2ca6427a5124db4325e9a1f3cb89fc",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "Basically a rewrite of the Flake, with micro-commits so that you can see what's going on. They can of course be squashed before merge.\n\nI suggest to enjoy it in its full glory:\n```\n$ nix run github:Mic92/nix-fast-build\n```",
"base": "6ab3bfcba0577fabdcb84498441c6605391290f4",
"oid": "aa12ec09a07e0c3a5ea9b4565d73c77249f9c4a4",
"timestamp": 1715273932
},
{
"id": "bdb2e9898eaad9ee46a0ed76f242a243cc13d7da",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "",
"base": "6ab3bfcba0577fabdcb84498441c6605391290f4",
"oid": "4cf47ff5532639980fc8877e9ffcefeaaaf4faf6",
"timestamp": 1715274078
},
{
"id": "9c82e3ef084b0881676affb5aa6566902a4ebf76",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "Removed fixup commit that I left in accidentally earlier.",
"base": "6ab3bfcba0577fabdcb84498441c6605391290f4",
"oid": "9b91687a1d0235e8db1d6e95600aca40435d860f",
"timestamp": 1715337549
},
{
"id": "0386f31f468bf1eac2f201544a9eda1ddd165537",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "`cargo deny` and `cargo audit` now working.",
"base": "6ab3bfcba0577fabdcb84498441c6605391290f4",
"oid": "0adb21d56dfd6969027e065efe219b8dbcd2ee42",
"timestamp": 1715361031
},
{
"id": "1896f07b8340148f5fe03280a150caa551798b46",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "Trivial rebase onto current `master`, no meaningful changes to previous revision.",
"base": "25c6660a59c621de1ec406e4f9b2ccfbd21e1b90",
"oid": "65913d003ac4ea1c6c0108a4d3aa66abbc97f430",
"timestamp": 1715631358
},
{
"id": "715f816e97079eff2058533d9e947387cc98c443",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "Rebase",
"base": "d56d619f5601ba456c7bb517be96a1418743cf9e",
"oid": "9f2f9dae52b86e0f9a52adb0235473e2e11d5218",
"timestamp": 1715874905
},
{
"id": "a6c3b5a1f10e268fe82e3e55c0ad6aa150c691cd",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": null
},
"description": "Rebase and squash.",
"base": "d839418c56560a768455fbcdac50fce4732623eb",
"oid": "b2992814b61b19659c3384a48c2f98b56eaa066e",
"timestamp": 1715941343
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "3f5cafaa-e12a-40ab-b99f-33e73616dc54"
},
"info_url": "https://cci.rad.levitte.org//3f5cafaa-e12a-40ab-b99f-33e73616dc54.html"
}
Started at: 2026-09-08 21:20:52.677522+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/3f5cafaa-e12a-40ab-b99f-33e73616dc54/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 39 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout fc5dc9409d2ca6427a5124db4325e9a1f3cb89fc
✓ Switched to branch patch/fc5dc94 at revision 715f816
✓ Branch patch/fc5dc94 setup to track rad/patches/fc5dc9409d2ca6427a5124db4325e9a1f3cb89fc
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout 9f2f9dae52b86e0f9a52adb0235473e2e11d5218
HEAD is now at 9f2f9dae nix: Enable checks `audit`, `deny`
Exit code: 0
$ rad patch show fc5dc9409d2ca6427a5124db4325e9a1f3cb89fc -p
╭─────────────────────────────────────────────────────────────────────────────────╮
│ Title nix: Polish Flake │
│ Patch fc5dc9409d2ca6427a5124db4325e9a1f3cb89fc │
│ Author lorenz z6MkkPv…WX5sTEz │
│ Head 9f2f9dae52b86e0f9a52adb0235473e2e11d5218 │
│ Base d56d619f5601ba456c7bb517be96a1418743cf9e │
│ Target master │
│ Branches patch/fc5dc94 │
│ Commits ahead 13, behind 1344 │
│ Status merged │
│ │
│ Basically a rewrite of the Flake, with micro-commits so that you can see what's │
│ going on. They can of course be squashed before merge. │
│ │
│ I suggest to enjoy it in its full glory: │
│ ``` │
│ $ nix run github:Mic92/nix-fast-build │
│ ``` │
├─────────────────────────────────────────────────────────────────────────────────┤
│ 9f2f9da nix: Enable checks `audit`, `deny` │
│ bddf92e nix: Update `flake.lock` │
│ 85911e3 nix: Clean up │
│ 82eb7ea nix: Use system-independent `lib` │
│ c16c39f nix: Use `with pkgs` before lists of packages │
│ 5b8647c nix: Compress even more by removing special crate │
│ 56c81e5 nix: Set environment variable on derivation │
│ 4713520 nix: Refactor Flake │
│ 9468e18 nix: Move package `radicle` next to the others │
│ 854e625 nix: Produce a more stable version │
│ 955f214 nix: Use `installShellFiles` for `buildManPages` │
│ ce18219 nix: Refactor `srcFilters` to use `any` │
│ 41fea83 nix: Remove empty `inherit`s │
├─────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision fc5dc94 @ 6ab3bfc..aa12ec0 by lorenz z6MkkPv…WX5sTEz 2 years ago │
│ ↑ Revision bdb2e98 @ 6ab3bfc..4cf47ff by lorenz z6MkkPv…WX5sTEz 2 years ago │
│ └─ ✓ accepted by fintohaps z6Mkire…SQZ3voM 2 years ago │
│ ↑ Revision 9c82e3e @ 6ab3bfc..9b91687 by lorenz z6MkkPv…WX5sTEz 2 years ago │
│ ↑ Revision 0386f31 @ 6ab3bfc..0adb21d by lorenz z6MkkPv…WX5sTEz 2 years ago │
│ ↑ Revision 1896f07 @ 25c6660..65913d0 by lorenz z6MkkPv…WX5sTEz 2 years ago │
│ ↑ Revision 715f816 @ d56d619..9f2f9da by lorenz z6MkkPv…WX5sTEz 2 years ago │
│ ↑ Revision a6c3b5a @ d839418..b299281 by cloudhead z6MksFq…bS9wzpT 2 years ago │
│ └─ ✓ merged by cloudhead z6MksFq…bS9wzpT │
╰─────────────────────────────────────────────────────────────────────────────────╯
commit 9f2f9dae52b86e0f9a52adb0235473e2e11d5218
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Fri May 10 17:35:07 2024 +0200
nix: Enable checks `audit`, `deny`
diff --git a/flake.nix b/flake.nix
index 3cc85b1f97..2d06af35ac 100644
--- a/flake.nix
+++ b/flake.nix
@@ -124,17 +124,12 @@
});
doc = craneLib.cargoDoc commonArgs;
-
- # Check formatting
+ deny = craneLib.cargoDeny commonArgs;
fmt = craneLib.cargoFmt basicArgs;
- # FIXME: Broken.
- # audit = craneLib.cargoAudit {
- # inherit src advisory-db;
- # };
-
- # FIXME: Broken as of 2024-05-09.
- # deny = craneLib.cargoDeny basicArgs;
+ audit = craneLib.cargoAudit {
+ inherit src advisory-db;
+ };
# Run tests with cargo-nextest
nextest = craneLib.cargoNextest (commonArgs
commit bddf92e33ee0eb9055057c36b92d9eb985c5ed26
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Fri May 10 17:35:19 2024 +0200
nix: Update `flake.lock`
diff --git a/flake.lock b/flake.lock
index 9677421432..179639b721 100644
--- a/flake.lock
+++ b/flake.lock
@@ -3,11 +3,11 @@
"advisory-db": {
"flake": false,
"locked": {
- "lastModified": 1701193254,
- "narHash": "sha256-Hr7efA3GjwqBkGYKmd3XmGckdPQikbcCmOrq7fmTp3A=",
+ "lastModified": 1714183630,
+ "narHash": "sha256-1BVft7ggSN2XXFeXQjazU3jN9wVECd9qp2mZx/8GDMk=",
"owner": "rustsec",
"repo": "advisory-db",
- "rev": "43af5fef0591531a72ebb86c5f1c623ee95c62fe",
+ "rev": "35e7459a331d3e0c585e56dabd03006b9b354088",
"type": "github"
},
"original": {
@@ -23,11 +23,11 @@
]
},
"locked": {
- "lastModified": 1701622587,
- "narHash": "sha256-o3XhxCCyrUHZ0tlta2W7/MuXzy+n0+BUt3rKFK3DIK4=",
+ "lastModified": 1715274763,
+ "narHash": "sha256-3Iv1PGHJn9sV3HO4FlOVaaztOxa9uGLfOmUWrH7v7+A=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "c09d2cbe84cc2adfe1943cb2a0b55a71c835ca9a",
+ "rev": "27025ab71bdca30e7ed0a16c88fd74c5970fc7f5",
"type": "github"
},
"original": {
@@ -41,11 +41,11 @@
"systems": "systems"
},
"locked": {
- "lastModified": 1701680307,
- "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
+ "lastModified": 1710146030,
+ "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
+ "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
@@ -56,11 +56,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1701961404,
- "narHash": "sha256-ieWHyh6kJtabQYUam/dXXi22MgcgLQvl+f2x/95n+us=",
+ "lastModified": 1715336739,
+ "narHash": "sha256-JpcAHWgeVo6z3uUg+xzaeZSLn7MlcZMo9y6QQ7+Ue6A=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "8fef9eee026f0d95c06b5880ef9c1af0f643aadf",
+ "rev": "baefb35c627d6bc698fd376774506f5f616bc1f3",
"type": "github"
},
"original": {
@@ -89,11 +89,11 @@
]
},
"locked": {
- "lastModified": 1711419061,
- "narHash": "sha256-+5M/czgYGqs/jKmi8bvYC+JUYboUKNTfkRiesXopeXQ=",
+ "lastModified": 1715307487,
+ "narHash": "sha256-yuDAys3JuJmhQUQGMMsl3BDQNZUYZDw0eA71OVh9FeY=",
"owner": "oxalica",
"repo": "rust-overlay",
- "rev": "4c11d2f698ff1149f76b69e72852d5d75f492d0c",
+ "rev": "ec7a7caf50877bc32988c82653d6b3e6952a8c3f",
"type": "github"
},
"original": {
commit 85911e3ae9b5254f5c601b0e0bcaa4cea73c4c99
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 18:50:01 2024 +0200
nix: Clean up
diff --git a/flake.nix b/flake.nix
index f147c8a5e3..3cc85b1f97 100644
--- a/flake.nix
+++ b/flake.nix
@@ -65,19 +65,23 @@
};
basicArgs = {
- pname = "Heartwood";
inherit src;
+ pname = "Heartwood";
+ strictDeps = true;
};
+ # Build *just* the cargo dependencies, so we can reuse
+ # all of that work (e.g. via cachix) when running in CI
+ cargoArtifacts = craneLib.buildDepsOnly basicArgs;
+
# Common arguments can be set here to avoid repeating them later
commonArgs =
basicArgs
// {
inherit cargoArtifacts;
- strictDeps = true;
- buildInputs =
- with pkgs; [
+ nativeBuildInputs = with pkgs;
+ [
git
# Add additional build inputs here
]
@@ -99,29 +103,6 @@
else {}
);
};
-
- # Build *just* the cargo dependencies, so we can reuse
- # all of that work (e.g. via cachix) when running in CI
- cargoArtifacts = craneLib.buildDepsOnly basicArgs;
-
- crate = {
- name,
- pages ? [],
- }:
- craneLib.buildPackage (commonArgs
- // {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = src + "/" + name + "/Cargo.toml";}) pname version;
- cargoExtraArgs = "-p ${name}";
- doCheck = false;
-
- nativeBuildInputs = with pkgs; [asciidoctor installShellFiles];
- postInstall = ''
- for page in ${lib.escapeShellArgs pages}; do
- asciidoctor -d manpage -b manpage $page
- installManPage ''${page::-5}
- done
- '';
- });
in {
# Formatter
formatter = pkgs.alejandra;
@@ -173,9 +154,26 @@
};
packages = let
- crates = builtins.listToAttrs (map (
- package: lib.nameValuePair (package.name) (crate package)
- )
+ crate = {
+ name,
+ pages ? [],
+ }:
+ craneLib.buildPackage (commonArgs
+ // {
+ inherit (craneLib.crateNameFromCargoToml {cargoToml = src + "/" + name + "/Cargo.toml";}) pname version;
+ cargoExtraArgs = "-p ${name}";
+ doCheck = false;
+
+ nativeBuildInputs = with pkgs; [asciidoctor installShellFiles];
+ postInstall = ''
+ for page in ${lib.escapeShellArgs pages}; do
+ asciidoctor -d manpage -b manpage $page
+ installManPage ''${page::-5}
+ done
+ '';
+ });
+ crates = builtins.listToAttrs (map
+ ({name, ...} @ package: lib.nameValuePair name (crate package))
[
{
name = "radicle-httpd";
@@ -191,15 +189,11 @@
}
{
name = "radicle-remote-helper";
- pages = [
- "git-remote-rad.1.adoc"
- ];
+ pages = ["git-remote-rad.1.adoc"];
}
{
name = "radicle-node";
- pages = [
- "radicle-node.1.adoc"
- ];
+ pages = ["radicle-node.1.adoc"];
}
]);
in
commit 82eb7ea8f549fcca8ff435fa85f5e434778d9a26
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 18:42:03 2024 +0200
nix: Use system-independent `lib`
diff --git a/flake.nix b/flake.nix
index 07a4352e43..f147c8a5e3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -39,13 +39,12 @@
...
}:
flake-utils.lib.eachDefaultSystem (system: let
+ lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
};
- inherit (pkgs) lib;
-
rustToolChain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolChain;
commit c16c39f721b9055f81ae82d5b08676b7cefac759
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 18:41:05 2024 +0200
nix: Use `with pkgs` before lists of packages
diff --git a/flake.nix b/flake.nix
index cbfff071c4..07a4352e43 100644
--- a/flake.nix
+++ b/flake.nix
@@ -78,15 +78,15 @@
strictDeps = true;
buildInputs =
- [
- pkgs.git
+ with pkgs; [
+ git
# Add additional build inputs here
]
- ++ lib.optionals pkgs.stdenv.isDarwin [
+ ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs; [
# Additional darwin specific inputs can be set here
- pkgs.libiconv
- pkgs.darwin.apple_sdk.frameworks.Security
- ];
+ libiconv
+ darwin.apple_sdk.frameworks.Security
+ ]);
env =
{
@@ -252,12 +252,12 @@
devShells.default = craneLib.devShell {
# Extra inputs can be added here; cargo and rustc are provided by default.
- packages = [
- pkgs.cargo-watch
- pkgs.cargo-nextest
- pkgs.ripgrep
- pkgs.rust-analyzer
- pkgs.sqlite
+ packages = with pkgs; [
+ cargo-watch
+ cargo-nextest
+ ripgrep
+ rust-analyzer
+ sqlite
];
};
});
commit 5b8647ceee26bdb3dcff860664a9c4de907b2f2d
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 18:39:28 2024 +0200
nix: Compress even more by removing special crate
diff --git a/flake.nix b/flake.nix
index d59bf12dc6..cbfff071c4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -107,13 +107,12 @@
crate = {
name,
- package ? name,
pages ? [],
}:
craneLib.buildPackage (commonArgs
// {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = src + "/" + package + "/Cargo.toml";}) pname version;
- cargoExtraArgs = lib.optionalString (package != "") "-p ${package}";
+ inherit (craneLib.crateNameFromCargoToml {cargoToml = src + "/" + name + "/Cargo.toml";}) pname version;
+ cargoExtraArgs = "-p ${name}";
doCheck = false;
nativeBuildInputs = with pkgs; [asciidoctor installShellFiles];
@@ -149,14 +148,13 @@
# Check formatting
fmt = craneLib.cargoFmt basicArgs;
- # TODO: audits are failing so skip this check for now
- # Audit dependencies
+ # FIXME: Broken.
# audit = craneLib.cargoAudit {
# inherit src advisory-db;
# };
- # Audit licenses
- deny = craneLib.cargoDeny basicArgs;
+ # FIXME: Broken as of 2024-05-09.
+ # deny = craneLib.cargoDeny basicArgs;
# Run tests with cargo-nextest
nextest = craneLib.cargoNextest (commonArgs
@@ -175,49 +173,53 @@
});
};
- packages =
- {
- default = self.packages.${system}.radicle;
- radicle-full = pkgs.buildEnv {
- name = "radicle-full";
- paths = with self.packages.${system}; [
- default
- radicle-httpd
- ];
- };
- }
- // (builtins.listToAttrs (map (
- package:
- if builtins.isString package
- then {
- name = package;
- value = crate {name = package;};
- }
- else {
- inherit (package) name;
- value = crate package;
- }
+ packages = let
+ crates = builtins.listToAttrs (map (
+ package: lib.nameValuePair (package.name) (crate package)
)
[
{
- package = "";
- name = "radicle";
+ name = "radicle-httpd";
+ pages = ["radicle-httpd.1.adoc"];
+ }
+ {
+ name = "radicle-cli";
pages = [
- "git-remote-rad.1.adoc"
"rad.1.adoc"
- "radicle-node.1.adoc"
- "rad-patch.1.adoc"
"rad-id.1.adoc"
+ "rad-patch.1.adoc"
];
}
{
- name = "radicle-httpd";
- pages = ["radicle-httpd.1.adoc"];
+ name = "radicle-remote-helper";
+ pages = [
+ "git-remote-rad.1.adoc"
+ ];
}
- "radicle-cli"
- "radicle-remote-helper"
- "radicle-node"
- ]));
+ {
+ name = "radicle-node";
+ pages = [
+ "radicle-node.1.adoc"
+ ];
+ }
+ ]);
+ in
+ crates
+ // rec {
+ default = radicle;
+ radicle = pkgs.buildEnv {
+ name = "radicle";
+ paths = with crates; [
+ radicle-cli
+ radicle-node
+ radicle-remote-helper
+ ];
+ };
+ radicle-full = pkgs.buildEnv {
+ name = "radicle-full";
+ paths = builtins.attrValues crates;
+ };
+ };
apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.radicle;
commit 56c81e552499be1ac3c2fc3d309e3cfd98628bfa
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 18:16:34 2024 +0200
nix: Set environment variable on derivation
diff --git a/flake.nix b/flake.nix
index d9a8d11e1c..d59bf12dc6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -161,7 +161,6 @@
# Run tests with cargo-nextest
nextest = craneLib.cargoNextest (commonArgs
// {
- inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
nativeBuildInputs = [
@@ -172,9 +171,7 @@
];
# Ensure dev is used since we rely on env variables being
# set in tests.
- buildPhase = ''
- export CARGO_PROFILE=dev;
- '';
+ env.CARGO_PROFILE = "dev";
});
};
commit 471352011245c16e75c83fe31acd2e07b5ac6618
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 18:07:59 2024 +0200
nix: Refactor Flake
More code reuse, and a little more direct, basically.
diff --git a/flake.nix b/flake.nix
index d835e364e4..d9a8d11e1c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -39,7 +39,6 @@
...
}:
flake-utils.lib.eachDefaultSystem (system: let
- pname = "Heartwood";
pkgs = import nixpkgs {
inherit system;
overlays = [(import rust-overlay)];
@@ -66,51 +65,65 @@
filter = srcFilters;
};
- # Common arguments can be set here to avoid repeating them later
- commonArgs = {
- inherit pname;
+ basicArgs = {
+ pname = "Heartwood";
inherit src;
- strictDeps = true;
+ };
- buildInputs =
- [
- pkgs.git
- # Add additional build inputs here
- ]
- ++ lib.optionals pkgs.stdenv.isDarwin [
- # Additional darwin specific inputs can be set here
- pkgs.libiconv
- pkgs.darwin.apple_sdk.frameworks.Security
- ];
-
- env =
- {
- RADICLE_VERSION = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
- }
- // (
- if self ? rev || self ? dirtyRev
- then {
- GIT_HEAD = self.rev or self.dirtyRev;
+ # Common arguments can be set here to avoid repeating them later
+ commonArgs =
+ basicArgs
+ // {
+ inherit cargoArtifacts;
+ strictDeps = true;
+
+ buildInputs =
+ [
+ pkgs.git
+ # Add additional build inputs here
+ ]
+ ++ lib.optionals pkgs.stdenv.isDarwin [
+ # Additional darwin specific inputs can be set here
+ pkgs.libiconv
+ pkgs.darwin.apple_sdk.frameworks.Security
+ ];
+
+ env =
+ {
+ RADICLE_VERSION = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
}
- else {}
- );
- };
+ // (
+ if self ? rev || self ? dirtyRev
+ then {
+ GIT_HEAD = self.rev or self.dirtyRev;
+ }
+ else {}
+ );
+ };
# Build *just* the cargo dependencies, so we can reuse
# all of that work (e.g. via cachix) when running in CI
- cargoArtifacts =
- craneLib.buildDepsOnly commonArgs;
-
- # Build the listed .adoc files as man pages to the package.
- buildManPages = pages: {
- nativeBuildInputs = with pkgs; [asciidoctor installShellFiles];
- postInstall = ''
- for page in ${lib.escapeShellArgs pages}; do
- asciidoctor -d manpage -b manpage $page
- installManPage ''${page::-5}
- done
- '';
- };
+ cargoArtifacts = craneLib.buildDepsOnly basicArgs;
+
+ crate = {
+ name,
+ package ? name,
+ pages ? [],
+ }:
+ craneLib.buildPackage (commonArgs
+ // {
+ inherit (craneLib.crateNameFromCargoToml {cargoToml = src + "/" + package + "/Cargo.toml";}) pname version;
+ cargoExtraArgs = lib.optionalString (package != "") "-p ${package}";
+ doCheck = false;
+
+ nativeBuildInputs = with pkgs; [asciidoctor installShellFiles];
+ postInstall = ''
+ for page in ${lib.escapeShellArgs pages}; do
+ asciidoctor -d manpage -b manpage $page
+ installManPage ''${page::-5}
+ done
+ '';
+ });
in {
# Formatter
formatter = pkgs.alejandra;
@@ -128,20 +141,13 @@
# prevent downstream consumers from building our crate by itself.
clippy = craneLib.cargoClippy (commonArgs
// {
- inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
- doc = craneLib.cargoDoc (commonArgs
- // {
- inherit cargoArtifacts;
- });
+ doc = craneLib.cargoDoc commonArgs;
# Check formatting
- fmt = craneLib.cargoFmt {
- inherit pname;
- inherit src;
- };
+ fmt = craneLib.cargoFmt basicArgs;
# TODO: audits are failing so skip this check for now
# Audit dependencies
@@ -150,10 +156,7 @@
# };
# Audit licenses
- deny = craneLib.cargoDeny {
- inherit pname;
- inherit src;
- };
+ deny = craneLib.cargoDeny basicArgs;
# Run tests with cargo-nextest
nextest = craneLib.cargoNextest (commonArgs
@@ -175,55 +178,49 @@
});
};
- packages = {
- default = self.packages.${system}.radicle;
- radicle-full = pkgs.buildEnv {
- name = "radicle-full";
- paths = with self.packages.${system}; [
- default
- radicle-httpd
- ];
- };
- radicle = craneLib.buildPackage (commonArgs
- // {
- doCheck = false;
- inherit cargoArtifacts;
- }
- // (buildManPages [
- "git-remote-rad.1.adoc"
- "rad.1.adoc"
- "radicle-node.1.adoc"
- "rad-patch.1.adoc"
- "rad-id.1.adoc"
- ]));
- radicle-remote-helper = craneLib.buildPackage (commonArgs
- // {
- inherit cargoArtifacts;
- cargoBuildCommand = "cargo build --release -p radicle-remote-helper";
- doCheck = false;
- });
- radicle-cli = craneLib.buildPackage (commonArgs
- // {
- inherit cargoArtifacts;
- cargoBuildCommand = "cargo build --release -p radicle-cli";
- doCheck = false;
- });
- radicle-node = craneLib.buildPackage (commonArgs
- // {
- inherit cargoArtifacts;
- cargoBuildCommand = "cargo build --release -p radicle-node";
- doCheck = false;
- });
- radicle-httpd = craneLib.buildPackage (commonArgs
- // {
- inherit cargoArtifacts;
- cargoBuildCommand = "cargo build --release -p radicle-httpd";
- doCheck = false;
- }
- // (buildManPages [
- "radicle-httpd.1.adoc"
+ packages =
+ {
+ default = self.packages.${system}.radicle;
+ radicle-full = pkgs.buildEnv {
+ name = "radicle-full";
+ paths = with self.packages.${system}; [
+ default
+ radicle-httpd
+ ];
+ };
+ }
+ // (builtins.listToAttrs (map (
+ package:
+ if builtins.isString package
+ then {
+ name = package;
+ value = crate {name = package;};
+ }
+ else {
+ inherit (package) name;
+ value = crate package;
+ }
+ )
+ [
+ {
+ package = "";
+ name = "radicle";
+ pages = [
+ "git-remote-rad.1.adoc"
+ "rad.1.adoc"
+ "radicle-node.1.adoc"
+ "rad-patch.1.adoc"
+ "rad-id.1.adoc"
+ ];
+ }
+ {
+ name = "radicle-httpd";
+ pages = ["radicle-httpd.1.adoc"];
+ }
+ "radicle-cli"
+ "radicle-remote-helper"
+ "radicle-node"
]));
- };
apps.default = flake-utils.lib.mkApp {
drv = self.packages.${system}.radicle;
commit 9468e18445c7f63977ae86d75a84fb6862d257f6
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 16:52:40 2024 +0200
nix: Move package `radicle` next to the others
It's nothing special!
diff --git a/flake.nix b/flake.nix
index a20aa824bc..d835e364e4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -111,21 +111,6 @@
done
'';
};
-
- # Build the actual crate itself, reusing the dependency
- # artifacts from above.
- radicle = craneLib.buildPackage (commonArgs
- // {
- doCheck = false;
- inherit cargoArtifacts;
- }
- // (buildManPages [
- "git-remote-rad.1.adoc"
- "rad.1.adoc"
- "radicle-node.1.adoc"
- "rad-patch.1.adoc"
- "rad-id.1.adoc"
- ]));
in {
# Formatter
formatter = pkgs.alejandra;
@@ -133,7 +118,7 @@
# Set of checks that are run: `nix flake check`
checks = {
# Build the crate as part of `nix flake check` for convenience
- inherit radicle;
+ inherit (self.packages.${system}) radicle;
# Run clippy (and deny all warnings) on the crate source,
# again, reusing the dependency artifacts from above.
@@ -191,7 +176,7 @@
};
packages = {
- default = radicle;
+ default = self.packages.${system}.radicle;
radicle-full = pkgs.buildEnv {
name = "radicle-full";
paths = with self.packages.${system}; [
@@ -199,6 +184,18 @@
radicle-httpd
];
};
+ radicle = craneLib.buildPackage (commonArgs
+ // {
+ doCheck = false;
+ inherit cargoArtifacts;
+ }
+ // (buildManPages [
+ "git-remote-rad.1.adoc"
+ "rad.1.adoc"
+ "radicle-node.1.adoc"
+ "rad-patch.1.adoc"
+ "rad-id.1.adoc"
+ ]));
radicle-remote-helper = craneLib.buildPackage (commonArgs
// {
inherit cargoArtifacts;
@@ -229,7 +226,7 @@
};
apps.default = flake-utils.lib.mkApp {
- drv = radicle;
+ drv = self.packages.${system}.radicle;
};
apps.radicle-full = flake-utils.lib.mkApp {
commit 854e625048542405d2a0c1cb0f458a0b2dcab769
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 16:17:41 2024 +0200
nix: Produce a more stable version
diff --git a/flake.nix b/flake.nix
index 7a67d3ace1..a20aa824bc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -82,9 +82,18 @@
pkgs.libiconv
pkgs.darwin.apple_sdk.frameworks.Security
];
- preBuild = lib.optionalString (self.shortRev or null != null) ''
- export GIT_HEAD=${self.shortRev}
- '';
+
+ env =
+ {
+ RADICLE_VERSION = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
+ }
+ // (
+ if self ? rev || self ? dirtyRev
+ then {
+ GIT_HEAD = self.rev or self.dirtyRev;
+ }
+ else {}
+ );
};
# Build *just* the cargo dependencies, so we can reuse
commit 955f2140bd9986378b9842636627de1151c96043
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 15:55:04 2024 +0200
nix: Use `installShellFiles` for `buildManPages`
diff --git a/flake.nix b/flake.nix
index 5cc05e0c49..7a67d3ace1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -56,7 +56,6 @@
".diff" # testing
".md" # testing
".adoc" # man pages
- "build-man-pages.sh" # man page build script
]
||
# Default filter from crane (allow .rs files)
@@ -95,16 +94,13 @@
# Build the listed .adoc files as man pages to the package.
buildManPages = pages: {
- nativeBuildInputs = [pkgs.asciidoctor];
+ nativeBuildInputs = with pkgs; [asciidoctor installShellFiles];
postInstall = ''
- for f in ${lib.escapeShellArgs pages} ; do
- cat=''${f%.adoc}
- cat=''${cat##*.}
- [ -d "$out/share/man/man$cat" ] || mkdir -p "$out/share/man/man$cat"
- scripts/build-man-pages.sh "$out/share/man/man$cat" $f
+ for page in ${lib.escapeShellArgs pages}; do
+ asciidoctor -d manpage -b manpage $page
+ installManPage ''${page::-5}
done
'';
- outputs = ["out" "man"];
};
# Build the actual crate itself, reusing the dependency
commit ce182193ccee474377f1e6648173674687b22f14
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 15:51:10 2024 +0200
nix: Refactor `srcFilters` to use `any`
That's more lighweight and easier to extend.
diff --git a/flake.nix b/flake.nix
index a3849519f5..5cc05e0c49 100644
--- a/flake.nix
+++ b/flake.nix
@@ -51,20 +51,13 @@
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolChain;
srcFilters = path: type:
- # Allow sql schemas
- (lib.hasSuffix "\.sql" path)
- ||
- # Allow diff files for testing purposes
- (lib.hasSuffix "\.diff" path)
- ||
- # Allow md files for testing purposes
- (lib.hasSuffix "\.md" path)
- ||
- # Allow adoc files
- (lib.hasSuffix "\.adoc" path)
- ||
- # Allow man page build script
- (lib.hasSuffix "build-man-pages\.sh" path)
+ builtins.any (suffix: lib.hasSuffix suffix path) [
+ ".sql" # schemas
+ ".diff" # testing
+ ".md" # testing
+ ".adoc" # man pages
+ "build-man-pages.sh" # man page build script
+ ]
||
# Default filter from crane (allow .rs files)
(craneLib.filterCargoSources path type);
@@ -102,7 +95,7 @@
# Build the listed .adoc files as man pages to the package.
buildManPages = pages: {
- nativeBuildInputs = [ pkgs.asciidoctor ];
+ nativeBuildInputs = [pkgs.asciidoctor];
postInstall = ''
for f in ${lib.escapeShellArgs pages} ; do
cat=''${f%.adoc}
@@ -111,7 +104,7 @@
scripts/build-man-pages.sh "$out/share/man/man$cat" $f
done
'';
- outputs = [ "out" "man" ];
+ outputs = ["out" "man"];
};
# Build the actual crate itself, reusing the dependency
@@ -120,7 +113,8 @@
// {
doCheck = false;
inherit cargoArtifacts;
- } // (buildManPages [
+ }
+ // (buildManPages [
"git-remote-rad.1.adoc"
"rad.1.adoc"
"radicle-node.1.adoc"
@@ -223,7 +217,8 @@
inherit cargoArtifacts;
cargoBuildCommand = "cargo build --release -p radicle-httpd";
doCheck = false;
- } // (buildManPages [
+ }
+ // (buildManPages [
"radicle-httpd.1.adoc"
]));
};
commit 41fea8333274c33e235ce8ce040187b2aa97d8a7
Author: Lorenz Leutgeb <lorenz@leutgeb.xyz>
Date: Thu May 9 15:45:52 2024 +0200
nix: Remove empty `inherit`s
These were not doing anything.
{ inherit (f) x; }
is equivalent to
{ x = f.x; }
but
{ inherit (f); }
is equivalent to
{}
since there is no attribute name given.
diff --git a/flake.nix b/flake.nix
index 2a8ed0d597..a3849519f5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -118,7 +118,6 @@
# artifacts from above.
radicle = craneLib.buildPackage (commonArgs
// {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = ./radicle/Cargo.toml;});
doCheck = false;
inherit cargoArtifacts;
} // (buildManPages [
@@ -203,28 +202,24 @@
};
radicle-remote-helper = craneLib.buildPackage (commonArgs
// {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = ./radicle-remote-helper/Cargo.toml;});
inherit cargoArtifacts;
cargoBuildCommand = "cargo build --release -p radicle-remote-helper";
doCheck = false;
});
radicle-cli = craneLib.buildPackage (commonArgs
// {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = ./radicle-cli/Cargo.toml;});
inherit cargoArtifacts;
cargoBuildCommand = "cargo build --release -p radicle-cli";
doCheck = false;
});
radicle-node = craneLib.buildPackage (commonArgs
// {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = ./radicle-node/Cargo.toml;});
inherit cargoArtifacts;
cargoBuildCommand = "cargo build --release -p radicle-node";
doCheck = false;
});
radicle-httpd = craneLib.buildPackage (commonArgs
// {
- inherit (craneLib.crateNameFromCargoToml {cargoToml = ./radicle-httpd/Cargo.toml;});
inherit cargoArtifacts;
cargoBuildCommand = "cargo build --release -p radicle-httpd";
doCheck = false;
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name 3f5cafaa-e12a-40ab-b99f-33e73616dc54 -v /opt/radcis/ci.rad.levitte.org/cci/state/3f5cafaa-e12a-40ab-b99f-33e73616dc54/s:/3f5cafaa-e12a-40ab-b99f-33e73616dc54/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/3f5cafaa-e12a-40ab-b99f-33e73616dc54/w:/3f5cafaa-e12a-40ab-b99f-33e73616dc54/w -w /3f5cafaa-e12a-40ab-b99f-33e73616dc54/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /3f5cafaa-e12a-40ab-b99f-33e73616dc54/s/script.sh
+ cargo --version
info: syncing channel updates for '1.77-x86_64-unknown-linux-gnu'
info: latest update on 2024-04-09, rust version 1.77.2 (25ef9e3d8 2024-04-09)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.77.2 (e52e36006 2024-03-26)
+ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.77-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.77-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}