Skip to content

yubikey-agent: fix on darwin#93769

Closed
philandstuff wants to merge 1 commit intoNixOS:masterfrom
philandstuff:fix-darwin-yubikey-agent
Closed

yubikey-agent: fix on darwin#93769
philandstuff wants to merge 1 commit intoNixOS:masterfrom
philandstuff:fix-darwin-yubikey-agent

Conversation

@philandstuff
Copy link
Contributor

@philandstuff philandstuff commented Jul 24, 2020

Mea culpa: in #92936, I did originally test on macOS but I forgot to
retest after adding the piv-go patch. Unfortunately, the piv-go patch
is broken on macOS (but fortunately it is unnecessary).

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@philandstuff philandstuff requested a review from flokli July 24, 2020 13:58
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jul 24, 2020
@philandstuff philandstuff requested a review from rawkode July 24, 2020 14:01
@ofborg ofborg bot requested a review from kalbasit July 24, 2020 14:06
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 24, 2020
@flokli
Copy link
Member

flokli commented Jul 24, 2020 via email

@philandstuff
Copy link
Contributor Author

I tried writing postPatch = "go mod edit -replace=github.com/go-piv/piv-go=github.com/rawkode/piv-go@80327675dc86ebe3c494f9cd6fe5dee3eec5bf4c", which should work, but the go binary gets confused about where to put cache stuff, and the go-modules derivation didn't inherit the patch. There really ought to be a nicer way of inserting replace directives in buildGoModule than writing a patch file for go.mod 😞

@philandstuff
Copy link
Contributor Author

@flokli @rawkode unfortunately the conditional is still needed. I tried compiling latest go-piv/piv-go#75 unconditionally on darwin and got:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/slyckbirmqymy0yj4cy27r21j8v2lmg8-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/ggq7300zpz3js06xyfq5hkfppq8zg9xd-use-piv-go-75.patch
patching file go.mod
patching file go.sum
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Building subPackage ./.
github.com/go-piv/piv-go/piv
# pkg-config --cflags  -- libpcsclite
Package libpcsclite was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcsclite.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpcsclite' found
pkg-config: exit status 1

it looks like the pkg-config lines are not harmless on distros that don't support pkg-config 😞

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/using-go-mod-edit-in-packages/8305/1

@philandstuff philandstuff force-pushed the fix-darwin-yubikey-agent branch from 2495824 to 55053e1 Compare July 25, 2020 21:02
@philandstuff
Copy link
Contributor Author

@flokli @rawkode I've updated this PR to pull in the latest go-piv/piv-go#75, now that that has been fixed. This allowed me to remove the conditional. I've tested locally on NixOS and macOS and both compile successfully.

Please re-review.

Mea culpa: in NixOS#92936, I did originally test on macOS but I forgot to
retest after adding the piv-go patch.  Unfortunately, the piv-go patch
is broken on macOS (but fortunately it is unnecessary).
@philandstuff
Copy link
Contributor Author

urgh, my git fu is broken here :( seems I pushed a weird commit somehow which broke everything. Apologies for the mass notification 😞

I'll open a new PR once I've worked out what I'm doing again.

@ofborg ofborg bot requested review from rawkode and removed request for FRidh, Profpatsch, WilliButz, alyssais, infinisil and nbp July 25, 2020 21:19
@ofborg ofborg bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 25, 2020
@philandstuff philandstuff mentioned this pull request Jul 25, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants