2020-12-08 19:09 阅读 0

macOS: Build error `undefined: syscall.Sysinfo_t` since lang feature


  • mgmt version (eg: mgmt --version): N/A

  • operating system/distribution (eg: uname -a): Darwin Firefly.local 16.7.0 Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64 x86_64

  • golang version (eg: go version): go version go1.9.3 darwin/amd64


I don't know if macOS is currently supported for lang but on the latest master (eb33a5a5df614d06d5f409106c767d32f5c37937) I get this during build:

~/.g/s/g/p/mgmt (master|✔) $ env GOTAGS='noaugeas novirt' make build
Generating: bindata...
Generating: lang...
/Applications/Xcode.app/Contents/Developer/usr/bin/make --quiet -C lang
Building: mgmt, version: 0.0.14-6-geb33a5a...
time go build -i -ldflags "-X main.program=mgmt -X main.version=0.0.14-6-geb33a5a" -o mgmt -tags 'noaugeas novirt';
# github.com/purpleidea/mgmt/lang/funcs/facts/core
lang/funcs/facts/core/loadfact.go:123:14: undefined: syscall.Sysinfo_t
lang/funcs/facts/core/loadfact.go:124:11: undefined: syscall.Sysinfo

real    0m2.755s
user    0m5.688s
sys 0m0.858s
make: *** [mgmt] Error 2

Building an older version (1c8c0b2915416bd64f256e0aabf29918605787b8) does seem to work:

~/.g/s/g/p/mgmt ((1c8c0b29…)|✚1…3) $ env GOTAGS='noaugeas novirt' make build
Building: mgmt, version: 0.0.14-3-g1c8c0b2-dirty...
time go build -i -ldflags "-X main.program=mgmt -X main.version=0.0.14-3-g1c8c0b2-dirty" -o mgmt -tags 'noaugeas novirt';

real    0m11.443s
user    0m8.653s
sys 0m5.068s


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • weixin_39837207 weixin_39837207 2020-12-08 19:09

    Re your question, please see: https://github.com/purpleidea/mgmt/blob/master/docs/faq.md#does-this-support-windows-osx-gnu-hurd

    Happy to merge your patch, discussion in PR...

    点赞 评论 复制链接分享
  • weixin_39999190 weixin_39999190 2020-12-08 19:09

    Cool, I agree macOS (it's no longer called OSX ;)) is not a high prio as probably no-one will use it for what mgmt is intended for (although I already see myself managing my laptop with mgmt). But I think it's nice to be able to develop on the tool with as little in between as possible (eg: vagrant/docker). So as long as it's relevant to me I'll keep it as my task to support this.

    点赞 评论 复制链接分享
  • weixin_39837207 weixin_39837207 2020-12-08 19:09

    Hrm, so AFAICT, this is now fixed :) Should we close?

    点赞 评论 复制链接分享
  • weixin_39999190 weixin_39999190 2020-12-08 19:09

    Sure thing

    点赞 评论 复制链接分享