Another missing header question

Hi there :wave:

That’s an extra rookie question, but could you point what I am missing? Trying to build something which needs some headers, and one header doesn’t “see” the other one, which is in same directory. I am confused a bit.

Initial try:

~> go get github.com/go-piv/piv-go/piv
go: found github.com/go-piv/piv-go/piv in github.com/go-piv/piv-go v1.5.0
# github.com/go-piv/piv-go/piv
../devel/go/pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv/pcsc_unix.go:26:11: fatal error: PCSC/winscard.h: No such file or directory
   26 | // #include <PCSC/winscard.h>
      |           ^~~~~~~~~~~~~~~~~
compilation terminated.

Alright let’s add the package and retry:

~> nix-shell -p pcsclite.dev

[nix-shell:~]$ go get github.com/go-piv/piv-go/piv
go: found github.com/go-piv/piv-go/piv in github.com/go-piv/piv-go v1.5.0
# github.com/go-piv/piv-go/piv
In file included from ../devel/go/pkg/mod/github.com/go-piv/piv-go@v1.5.0/piv/pcsc_unix.go:26:
/nix/store/j9chaig079f4h1srv4rd4vpfzw73ij9w-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.

Checking if it uses correct path or not:

~> nix repl
Welcome to Nix version 2.3.4. Type :? for help.

nix-repl> :l <nixpkgs>
Added 11493 variables.

nix-repl> pkgs.pcsclite.dev.outPath
"/nix/store/j9chaig079f4h1srv4rd4vpfzw73ij9w-pcsclite-1.8.26-dev"

Looks OK, let me see the files in this path:

~> ls -l /nix/store/j9chaig079f4h1srv4rd4vpfzw73ij9w-pcsclite-1.8.26-dev/include/PCSC
total 84
-r--r--r-- 1 root root  4964 Jan  1  1970 debuglog.h
-r--r--r-- 1 root root 30508 Jan  1  1970 ifdhandler.h
-r--r--r-- 1 root root 15634 Jan  1  1970 pcsclite.h
-r--r--r-- 1 root root 15557 Jan  1  1970 reader.h
-r--r--r-- 1 root root  4151 Jan  1  1970 winscard.h
-r--r--r-- 1 root root  3115 Jan  1  1970 wintypes.h

pcsclite.h is here, but build fails because it can’t find while evaluating winscard.h ?

Hey @gurkan,

Did you ever get this fixed? Fighting with this myself :frowning:

This is a bug in the project as described by Florian here:

https://github.com/NixOS/nixpkgs/pull/92965#issuecomment-657137163