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

fatal error: 'include/smc.c' file not found #491

Closed
Knight1 opened this issue Feb 20, 2018 · 4 comments
Closed

fatal error: 'include/smc.c' file not found #491

Knight1 opened this issue Feb 20, 2018 · 4 comments

Comments

@Knight1
Copy link

Knight1 commented Feb 20, 2018

I am getting this error if I try to build my project on my Mac with go build . and govvv build ..
Any Ideas, tips and/or help is appreciated :)

OS: macOS 10.13.3
Go: 1.9.4

Maybe related to
#467
#470
bazel-contrib/rules_go#646

vendor/github.com/shirou/gopsutil/host/host_darwin_cgo.go:7:11: fatal error: 'include/smc.c' file not found
 #include "include/smc.c"
          ^~~~~~~~~~~~~~~
1 error generated.
go tool: exit status 2
@shirou
Copy link
Owner

shirou commented Feb 20, 2018

I had reverted these PRs, so smc.c is included on master. from vendor on your code, I think you are vendoring. Could you check the git hash and make sure smc.c is exists on your vendor directory?

@muratsplat
Copy link

Hello @shirou

I am using dep to manage the dependencies. And dep commant can not add include directory into host directory. Now I can not use gopsutil library by that reason : |

 $dep status
PROJECT                              CONSTRAINT     VERSION        REVISION  LATEST   PKGS USED
github.com/StackExchange/wmi         1.0.0          1.0.0          5d04971   1.0.0    1
github.com/dgrijalva/jwt-go          ^3.2.0         v3.2.0         06ea103   v3.2.0   1
github.com/eclipse/paho.mqtt.golang  ^1.1.1         v1.1.1         36d01c2   v1.1.1   2
github.com/go-ole/go-ole             v1.2.1         v1.2.1         a41e3c4   v1.2.1   2
github.com/joho/godotenv             ^1.2.0         v1.2.0         a79fa1e   v1.2.0   1
github.com/rs/zerolog                ^1.6.0         v1.6.0         05eafee   v1.6.0   3
github.com/shirou/gopsutil           branch master  branch master  63047d7   63047d7  7
github.com/streadway/amqp            branch master  branch master  8e4aba6   8e4aba6  1
golang.org/x/net                     branch master  branch master  d41e817   d41e817  3
golang.org/x/sys                     branch master  branch master  3ccc7e5   3ccc7e5  2
$ ls vendor/github.com/shirou/gopsutil/host
host.go                host_darwin_nocgo.go   host_freebsd_arm.go    host_linux_arm64.go    host_linux_ppc64le.go  host_windows.go
host_darwin.go         host_fallback.go       host_linux.go          host_linux_mips.go     host_linux_s390x.go    types_darwin.go
host_darwin_386.go     host_freebsd.go        host_linux_386.go      host_linux_mips64.go   host_openbsd.go        types_freebsd.go
host_darwin_amd64.go   host_freebsd_386.go    host_linux_amd64.go    host_linux_mips64le.go host_openbsd_amd64.go  types_linux.go
host_darwin_cgo.go     host_freebsd_amd64.go  host_linux_arm.go      host_linux_mipsle.go   host_solaris.go

@Lomanic
Copy link
Collaborator

Lomanic commented Apr 20, 2018

Linked to/duplicate of #437. A workaround for dep is golang/dep#1731 (comment)

I myself don't use dep, maybe we will have to add a Gopkg.toml to prevent the C files to be pruned (note to self: to be tested).

@muratsplat
Copy link

Yeah the problem should be resolved in the scope of golang/dep

Mic92 added a commit to Mic92/nixpkgs that referenced this issue Jul 31, 2020
this is needed on macOS to build gopsutils:

shirou/gopsutil#491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants