Skip to content

macOS: Unable to build using Go Modules #832

@paulquerna-okta

Description

@paulquerna-okta

Describe the bug

  • Restored temperature info for macOS #800
  • This PR added host/include/smc.h and host/include/smc.c. These files are in the include sub-directory. This directory includes no go files, so Go modules does not include them when go mod vendor is used. Either the h & c files should be moved into the host directory, or a dummy go file should be added to include

To Reproduce
Go mod vendor gopsutil, then try to build:

# github.com/shirou/gopsutil/host
vendor/github.com/shirou/gopsutil/host/host_darwin_cgo.go:9:11: fatal error: 'include/smc.c' file not found
 #include "include/smc.c"
          ^~~~~~~~~~~~~~~
1 error generated.

Environment (please complete the following information):

  • Windows: [paste the result of ver]
  • Linux: [paste contents of /etc/os-release and the result of uname -a]
  • Mac OS: [paste the result of sw_vers and uname -a
  • FreeBSD: [paste the result of freebsd-version -k -r -u and uname -a]
  • OpenBSD: [paste the result of uname -a]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions