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

Add arch buildconstraints on disk for openbsd (fixes #912) #920

Closed
wants to merge 1 commit into from

Conversation

imsodin
Copy link
Contributor

@imsodin imsodin commented Aug 17, 2020

There's definitions for amd64 and 386, but nothing else on openbsd. In the version we used previously the build constraint was openbsd,amd64, now it's just openbsd. I now added build constraints for either amd64 or 386, thus "fixing" the build on arm (no functionality, but also no build failure).

@Lomanic
Copy link
Collaborator

Lomanic commented Aug 17, 2020

👎 from me, there is nothing specific to these two archs in this file.

To fix #912, disk_openbsd_arm.go should be generated with GOOS=openbsd GOARCH=arm go tool cgo -godefs disk/types_openbsd.go > disk/disk_openbsd_arm.go (or preferably directly on an arm host).

@imsodin
Copy link
Contributor Author

imsodin commented Aug 17, 2020

Shouldn't there still be constraints? It uses variables defined in these disk_openbsd_*arch*.go files, thus builds will fail on all archs for which no such file exists. It's much nicer to have no functionality instead of a broken build (at least for Syncthing, which does work without gopsutil).

@Lomanic
Copy link
Collaborator

Lomanic commented Aug 20, 2020

You will still have broken functionality (broken build) if you want to call an undefined function (because of build constraints) though?

I don't have any of the armv7 boards supported by OpenBSD to generate or test everything works, it's plausible that copying the 386 definition for arm would work (cp gopsutil/disk/disk_openbsd_{386,arm}.go).

@imsodin
Copy link
Contributor Author

imsodin commented Aug 20, 2020

That makes sense, I guess I am used to fallback stubs that just return an error when invoked. What doesn't make sense is that with the constraint on the previous gopsutil version we used (+build openbsd,amd64) we did cross-compile and publish releases for lots of arches other than amd64 on openbsd - something's fishy there. But anyway, without fallback constraints are indeed pointless - sorry for the noise and thanks for explaining ;)

@imsodin imsodin closed this Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants