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

Can't build 0.18.0 on OpenBSD #2772

Closed
3 tasks done
catap opened this issue Nov 1, 2024 · 6 comments · Fixed by tonistiigi/fsutil#215
Closed
3 tasks done

Can't build 0.18.0 on OpenBSD #2772

catap opened this issue Nov 1, 2024 · 6 comments · Fixed by tonistiigi/fsutil#215

Comments

@catap
Copy link

catap commented Nov 1, 2024

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Good day,

Seems that I had discovered a regression at v0.18.0: it doesn't build anymore on OpenBSD. v0.17.1 builds fine.

It fails as:

buildx $ go build github.com/docker/buildx/cmd/buildx                
# github.com/tonistiigi/fsutil/copy
vendor/github.com/tonistiigi/fsutil/copy/copy.go:394:20: undefined: copyFile
vendor/github.com/tonistiigi/fsutil/copy/copy.go:414:15: c.copyFileInfo undefined (type *copier has no field or method copyFileInfo)
vendor/github.com/tonistiigi/fsutil/copy/copy.go:422:15: c.copyFileTimestamp undefined (type *copier has no field or method copyFileTimestamp)
vendor/github.com/tonistiigi/fsutil/copy/copy.go:503:16: c.copyFileInfo undefined (type *copier has no field or method copyFileInfo)
vendor/github.com/tonistiigi/fsutil/copy/copy_nowindows.go:45:9: undefined: mknod
vendor/github.com/tonistiigi/fsutil/copy/stat_bsd.go:11:12: st.Atimespec undefined (type *syscall.Stat_t has no field or method Atimespec)
vendor/github.com/tonistiigi/fsutil/copy/stat_bsd.go:16:12: st.Mtimespec undefined (type *syscall.Stat_t has no field or method Mtimespec)
buildx $

I've used git bisect to locate the first commit which had introduced regression, here it is: f89f861

BTW tonistiigi/fsutil@397af53 builds fine on the same machine.

Expected behaviour

It should build

Actual behaviour

It doesn't build

Buildx version

v0.18.0

Docker info

No response

Builders list

irrelevant

Configuration

I use go version go1.23.1 openbsd/amd64 to build both: v0.17.1 and v0.18.0

Build logs

No response

Additional info

No response

@thompson-shaun thompson-shaun added the kind/bug Something isn't working label Nov 1, 2024
This was referenced Nov 1, 2024
@crazy-max
Copy link
Member

crazy-max commented Nov 1, 2024

Thanks for your report!

Yes that looks related to changes in #2745, in particular:

_, err := fs.MkdirAll(d, perm, chown, nil)

I don't think we have openbsd support in fsutil, only freebsd afaik. Not sure if this is just a matter of build tagging or if it needs specific changes for OpenBSD (cc @akhramov).

I gave it a try to build freebsd/amd64 in #2774 and seems to build just fine: https://github.com/docker/buildx/actions/runs/11630178205/job/32388642178?pr=2774#step:6:177

But not with openbsd/amd64 #2775: https://github.com/docker/buildx/actions/runs/11630260136/job/32388838951?pr=2775#step:6:173

Although we don't have the same errors:

#26 [linux/amd64->openbsd/amd64 buildx-build 1/1] RUN --mount=type=bind,target=.   --mount=type=cache,target=/root/.cache   --mount=type=cache,target=/go/pkg/mod   --mount=type=bind,from=buildx-version,source=/buildx-version,target=/buildx-version <<EOT (set -e...)
#26 0.074 + CGO_ENABLED=0 go build -mod vendor -trimpath -ldflags '-X github.com/docker/buildx/version.Version=1583903 -X github.com/docker/buildx/version.Revision=15839039df0ab6d2d900dbbe6e9d7e32ba3cf6a5 -X github.com/docker/buildx/version.Package=github.com/docker/buildx -s -w' -o /usr/bin/docker-buildx ./cmd/buildx
#26 23.26 # github.com/tonistiigi/fsutil
#26 23.26 vendor/github.com/tonistiigi/fsutil/diskwriter.go:126:63: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/filter.go:321:67: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/filter.go:349:69: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/followlinks.go:125:68: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/fs.go:147:75: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/hardlinks.go:35:63: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/hardlinks.go:83:67: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/send.go:161:67: undefined: syscall.EBADMSG
#26 23.26 vendor/github.com/tonistiigi/fsutil/tarwriter.go:29:67: undefined: syscall.EBADMSG
#26 ERROR: process "/bin/sh -c   set -e\n  xx-go --wrap\n  DESTDIR=/usr/bin VERSION=$(cat /buildx-version/version) REVISION=$(cat /buildx-version/revision) GO_EXTRA_LDFLAGS=\"-s -w\" ./hack/build\n  file /usr/bin/docker-buildx\n  xx-verify --static /usr/bin/docker-buildx\n" did not complete successfully: exit code: 1

What's the output of go env btw?

@crazy-max
Copy link
Member

I use go version go1.23.1 openbsd/amd64 to build both: v0.17.1 and v0.18.0

We have not yet updated to Go 1.23:

ARG GO_VERSION=1.22

Did you try with Go 1.22?

@akhramov
Copy link

akhramov commented Nov 1, 2024

Possibly related to: https://go-review.googlesource.com/c/go/+/592795

@catap
Copy link
Author

catap commented Nov 1, 2024

@crazy-max I'm a person who supports docker-cli, docker-compose and docker-buildx inside OpenBSD ports, and it works quite well.

So, it defently had worked before, and I just discovered the regression.

Before @akhramov 's link was commited I needed to patch fsutil to build it, but since go-1.23 no need for that patches.

Thus, 0.17.1 is built fine by go-1.23. Probably I can install it to my host but anyway, ports had upgraded go to 1.23 and it is released as part of 7.6.

catap added a commit to catap/fsutil that referenced this issue Nov 1, 2024
@catap
Copy link
Author

catap commented Nov 1, 2024

Well, after some sleep I'd like to confirm that it isn't buildx error. Indeed it is fsutils.

Here the PR: tonistiigi/fsutil#215

I close this issue as irrelevant.

Sorry for noise!

@catap catap closed this as completed Nov 1, 2024
@catap
Copy link
Author

catap commented Nov 1, 2024

BTW here a PR where I try to solve "too old syscall" in different way: tonistiigi/fsutil#201

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.

5 participants