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

FreeBSD build failing #853

Closed
tmm1 opened this issue Mar 19, 2020 · 8 comments
Closed

FreeBSD build failing #853

tmm1 opened this issue Mar 19, 2020 · 8 comments

Comments

@tmm1
Copy link
Contributor

tmm1 commented Mar 19, 2020

[freebsd-x86_64] ../gopath/pkg/mod/github.com/shirou/[email protected]+incompatible/disk/disk_freebsd.go:87:51: cannot use stat.Mntfromname[:] (type []byte) as type []int8 in argument to common.IntToString
[freebsd-x86_64] ../gopath/pkg/mod/github.com/shirou/[email protected]+incompatible/disk/disk_freebsd.go:88:49: cannot use stat.Mntonname[:] (type []byte) as type []int8 in argument to common.IntToString
[freebsd-x86_64] ../gopath/pkg/mod/github.com/shirou/[email protected]+incompatible/disk/disk_freebsd.go:89:50: cannot use stat.Fstypename[:] (type []byte) as type []int8 in argument to common.IntToString
[freebsd-x86_64] ../gopath/pkg/mod/github.com/shirou/[email protected]+incompatible/disk/disk_freebsd.go:173:43: cannot use stat.Fstypename[:] (type []byte) as type []int8 in argument to common.IntToString

This just started out of nowhere. Not sure what changed. I think I upgraded x/sys

@tmm1
Copy link
Contributor Author

tmm1 commented Mar 19, 2020

Looks like there were some changes in x/sys/unix for freebsd in the last few days: golang/sys@5766fd3#diff-2b37904226feaa1ac0c049523015d0bcL126-R128

tmm1 referenced this issue in golang/sys Mar 19, 2020
I just created a couple of virtual machines/QEMU instances containing
stock copies of FreeBSD 12.1-RELEASE. On these systems I ran mkall.sh,
thereby bringing the definitions in sync with that version of FreeBSD.

I also attempted to bring the GOOS=freebsd GOARCH=arm port up to date,
but was unfortunately not able to do so. There doesn't seem to be any
documentation on how to bring this port of FreeBSD up on an emulator.
The only option seems to be to use physical hardware.

Change-Id: I54c9f5d15587996ad5fbb535480ab0aa0e723260
GitHub-Last-Rev: ad79b1b
GitHub-Pull-Request: #63
Reviewed-on: https://go-review.googlesource.com/c/sys/+/223698
Run-TryBot: Tobias Klauser <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Tobias Klauser <[email protected]>
@ianlancetaylor
Copy link

Please open an issue at https://golang.org/issue or discuss at https://golang.org/cl/223698. Thanks.

@hanshasselberg
Copy link

We just ran into this. It is not fixed in sys just yet. It could be fixed in gopsutil by casting, would you accept a PR for that?

@shirou
Copy link
Owner

shirou commented May 5, 2020

Thanks. PR is always welcome!

@xxxserxxx
Copy link

@ncabatoff, @samsalisbury, @shirou, and @Lomanic: pinning x/sys to v0.0.0-20200316230553-a7d97aace0b0 also works. Specifically, Hashicorp, it lets you use the current version of gopsutil: you don't have to pin to a 2-y/o version.

For anyone finding this, in your project:

go get golang.org/x/sys@a7d97aace0b0

this should update your go.mod and allow you to build on FreeBSD.

xxxserxxx added a commit to xxxserxxx/gotop that referenced this issue May 31, 2020
@Lomanic
Copy link
Collaborator

Lomanic commented May 31, 2020

You're exactly right @xxxserxxx, I tested this OK on FreeBSD 12, this is the last commit before x/sys breaking change, I'm preparing a PR to pin this with dep.

Lomanic added a commit to Lomanic/gopsutil that referenced this issue May 31, 2020
Lomanic added a commit to Lomanic/gopsutil that referenced this issue May 31, 2020
samsalisbury added a commit to hashicorp/vault that referenced this issue Jun 1, 2020
- This fixes the FreeBSD build.
- For context, see shirou/gopsutil#853 (comment)
Lomanic added a commit that referenced this issue Jun 6, 2020
[disk][freebsd] Work around #853, pin x/sys with dep to the hash just before upstream breaking change
dnephin added a commit to hashicorp/consul that referenced this issue Jun 9, 2020
Partially extracted from #7547

Updates protobuf to the most recent in the 1.3.x series, and updates
golang.org/x/sys to a7d97aace0b0 because of shirou/gopsutil#853
prevents updating to a more recent version.

This breaking change in x/sys also prevents us from getting a newer
version of x/net. In the future, if gopsutil is not patched,  we may want to run a fork version of
gopsutil so that we can update both x/net and x/sys.
tklauser added a commit to tklauser/gopsutil that referenced this issue Jun 22, 2020
There was a breaking change in upstream golang.org/x/sys/unix which
changed the type of some Statvfs members, see shirou#853. As it looks like
this change won't be reverted, adjust gopsutil to work with it and allow
to build against the latest version of x/sys/unix.
@tklauser
Copy link
Contributor

FWIW, I've sent #895 which would allow building against golang.org/x/sys@latest on FreeBSD again.

tklauser added a commit to tklauser/gopsutil that referenced this issue Jun 22, 2020
There was a breaking change in upstream golang.org/x/sys/unix which
changed the type of some Statvfs members, see shirou#853. As it looks like
this change won't be reverted, adjust gopsutil to work with it and allow
to build against the latest version of x/sys/unix.
@shirou
Copy link
Owner

shirou commented Jun 30, 2020

#895 has been merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants