zimeg / nur-packages

some extras to the nixpkgs
https://nur.nix-community.org/repos/zimeg/
MIT License
0 stars 0 forks source link

pkgs(gon): xcrun: line 42: exec: notarytool: not found #4

Open zimeg opened 3 months ago

zimeg commented 3 months ago

The darwin notarytool builtin isn't included in the packaged xcbuild which is archived at this time. When using gon this can cause problems signing:

$ gon .gon.hcl
': exit status 1: ==> ✏️  Signing files...
    Code signing successful
==> πŸ“¦  Creating dmg...
    This will open Finder windows momentarily.
    Dmg file created: ./dist/etime_darwin_arm64_v1.0.1-28-g71496c4.dmg
    Signing dmg...
    Dmg created and signed
==> 🍎  Notarizing...
    Path: ./dist/etime_darwin_arm64_v1.0.1-28-g71496c4.dmg
    Submitting file for notarization...
    Error notarizing

❗️ Error notarizing:

1 error occurred:
    * error submitting for notarization:

/nix/store/l26jpz45c1sdvi52v06ajr6qz7qz39b7-xcodebuild-0.1.2-pre/bin/xcrun: line 42: exec: notarytool: not found

A workaround exists to use some default programs when using gon in a development shell:

  devShells.gon =
    if pkgs.stdenv.isDarwin then
      pkgs.mkShell
        {
          packages = with pkgs; [
            go
            gon
            goreleaser
          ];
+         shellHook = ''
+           export PATH=/usr/bin:$PATH
+         '';
        }
    else
      null;
zimeg commented 3 months ago

🏷️ xcbuild is included as propagated build inputs of go on darwin: https://github.com/NixOS/nixpkgs/blob/e309c5b40c25615c6e46556994eedd8cafefef69/pkgs/development/compilers/go/1.21.nix#L62