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

Fix build with bazel on OSX #467

Merged
merged 1 commit into from
Dec 9, 2017

Conversation

tanyatik
Copy link

@tanyatik tanyatik commented Dec 8, 2017

Following guide here:

bazel-contrib/rules_go#646 (comment)

Checked local build and seems to work.

@shirou
Copy link
Owner

shirou commented Dec 9, 2017

Since I have not MacOSX now, I can't confirm. But it should work. Thank you for your contribution!

@shirou shirou merged commit ab3d3b7 into shirou:master Dec 9, 2017
@shirou
Copy link
Owner

shirou commented Dec 9, 2017

Sorry, This PR is reverted due to build error on linux. https://circleci.com/gh/shirou/gopsutil/357

go get -t -d -v ./...
can't load package: package github.com/shirou/gopsutil/host: C source files not allowed when not using cgo or SWIG: smc.c
package github.com/shirou/gopsutil/host: C source files not allowed when not using cgo or SWIG: smc.c

@tanyatik
Copy link
Author

tanyatik commented Dec 14, 2017

I created a new PR that should pass build on linux.
Added an empty file host_cgo.go , so that cgo is always used.

I also tried to build smc.c and smc.h into a library as suggested here bazel-contrib/rules_go#646 (comment) but it requires changes in BUILD.bazel which cannot be generated by gazelle.
This is quite hacky, so let me know if you have better idea on how to fix it.

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

Successfully merging this pull request may close these issues.

2 participants