Skip to content

Commit

Permalink
age: Debug why builds fail on Darwin
Browse files Browse the repository at this point in the history
derivation:
  - patch
  - only run TestScript/plugin test and be verbose

age patch:
  - AGEDEBUG=plugin
  - remove stderr checks
  • Loading branch information
bdd committed Aug 4, 2023
1 parent aba58df commit d1cbc9d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/tools/security/age/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ buildGoModule rec {
url = "https://github.com/FiloSottile/age/commit/edf7388f7731b274b055dcab3ec4006cc4961b68.patch";
sha256 = "sha256-CloCj/uF3cqTeCfRkV6TeYiovuDQXm1ZIklREWAot1E=";
})

./test-agedebug-plugin.patch
];

ldflags = [
Expand All @@ -43,6 +45,10 @@ buildGoModule rec {
installManPage doc/*.1
'';

preCheck = ''
buildFlagsArray+=("-v" "-run" "TestScript/plugin")
'';

doInstallCheck = true;
installCheckPhase = ''
if [[ "$("$out/bin/${pname}" --version)" == "${version}" ]]; then
Expand Down
21 changes: 21 additions & 0 deletions pkgs/tools/security/age/test-agedebug-plugin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/cmd/age/testdata/plugin.txt b/cmd/age/testdata/plugin.txt
index 01e3ed8..f8c3234 100644
--- a/cmd/age/testdata/plugin.txt
+++ b/cmd/age/testdata/plugin.txt
@@ -1,14 +1,14 @@
+env AGEDEBUG=plugin
+
# encrypt and decrypt a file with a test plugin
age -r age1test10qdmzv9q -o test.age input
age -d -i key.txt test.age
cmp stdout input
-! stderr .

# very long identity and recipient
age -R long-recipient.txt -o test.age input
age -d -i long-key.txt test.age
cmp stdout input
-! stderr .

-- input --
test

0 comments on commit d1cbc9d

Please sign in to comment.