Comments (8)
Quick tip for anyone wondering, it's CGO_ENABLED
. See: https://golang.org/cmd/cgo/.
from gopsutil.
👍
from gopsutil.
I would prefer this removed because as you said it makes cross compiling difficult. Using tools like gox is much harder with this now.
from gopsutil.
@dadgar thank you for the 👎
I have an idea about to use a build tag to easy cross compiling. It means, make two kind of files about darwin.
- cpu_darwin_cross.go
// +build darwin cross
- no CGO, just return NotImplementedError on CPUTimes()
- cpu_darwin.go
// +build darwin !cross
- use CGO
If you want to cross compile (and can accept could not get CPUTimes on darwin), type go build -tags=cross
. Then, cpu_darwin_cross.go
is used for cross-compile.
How do you feel it? Thank you.
from gopsutil.
Yeah I like your thinking. You could probably use the cgo
tag right?
`
from gopsutil.
Ah! cgo
build tag is the right way. Totaly agree.
I made a PR #89. could you check it out?
from gopsutil.
Let user to choose use cgo or not when compile the code is a good idea
from gopsutil.
@Comdex You can change CGO_ENABLE
environment variable.
from gopsutil.
Related Issues (20)
- can't use the "disk" package
- cpu.parseStatLine bug HOT 5
- Process createTime calculation for linux lxc guest is incorrect HOT 4
- Non-root user can't get process information HOT 1
- Report a bare-meteral machine as KVM at host.Info HOT 1
- The host.Info() function is unable to correctly identify CentOS Stream 8. HOT 1
- Missing FQDN/hostname option for windows HOT 2
- stat.Rdev (variable of type uint32) as uint64 HOT 4
- Adopt a hierarchy for getting distro name/version on Linux
- Mac OS Apple M1 get cpu info failed "no such file or directory" HOT 3
- Using the gopsutil package causes the goland debugger to not work properly (random jumps)
- ProcTotal Inaccurate in `MiscStats` HOT 4
- : Optimization Request: Reducing the Number of windows.OpenProcess Calls When Gathering Name, CreateTime, and PPID HOT 1
- docker container monitor host resource and usage
- [invoker] set the `WaitDelay` to avoid getting indefinitely blocking wait() HOT 2
- Calling disk.Partitions(false) produces different list on Linux to "df" HOT 1
- `ExeWithContext` returns an error with a Go binary on newer versions of macOS HOT 6
- Inaccurate readings of cpu.Percent HOT 1
- Allow path to net/dev to not be under HOST_PROC
- Windows interrupt signal errror HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopsutil.