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

Syncthing failed to build under GO1.18!!! #18267

Closed
zxlhhyccc opened this issue Apr 7, 2022 · 14 comments · Fixed by #18282
Closed

Syncthing failed to build under GO1.18!!! #18267

zxlhhyccc opened this issue Apr 7, 2022 · 14 comments · Fixed by #18282

Comments

@zxlhhyccc
Copy link

image

github.com/syncthing/syncthing/lib/stats
github.com/syncthing/syncthing/lib/weakhash
# github.com/lucas-clemente/quic-go/internal/qtls
../../vendor/github.com/lucas-clemente/quic-go/internal/qtls/go118.go:5:13: cannot use "quic-go doesn't build on Go 1.18 yet." (untyped string constant) as int value in variable declaration
github.com/syncthing/syncthing/lib/tlsutil
golang.org/x/crypto/blowfish
golang.org/x/text/runes
golang.org/x/crypto/bcrypt
@jefferyto
Copy link
Member

Ping @aparcar.

(Please use the default issue template and at-mention the relevant maintainer(s).)

@jamesmacwhite
Copy link
Contributor

jamesmacwhite commented Apr 7, 2022

Several Go packages were broken when Go 1.18 was updated on master/snapshot.

quic-go does support Go 1.18, but it's likely the version that syncthing is including is an older version that doesn't support it. Same issue occurred with AdGuardHome and others.

The easiest solution is seeing if SyncThing have bumped the dependency in their code and released a new version since, which it should be straight forward to bump the package version in OpenWrt, if not, a patch will be needed to bump the go.mod/go.sum file before compiling. That's been my experience anyway.

@zxlhhyccc
Copy link
Author

Several Go packages were broken when Go 1.18 was updated on master/snapshot.

quic-go does support Go 1.18, but it's likely the version that syncthing is including is an older version that doesn't support it. Same issue occurred with AdGuardHome and others.

The easiest solution is seeing if SyncThing have bumped the dependency in their code and released a new version since, which it should be straight forward to bump the package version in OpenWrt, if not, a patch will be needed to bump the go.mod/go.sum file before compiling. That's been my experience anyway.

My level is limited, make patches for a few days can not solve!

@jamesmacwhite
Copy link
Contributor

I tried building 1.19.2 and it still failed so I'd suggest it's a potential upstream problem. I can see you opened an issue on the upstream repo but they closed it. I added some details to the issue for context.

@aparcar
Copy link
Member

aparcar commented Apr 7, 2022

Maybe the suncthing version is simply to old and I should upgrade it?

@jamesmacwhite
Copy link
Contributor

I tried compiling the latest release earlier and it failed still on go 1.18 errors. Reported upstream for further comments.

@cotequeiroz
Copy link
Member

I'm noob with go. If I remove the vendor directory, then 1.19.2 builds. I don't even know what's the purpose of vendor/, but I noticed that the git repo does not carry it, so I imagine it is generated for the releases.

@jamesmacwhite
Copy link
Contributor

@cotequeiroz That's an interesting find!

This seems to have been discovered by others as well: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262808#c6

@cotequeiroz
Copy link
Member

Try cotequeiroz@e9f217d.

@jamesmacwhite
Copy link
Contributor

jamesmacwhite commented Apr 7, 2022

@cotequeiroz Yep, removing the vendor folder resolves the latest errors on 1.19.2, nice work, seems like a suitable fix. Looking at the FreeBSD conversation that seemed to be the conclusion as well, so this patch seems suitable.

@cotequeiroz
Copy link
Member

@jefferyto, what do you think about this?
If we are indeed going to remove vendor/ as a hack, I would hardcode the version number, to 👊 encourage a review; something like:

# When bumping versions, try to remove this Build/Prepare definition, to check if it is still needed
define Build/Prepare
	$(call Build/Prepare/Default)
	cd $(BUILD_DIR)/$(PKG_NAME)-1.19.2/$(PKG_NAME) && rm -rf vendor
endef

@jamesmacwhite
Copy link
Contributor

It's been flagged upstream for further review in the meantime: syncthing/syncthing#8258 (comment)

@aparcar
Copy link
Member

aparcar commented Apr 7, 2022

Anyone interested to take over the maintainership of synching?

@zxlhhyccc
Copy link
Author

zxlhhyccc commented Apr 9, 2022

Anyone interested to take over the maintainership of synching?

The problem has been resolved and the source code has been compiled using vebdor under GO1.18. The existing patches are compiled using their own go.mod。Version number: 1.19.2.
patch:
patch.tar.gz

jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue Apr 10, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes openwrt#18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
aparcar pushed a commit that referenced this issue Apr 10, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes #18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Beginner-Go pushed a commit to coolsnowwolf/packages that referenced this issue Apr 10, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes openwrt/packages#18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
jamesmacwhite pushed a commit to jamesmacwhite/openwrt-packages that referenced this issue Apr 16, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes openwrt#18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 4b7ff2d)
aparcar pushed a commit that referenced this issue Apr 16, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes #18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 4b7ff2d)
1715173329 pushed a commit to immortalwrt/packages that referenced this issue May 7, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes openwrt/packages#18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 4b7ff2d)
BKPepe pushed a commit that referenced this issue Nov 10, 2022
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes #18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 4b7ff2d)
(cherry picked from commit 961c73c)
SibrenVasse pushed a commit to SibrenVasse/packages that referenced this issue Feb 26, 2023
Includes patch based on upstream change[1] to fix compilation with Go
1.18.

Fixes openwrt#18267.

[1]: syncthing/syncthing@e30898d

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 4b7ff2d)
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 a pull request may close this issue.

5 participants