You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go upgrades me to fsutil v0.0.0-20220115021204-b19f7f9cb274. When I run engine.Start while on this version of fsutil, dagger says:
go run ci/main.go test
# github.com/moby/buildkit/session/filesync
../../../../go/1.19.1/pkg/mod/github.com/moby/[email protected]/session/filesync/filesync.go:112:20: cannot use dir.Map (variable of type func(string, *types.Stat) bool) as type fsutil.MapFunc in struct literal
When I rollback fsutil:
go get github.com/tonistiigi/fsutil@b19f7f9cb274
go: downgraded github.com/tonistiigi/fsutil v0.0.0-20220930225714-4638ad635be5 => v0.0.0-20220115021204-b19f7f9cb274
I have no idea if that's related, it didn't change the version, will poke a bit more though
If that leads nowhere I'll think about what options we can give users in the mean time while this issue is sorted out. We can ask them to downgrade fsutil of course, but that's far from ideal, so I'll see if there's anything else
Confirmed almost identical error message on go version go1.19 darwin/arm64 and go version go1.18.2 darwin/arm64
# github.com/moby/buildkit/session/filesync
../../../../../go/pkg/mod/github.com/moby/[email protected]/session/filesync/filesync.go:112:20: cannot use dir.Map (variable of type func(string, *types.Stat) bool) as type fsutil.MapFunc in struct literal
@kpenfound I think the solution to this will be to just not include -u when running go get. After poking around more I think that's more meant for when you as a maintainer are trying to actually update everything (including transitive) deps to the latest version (and accepting any problems that may cause). Normal use of just adding a dependency should not include it.
If I start from an empty go mod and run these commands (with code that imports the api in my dir):
go get go.dagger.io/dagger@d988bac // no -ugo mod edit -replace=github.com/docker/docker=github.com/docker/[email protected]+incompatiblego mod tidy
Then it all works for me.
The problem in general will be fixed when we upgrade to a new buildkit release (their master branch already has been updated for the incompatible change in fsutil).
Above fix works for me. Sounds like once we have the new buildkit release (wonder when they'll cut a release?) and we release our go SDK, will be just:
go mod init <your module>
go get go.dagger.io/dagger
go mod tidy
Above fix works for me. Sounds like once we have the new buildkit release (wonder when they'll cut a release?) and we release our go SDK, will be just:
Well we'll still need the go mod edit command unless something changes. That's a different problem from the one in this issue (has existed for a long time).
Thanks @thaJeztah ! Actually, while you're here, do you know if there's any hope for the replace of github.com/docker/docker to be removed from buildkit's go.mod in the future?
Either way @jpadams@kpenfound looks like the fsutil incompatibility will be backported to a v0.10 release. However, I would still in general recommend we don't tell users to use -u just because other similar problems could crop up in the future.
I think for the replace to be gone, we'd need moby/buildkit#3173 as well (but go modules may still reject the version)
Currently it looks like neither of those patches will be accepted by the BuildKit maintainers, so if you depend on both BuildKit and Docker, then it's quite possibly things won't work out 😔
@thaJeztah I see, thanks for the info! It's sad but also just one of those things where the go tooling should really have a better solution (but I'm sure it's complicated and all that).
@shykes feels like this would be a good place for a sugary cli command like:
dagger project init foo --sdk go
that would perform
go mod init foo
go get go.dagger.io/dagger@<version if needed>
go mod edit -replace=github.com/docker/docker=github.com/docker/[email protected]+incompatible
go mod tidy
@jpadamsproject init is only needed when writing extensions, but agree that as long as we are careful with user's config files (go.mod, package.json, etc.) that would be great to have. Can have a --sugar-free flag for when they don't want it too maybe.
I could have sworn we had an issue about project init templates (which is kind of similar-ish) but can't find it, so I made a new one here: #3368
Activity
sipsma commentedon Oct 13, 2022
Can reproduce this and the error makes sense in that there was indeed an incompatible change here: https://github.com/tonistiigi/fsutil/blame/4638ad635be52e38af6b57952a7a5d3f938704a7/walker.go#L25
What makes less sense to me is that the change in question happened 5 months ago, so I don't really get why this would not have appeared earlier.
dagger's dep on fsutil got moved from //indirect to direct by my recent change (though I did not do that by hand, it must have happened automatically): https://github.com/dagger/dagger/blame/cloak/go.mod#L25
If that leads nowhere I'll think about what options we can give users in the mean time while this issue is sorted out. We can ask them to downgrade
fsutilof course, but that's far from ideal, so I'll see if there's anything elsejpadams commentedon Oct 13, 2022
Confirmed almost identical error message on
go version go1.19 darwin/arm64andgo version go1.18.2 darwin/arm64sipsma commentedon Oct 13, 2022
@kpenfound I think the solution to this will be to just not include
-uwhen running go get. After poking around more I think that's more meant for when you as a maintainer are trying to actually update everything (including transitive) deps to the latest version (and accepting any problems that may cause). Normal use of just adding a dependency should not include it.If I start from an empty go mod and run these commands (with code that imports the api in my dir):
Then it all works for me.
The problem in general will be fixed when we upgrade to a new buildkit release (their master branch already has been updated for the incompatible change in fsutil).
Let me know if that works for you too.
jpadams commentedon Oct 13, 2022
Above fix works for me. Sounds like once we have the new buildkit release (wonder when they'll cut a release?) and we release our go SDK, will be just:
right?
sipsma commentedon Oct 14, 2022
Well we'll still need the
go mod editcommand unless something changes. That's a different problem from the one in this issue (has existed for a long time).buildkitmaster branch still has the replace, so that means we'll still need it too whenever there's a next release.But yeah once we merge into main I don't think we'll need the
@<commit>anymore at least.thaJeztah commentedon Oct 14, 2022
Relates to moby/buildkit#3144
tonistiigi/fsutil#130 (comment)
sipsma commentedon Oct 14, 2022
Thanks @thaJeztah ! Actually, while you're here, do you know if there's any hope for the replace of
github.com/docker/dockerto be removed from buildkit's go.mod in the future?Either way @jpadams @kpenfound looks like the fsutil incompatibility will be backported to a v0.10 release. However, I would still in general recommend we don't tell users to use
-ujust because other similar problems could crop up in the future.thaJeztah commentedon Oct 14, 2022
I think for the replace to be gone, we'd need moby/buildkit#3173 as well (but go modules may still reject the version)
Currently it looks like neither of those patches will be accepted by the BuildKit maintainers, so if you depend on both BuildKit and Docker, then it's quite possibly things won't work out 😔
sipsma commentedon Oct 14, 2022
@thaJeztah I see, thanks for the info! It's sad but also just one of those things where the go tooling should really have a better solution (but I'm sure it's complicated and all that).
jpadams commentedon Oct 14, 2022
@shykes feels like this would be a good place for a sugary cli command like:
that would perform
sipsma commentedon Oct 14, 2022
@jpadams
project initis only needed when writing extensions, but agree that as long as we are careful with user's config files (go.mod, package.json, etc.) that would be great to have. Can have a--sugar-freeflag for when they don't want it too maybe.I could have sworn we had an issue about project init templates (which is kind of similar-ish) but can't find it, so I made a new one here: #3368
kpenfound commentedon Oct 14, 2022
Confirmed that ditching the
-uis what I needed, thanks @sipsma