Closed paulquerna-okta closed 4 years ago
i meet the same issue. sw_vers out is:
ProductName: Mac OS X
ProductVersion: 10.15.3
BuildVersion: 19D76
uname -a is:
Darwin Gengs-MBP.geng 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
Is there any solution for this now?
@axetroy no good solution. But as a work-around you can manually copy the missing source/header files to your vendor
folder (in the appropriate directory) and commit them. Note that go mod
will get rid of them the next time it's run, so care must be taken.
The solution is to either add dummy .go
files to the directories so that they will be considered as Go modules or to move them up a directory so they are accompanied by Go files.
@mafredri Thx. if this is a solution. why not send a PR and create an empty go file in the folder.
This issue should have stumped too many people
Weeks or months ago I tried to rename include/smc.{c,h}
to host_darwin.{c,h}
, as in the disk package, didn't commit this work anywhere unfortunately as this was not compiling anymore or (as I better remember it) had build warnings that I didn't understand how to remove.
Will try the empty .go file workaround, to satisfy this (once again) broken go-mod.
Describe the bug
host/include/smc.h
andhost/include/smc.c
. These files are in theinclude
sub-directory. This directory includes no go files, so Go modules does not include them whengo mod vendor
is used. Either the h & c files should be moved into the host directory, or a dummy go file should be added toinclude
To Reproduce Go mod vendor gopsutil, then try to build:
Environment (please complete the following information):
ver
]/etc/os-release
and the result ofuname -a
]sw_vers
anduname -a
freebsd-version -k -r -u
anduname -a
]uname -a
]