@@ -32,15 +32,28 @@ Prerequisites
32
32
- The latest stable version of Go. The previous stable version should also
33
33
work; older versions will likely not work. This largely follows Go's
34
34
`Release Policy <https://go.dev/doc/devel/release#policy >`__.
35
+
35
36
- Usually, a C compiler. Syncthing uses SQLite for storing data and the
36
37
most common implementation is written in C.
38
+
39
+ .. note ::
40
+
41
+ Don't skip the C compiler, and make sure to build syncthing with
42
+ ``CGO_ENABLED=1 `` if you are cross compiling. While the build will succeed
43
+ with ``CGO_ENABLED=0 `` and the resulting binary will work, it will run
44
+ with significantly lower performance and higher memory usage when the C
45
+ implementation of SQLite couldn't be used. Your users will not thank you.
46
+
37
47
- Git, unless you're building from a downloaded source tarball that includes
38
48
a ``RELEASE `` marker with the version information.
49
+
39
50
- If you want to build Debian packages FPM is required. See FPM's
40
51
`installation information <https://fpm.readthedocs.io/en/latest/installation.html >`__.
52
+
41
53
- To build Windows executables, installing `goversioninfo
42
54
<https://github.com/josephspurrier/goversioninfo> `__ is recommended
43
55
in order to add file properties and icon to the compiled binaries.
56
+
44
57
- Building Android binaries requires `Android NDK <https://developer.android.com/ndk >`__.
45
58
46
59
If you're not already a Go developer, the easiest way to get going
@@ -142,6 +155,14 @@ influence ``build``, ``tar`` and ``zip``. Examples:
142
155
Builds a zip distribution of Syncthing for Windows (current architecture) with
143
156
upgrading disabled.
144
157
158
+ .. note ::
159
+
160
+ Cross compiling with C (``CGO_ENABLED=1 ``) can be non-trivial; nonetheless
161
+ you should try to do so when at all possible. We use Zig to ease the pain;
162
+ you can check our `build workflows
163
+ <https://github.com/syncthing/syncthing/blob/main/.github/workflows/build-syncthing.yaml> `__
164
+ for inspiration.
165
+
145
166
.. _versiontagging :
146
167
147
168
Version Tagging
0 commit comments