Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yubikey-agent: init at 0.1.3 #92965

Closed
wants to merge 1 commit into from

Conversation

rawkode
Copy link
Member

@rawkode rawkode commented Jul 11, 2020

This PR is failing, if anyone can help; I'd really appreciate it.

# github.com/go-piv/piv-go/piv
In file included from vendor/github.com/go-piv/piv-go/piv/pcsc_unix.go:30:
/nix/store/wdhrxbxf175g3qwv22fcm5zda2734a7y-pcsclite-1.8.26-dev/include/PCSC/winscard.h:41:10: fatal error: pcsclite.h: No such file or directory
   41 | #include <pcsclite.h>
      |          ^~~~~~~~~~~~
compilation terminated.

I tried patching, but permissions fail, which I guess it because it's an input.

  # Permission Denied
   postPatch = ''
     substituteInPlace ${stdenv.lib.getDev pcsclite}/include/PCSC/winscard.h \
       --replace "pcsclite.h" "PCSC/pcsclite.h"
   '';
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.

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/pcsc-error-compiling-yubikey-agent/8084/1

@flokli
Copy link
Contributor

flokli commented Jul 11, 2020

It seems https://github.com/go-piv/piv-go doesn't properly use pkgconfig to ask for the include path, but instead hardcodes CFLAGS. They even have a TODO in their code:

https://github.com/go-piv/piv-go/blob/master/piv/pcsc_unix.go#L21-L31

If we discover things with pkgconfig, the right paths are discovered:

[nix-shell:~/dev/nixos/nixpkgs]$ exit
❯ nix-shell -p pcsclite -p pkgconfig
[nix-shell:~/dev/nixos/nixpkgs]$ pkg-config --cflags libpcsclite
-pthread -I/nix/store/yyr6mi1l5n4wj7lpd9xvbmnd6zfnpqrk-pcsclite-1.8.26-dev/include/PCSC

@rawkode
Copy link
Member Author

rawkode commented Jul 11, 2020

@flokli Does that mean there's nothing I can do to make this work, as it stands?

@flokli
Copy link
Contributor

flokli commented Jul 11, 2020

Of course :-)

It should just be enough to replace L21-L29 with a

// #cgo pkg-config: libpcsclite

I propose sending a patch upstream to https://github.com/go-piv/piv-go, and then applying it locally in the yubikey-agent derivation, until it's merged and trickled downstream.

@rawkode
Copy link
Member Author

rawkode commented Jul 11, 2020

Thank you for your help, @flokli 👍

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/another-missing-header-question/7119/3

@flokli
Copy link
Contributor

flokli commented Jul 12, 2020

Upstream PR: go-piv/piv-go#75

@f4814
Copy link
Contributor

f4814 commented Jul 12, 2020

I think #92936 wants to package the same thing, right?

@flokli
Copy link
Contributor

flokli commented Jul 12, 2020

yes, indeed, and #92936 contains a temporary patch to workaround the missing pkgconfig directive PRed in go-piv/piv-go#75.

Let's close this one.

@flokli flokli closed this Jul 12, 2020
@rawkode rawkode deleted the package/yubikey-agent branch July 12, 2020 11:52
@philandstuff
Copy link
Contributor

@rawkode would you like to be co-maintainer on #92936?

@rawkode
Copy link
Member Author

rawkode commented Jul 12, 2020

Sure, happy to help, @philandstuff

@philandstuff philandstuff mentioned this pull request Jul 14, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants