From 1e5145a0fad64518f1d3982a43e237e7ce34d6c3 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Sun, 29 Oct 2023 19:39:28 +0100 Subject: [PATCH 1/3] nix: trim down shell environment --- flake.nix | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 2e1abdd..61a98c3 100644 --- a/flake.nix +++ b/flake.nix @@ -228,31 +228,23 @@ }; devShells.default = pkgs.mkShell { - shellHook = - let - systemdUkify = pkgs.systemdMinimal.override { - withEfi = true; - withBootloader = true; - withUkify = true; - }; - in - '' - ${config.pre-commit.installationScript} - export PATH=$PATH:${systemdUkify}/lib/systemd - ''; + shellHook = '' + ${config.pre-commit.installationScript} + ''; packages = [ - pkgs.uefi-run - pkgs.openssl - (pkgs.sbctl.override { databasePath = "pki"; }) - pkgs.sbsigntool - pkgs.efitools - pkgs.python39Packages.ovmfvartool - pkgs.qemu pkgs.nixpkgs-fmt pkgs.statix pkgs.cargo-release pkgs.cargo-machete + + # Convenience for test fixtures in nix/tests. + pkgs.openssl + (pkgs.sbctl.override { databasePath = "pki"; }) + + # Needed for `cargo test` in rust/tool. We also need + # TEST_SYSTEMD below for that. + pkgs.sbsigntool ]; inputsFrom = [ From 87d2087a7a5dfacb37579d2b4060c7334804d6f8 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Sun, 29 Oct 2023 19:39:53 +0100 Subject: [PATCH 2/3] tool: drop unused dependencies via machete --- rust/tool/Cargo.lock | 10 ---------- rust/tool/shared/Cargo.toml | 11 ----------- rust/tool/systemd/Cargo.toml | 3 +-- 3 files changed, 1 insertion(+), 23 deletions(-) diff --git a/rust/tool/Cargo.lock b/rust/tool/Cargo.lock index 1f15e70..99d03ab 100644 --- a/rust/tool/Cargo.lock +++ b/rust/tool/Cargo.lock @@ -444,21 +444,12 @@ name = "lanzaboote_tool" version = "0.3.0" dependencies = [ "anyhow", - "assert_cmd", "bootspec", - "clap", - "expect-test", "fastrand", - "filetime", "goblin", - "indoc", "log", - "nix", - "rand", - "serde", "serde_json", "sha2", - "stderrlog", "tempfile", "time", "walkdir", @@ -498,7 +489,6 @@ dependencies = [ "log", "nix", "rand", - "serde", "serde_json", "sha2", "stderrlog", diff --git a/rust/tool/shared/Cargo.toml b/rust/tool/shared/Cargo.toml index 162ad50..959147d 100644 --- a/rust/tool/shared/Cargo.toml +++ b/rust/tool/shared/Cargo.toml @@ -7,10 +7,7 @@ edition.workspace = true [dependencies] anyhow = "1" -clap = { version = "4.4", features = ["derive"] } goblin = "0.7" -nix = { version = "0.27", default-features = false, features = [ "fs" ] } -serde = { version = "1", features = ["derive"] } serde_json = "1" tempfile = "3.8.1" bootspec = "1" @@ -21,11 +18,3 @@ sha2 = "0.10" # different versions. fastrand = "2.0.1" log = { version = "0.4", features = ["std"] } -stderrlog = "0.5" -indoc = "2" - -[dev-dependencies] -assert_cmd = "2.0.12" -expect-test = "1.4.1" -filetime = "0.2.22" -rand = "0.8.5" diff --git a/rust/tool/systemd/Cargo.toml b/rust/tool/systemd/Cargo.toml index 8843ab5..165ba38 100644 --- a/rust/tool/systemd/Cargo.toml +++ b/rust/tool/systemd/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lzbt-systemd" -version.workspace = true +version.workspace = true edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -24,5 +24,4 @@ expect-test = "1.4.1" filetime = "0.2.22" rand = "0.8.5" goblin = "0.7.1" -serde = { version = "1.0.190", features = ["derive"] } walkdir = "2.4.0" From 3cb657f5c3e6f8e009e5bf2854d60dd0360c4889 Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Mon, 30 Oct 2023 10:24:47 +0100 Subject: [PATCH 3/3] tool: silence resolver version warning We are getting this warning: warning: some crates are on edition 2021 which defaults to `resolver = "2"`, but virtual workspaces default to `resolver = "1"` note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest Silence by opting into the new behavior. --- rust/tool/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/tool/Cargo.toml b/rust/tool/Cargo.toml index 64901e0..b7306c1 100644 --- a/rust/tool/Cargo.toml +++ b/rust/tool/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "shared",