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

-no-upgrade broken #6118

Closed
vext01 opened this issue Nov 1, 2019 · 12 comments
Closed

-no-upgrade broken #6118

vext01 opened this issue Nov 1, 2019 · 12 comments
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Comments

@vext01
Copy link

vext01 commented Nov 1, 2019

Today's master on OpenBSD:

$ go run build.go -no-upgrade
...
github.com/oschwald/geoip2-golang
github.com/syncthing/syncthing/lib/relay/client
golang.org/x/time/rate
github.com/AudriusButkevicius/go-nat-pmp
github.com/syncthing/syncthing/lib/nat
github.com/jackpal/gateway
github.com/syncthing/syncthing/lib/upnp
github.com/syncthing/syncthing/lib/pmp
github.com/syncthing/syncthing/lib/signature
github.com/syncthing/syncthing/cmd/stupgrades
# github.com/syncthing/syncthing/cmd/stupgrades
cmd/stupgrades/main.go:24:10: undefined: upgrade.FetchLatestReleases
cmd/stupgrades/main.go:30:12: undefined: upgrade.SortByRelease
exit status 2
exit status 1

If I remove -no-upgrade build works fine.

If we could get a patch, I can update the OpenBSD port.

Cheers!

@calmh
Copy link
Member

calmh commented Nov 1, 2019

Use go run build.go -no-upgrade build or even more explicitly go run build.go -no-upgrade build syncthing to build just the Syncthing binary without upgrades functionality.

The default build.go action with no parameters is to build all binaries, which includes the upgrades server, which cannot build without upgrade code.

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

It seems that after doing:

go run build.go -no-upgrade build
go run build.go -no-upgrade install

There is only syncthing in the bin/ directory. In the port we currently have in the OpenBSD tree, we install a load of other programs too. Is it possible to build those too without have to list the targets?

Basically, I'd like to install everything that doesn't require upgrade support.

Thanks

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

Maybe I'm going about this wrongly. I don't mind building the binaries to do with upgrade servers etc, we just can't have syncthing try to auto-update itself, as that would upset our package tools.

@AudriusButkevicius
Copy link
Member

The idea is that -no-upgrade acts as a directive that excludes some files, those files are required to build upgrade server, so you either build everything with upgrades, or build just syncthing with no-upgrade (as that is where it has the effect)

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

I see.

So perhaps what I need to do is build everything without -no-upgrade, then delete the syncthing binary, then rebuild only that with -no-upgrade?

Out of interest how many of the extra binaries are actually useful to users? We currently package:

@bin bin/stbench
@bin bin/stcli
@bin bin/stcompdirs
@bin bin/stdisco
@bin bin/stdiscosrv
@bin bin/stevents
@bin bin/stfileinfo
@bin bin/stfinddevice
@bin bin/stfindignored
@bin bin/stgenfiles
@bin bin/stindex
@bin bin/strelaypoolsrv
@bin bin/strelaysrv
@bin bin/stsigtool
@bin bin/stvanity
@bin bin/stwatchfile
@bin bin/syncthing
@bin bin/testutil
@bin bin/uraggregate
@bin bin/ursrv

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

To elaborate on that last query, I wonder if it'd be OK to only install the things that have an explicit target in build.go, so that's:

  • syncthing
  • stdiscosrv
  • strelaysrv
  • strelaypoolsrv
  • stcli

Perhaps those are the only bits end users are realistically interested in?

@AudriusButkevicius
Copy link
Member

I think so, upgrade server is quite niche (so is relaypoolsrv), so I don't expect people to run them themselves.

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

OK, thanks. I'll try only building syncthing, stdiscosrv, strelaysrv and stcli via explicit targets

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

Hrm. It seems like the build is non-deterministically failing with a seg fault. Sometimes the build passes and I get binaries, others not.

Here's a couple of examples of different crashes:
https://gist.github.com/vext01/ecfa0ba1759dc01718aefaa309aad5b3

The invocation I'm using in my port makefile looks like this:

ST_CMDS =       syncthing stdiscosrv strelaysrv stcl

do-build:
.for cmd in ${ST_CMDS}
	cd ${WRKSRC} && ${MODGO_CMD} run build.go -version v${V} \
		-no-upgrade install ${cmd}
.endfor

I can try master and see if I get the same... (these crashes are for 1.3.0).

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

Yes, here's a crash on master:
https://gist.github.com/vext01/c6a55fe4e75a5075f51a803e6d6a13e2

This isn't even your code, so I wonder if go is busted on my system...

@calmh
Copy link
Member

calmh commented Nov 2, 2019

Yeah crashes in the compiler are outside of our jurisdiction.

@vext01
Copy link
Author

vext01 commented Nov 2, 2019

Yeah crashes in the compiler are outside of our jurisdiction.

Yeah sorry about the noise. I didn't realise it was the compiler crashing until too late. I'm in discussions with our go packager now.

I'll close this, since I think we've solved the -no-install problem.

Thanks for the help!

@vext01 vext01 closed this as completed Nov 2, 2019
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Nov 2, 2020
@syncthing syncthing locked and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

4 participants