Skip to content

Commit 724512c

Browse files
orblivionacolomb
andauthored
chore(dev): warn from-source builders that syncthing auto-upgrades (#882)
Some people may prefer to build from source for their own use. They should be aware that the default behavior is to overwrite the binary with a new downloaded binary when an upgrade is available. Co-authored-by: André Colomb <[email protected]>
1 parent 2d8ccd8 commit 724512c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

dev/building.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ Building Syncthing
99
of it. For all other purposes we recommend using the official binary
1010
releases instead.
1111

12+
If you still prefer to build Syncthing from source for your own use, be
13+
aware that there is a built-in automatic upgrade mechanism that will
14+
overwrite your built binary with a downloaded version. To avoid this, you
15+
can use the ``--no-upgrade`` build flag (see below), but you will be
16+
responsible for your own upgrades.
17+
1218
Branches and Tags
1319
-----------------
1420

@@ -103,7 +109,7 @@ The following ``build.go`` subcommands and options exist.
103109
``go run build.go build``
104110
Builds just the named target, or ``syncthing`` by default, to the current
105111
directory. Use this when cross compiling, with parameters for what to cross
106-
compile to: ``go run build.go -goos linux -goarch 386 build``.
112+
compile to: ``go run build.go --goos linux --goarch 386 build``.
107113

108114
``go run build.go test``
109115
Runs the tests.
@@ -120,13 +126,13 @@ The following ``build.go`` subcommands and options exist.
120126
Creates a Syncthing zip dist file in the current directory. Assumes a
121127
Windows build.
122128

123-
The options ``-no-upgrade``, ``-goos`` and ``-goarch`` can be given to
129+
The options ``--no-upgrade``, ``--goos`` and ``--goarch`` can be given to
124130
influence ``build``, ``tar`` and ``zip``. Examples:
125131

126-
``go run build.go -goos linux -goarch 386 tar``
132+
``go run build.go --goos linux --goarch 386 tar``
127133
Builds a tar.gz distribution of Syncthing for linux-386.
128134

129-
``go run build.go -goos windows -no-upgrade zip``
135+
``go run build.go --goos windows --no-upgrade zip``
130136
Builds a zip distribution of Syncthing for Windows (current architecture) with
131137
upgrading disabled.
132138

@@ -155,12 +161,12 @@ If the tarball is from our build server it contains a file called
155161
``RELEASE`` that informs the build system of the version being
156162
built. If you're building from a different source package, for example
157163
one automatically generated by GitHub, you must instead pass the
158-
``-version`` flag to ``build.go``.
164+
``--version`` flag to ``build.go``.
159165

160166
If you are building something that will be installed as a package
161-
(Debian, RPM, ...) you almost certainly want to use ``-no-upgrade`` as
167+
(Debian, RPM, ...) you almost certainly want to use ``--no-upgrade`` as
162168
well to prevent the built in upgrade system from being activated.
163169

164-
``go run build.go -version v0.10.26 -no-upgrade tar``
170+
``go run build.go --version v0.10.26 --no-upgrade tar``
165171
Builds a tar.gz distribution of Syncthing for the current OS/arch, tagged as
166172
``v0.10.26``, with upgrades disabled.

0 commit comments

Comments
 (0)