From 33bd6bfc3180c1c5346785991879b598d1209c51 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Feb 13 2018 11:08:37 +0000 Subject: update to version 0.14.44 This build also includes a completely refreshed set of BuildRequires and Requires (since upstream likes to change what they depend on a lot). The patches to the upstream build script were rebased (again). The plan is to drop those patches and to inject upstream's custom build flags/tags directly in the .spec file in the future, and to only use the upstream build script to generate the resource files, not to build the binaries. I had to disable the "NoSync" feature in the rewritten "stdiscosrv" database backend, because the goleveldb package in fedora is too old to support it - this probably leads to worse performance there. I also re-enabled checks on some tests that were previously failing randomly. If they re-surface at some point in the future, I'll ignore them again. --- diff --git a/.gitignore b/.gitignore index 5ea46a1..8f3850f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /syncthing-source-v0.14.41.tar.gz /syncthing-source-v0.14.42.tar.gz /syncthing-source-v0.14.43.tar.gz +/syncthing-source-v0.14.44.tar.gz diff --git a/00-go-build-flags-ppc64.patch b/00-go-build-flags-ppc64.patch index 7177de3..c1457d7 100644 --- a/00-go-build-flags-ppc64.patch +++ b/00-go-build-flags-ppc64.patch @@ -1,26 +1,25 @@ diff --git a/build.go b/build.go -index 3744feb..7a4494a 100644 +index 7d400d6..d0b246f 100644 --- a/build.go +++ b/build.go -@@ -443,9 +443,16 @@ func build(target target, tags []string) { +@@ -434,10 +434,15 @@ func build(target target, tags []string) { lazyRebuildAssets() tags = append(target.tags, tags...) + tags = append(tags, "rpm_crashtraceback") rmr(target.BinaryName()) -- args := []string{"build", "-i", "-v", "-ldflags", ldflags()} -+ + +- args := []string{"build", "-i", "-v"} + build_id, _ := ioutil.ReadFile("build_id") -+ ldflags := fmt.Sprintf("%s %s -B 0x%s -extldflags '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'", ++ fedora_ldflags := fmt.Sprintf("%s %s -B 0x%s -extldflags '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'", + ldflags(), os.Getenv("LDFLAGS"), build_id) + -+ args := []string{"build", "-compiler", "gc", "-ldflags", ldflags, "-a", "-v", "-x"} -+ - if pkgdir != "" { - args = append(args, "-pkgdir", pkgdir) - } -@@ -724,11 +731,10 @@ func ldflags() string { ++ args := []string{"build", "-compiler", "gc", "-ldflags", fedora_ldflags, "-a", "-v", "-x"} + args = appendParameters(args, tags, target) + + os.Setenv("GOOS", goos) +@@ -736,11 +741,10 @@ func ldflags() string { } b := new(bytes.Buffer) diff --git a/00-go-build-flags.patch b/00-go-build-flags.patch index f69d1aa..22c59e3 100644 --- a/00-go-build-flags.patch +++ b/00-go-build-flags.patch @@ -1,26 +1,25 @@ diff --git a/build.go b/build.go -index 3744feb..7a4494a 100644 +index 7d400d6..76bb340 100644 --- a/build.go +++ b/build.go -@@ -443,9 +443,16 @@ func build(target target, tags []string) { +@@ -434,10 +434,15 @@ func build(target target, tags []string) { lazyRebuildAssets() tags = append(target.tags, tags...) + tags = append(tags, "rpm_crashtraceback") rmr(target.BinaryName()) -- args := []string{"build", "-i", "-v", "-ldflags", ldflags()} -+ + +- args := []string{"build", "-i", "-v"} + build_id, _ := ioutil.ReadFile("build_id") -+ ldflags := fmt.Sprintf("%s %s -B 0x%s -extldflags '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'", ++ fedora_ldflags := fmt.Sprintf("%s %s -B 0x%s -extldflags '-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'", + ldflags(), os.Getenv("LDFLAGS"), build_id) + -+ args := []string{"build", "-buildmode", "pie", "-compiler", "gc", "-ldflags", ldflags, "-a", "-v", "-x"} -+ - if pkgdir != "" { - args = append(args, "-pkgdir", pkgdir) - } -@@ -724,11 +731,10 @@ func ldflags() string { ++ args := []string{"build", "-buildmode", "pie", "-compiler", "gc", "-ldflags", fedora_ldflags, "-a", "-v", "-x"} + args = appendParameters(args, tags, target) + + os.Setenv("GOOS", goos) +@@ -736,11 +741,10 @@ func ldflags() string { } b := new(bytes.Buffer) diff --git a/02-leveldb-nonosync.patch b/02-leveldb-nonosync.patch new file mode 100644 index 0000000..f474e8d --- /dev/null +++ b/02-leveldb-nonosync.patch @@ -0,0 +1,13 @@ +diff --git a/cmd/stdiscosrv/main.go b/cmd/stdiscosrv/main.go +index b74fcee..346b81b 100644 +--- a/cmd/stdiscosrv/main.go ++++ b/cmd/stdiscosrv/main.go +@@ -61,7 +61,7 @@ const ( + // the expense of some memory usage and risk of losing writes in a (system) + // crash. + var levelDBOptions = &opt.Options{ +- NoSync: true, ++// NoSync: true, + WriteBuffer: 32 << 20, // default 4<<20 + } + diff --git a/sources b/sources index e283a64..801963c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (syncthing-source-v0.14.43.tar.gz) = f2c8b0ca5971cd2fbbcba193917ba73c0d7932937a8c18821348a6bfe6a4df854284336694591dba4aba0b8eeb16452dc5887535035c81a8c66c85bd711f16db +SHA512 (syncthing-source-v0.14.44.tar.gz) = 89d4660c043cf60bdb53cd6e38992e72808b302766c3c7e57b882ac4fe608bf4bb02117a9e16031627a8d5b75b2f8cbe90d9336532d16cd7f85be52f4cea4e13 diff --git a/syncthing.spec b/syncthing.spec index 8d30fd5..75af5fb 100644 --- a/syncthing.spec +++ b/syncthing.spec @@ -27,16 +27,16 @@ # https://github.com/syncthing/syncthing %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} -%global commit a9f0659f2f4bf910f82b652fd27a864074ec7ab8 +%global commit 27d5b17096847d16d01421c30151969adda36628 %global shortcommit %(c=%{commit}; echo ${c:0:7}) -# commit a9f0659f2f4bf910f82b652fd27a864074ec7ab8 == version 0.14.43 +# commit 27d5b17096847d16d01421c30151969adda36628 == version 0.14.44 Name: syncthing Summary: Continuous File Synchronization -Version: 0.14.43 -Release: 2%{?dist} +Version: 0.14.44 +Release: 1%{?dist} # syncthing (MPLv2.0) bundles angular (MIT), bootstrap (MIT), and font-awesome (MIT/OFL) License: MPLv2.0 and MIT and OFL @@ -49,6 +49,9 @@ Source0: https://github.com/%{name}/%{name}/releases/download/v%{version} Patch0: 00-go-build-flags.patch Patch1: 00-go-build-flags-ppc64.patch +# goleveldb in fedora is too old to have the nosync option, so disable it +Patch2: 02-leveldb-nonosync.patch + # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. @@ -72,6 +75,7 @@ BuildRequires: golang(github.com/jackpal/gateway) BuildRequires: golang(github.com/kardianos/osext) BuildRequires: golang(github.com/kballard/go-shellquote) BuildRequires: golang(github.com/minio/sha256-simd) +BuildRequires: golang(github.com/pkg/errors) BuildRequires: golang(github.com/rcrowley/go-metrics) BuildRequires: golang(github.com/sasha-s/go-deadlock) BuildRequires: golang(github.com/syndtr/goleveldb/leveldb) @@ -85,6 +89,7 @@ BuildRequires: golang(github.com/vitrun/qart) BuildRequires: golang(github.com/xtaci/kcp-go) BuildRequires: golang(github.com/xtaci/smux) BuildRequires: golang(github.com/zillode/notify) +BuildRequires: golang(golang.org/x/crypto/bcrypt) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/net/ipv4) BuildRequires: golang(golang.org/x/net/ipv6) @@ -138,6 +143,7 @@ Requires: golang(github.com/jackpal/gateway) Requires: golang(github.com/kardianos/osext) Requires: golang(github.com/kballard/go-shellquote) Requires: golang(github.com/minio/sha256-simd) +Requires: golang(github.com/pkg/errors) Requires: golang(github.com/rcrowley/go-metrics) Requires: golang(github.com/sasha-s/go-deadlock) Requires: golang(github.com/syndtr/goleveldb/leveldb) @@ -158,6 +164,19 @@ Requires: golang(golang.org/x/net/proxy) Requires: golang(golang.org/x/text/unicode/norm) Requires: golang(golang.org/x/time/rate) +%if %{with_tools} +Requires: golang(github.com/AudriusButkevicius/cli) +Requires: golang(github.com/cznic/ql) +Requires: golang(github.com/golang/groupcache/lru) +Requires: golang(github.com/lib/pq) +Requires: golang(github.com/oschwald/geoip2-golang) +Requires: golang(github.com/prometheus/client_golang/prometheus) +%endif + +%if %{with_cli} +Requires: golang(github.com/AudriusButkevicius/cli) +%endif + Provides: golang(%{import_path}/lib/auto) = %{version}-%{release} Provides: golang(%{import_path}/lib/beacon) = %{version}-%{release} Provides: golang(%{import_path}/lib/config) = %{version}-%{release} @@ -234,10 +253,10 @@ Summary: Continuous File Synchronization (server tools) %if ! 0%{?with_bundled} BuildRequires: golang(github.com/AudriusButkevicius/cli) -BuildRequires: golang(github.com/cznic/ql) BuildRequires: golang(github.com/golang/groupcache/lru) -BuildRequires: golang(github.com/lib/pq) BuildRequires: golang(github.com/oschwald/geoip2-golang) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) %endif %description tools @@ -286,6 +305,8 @@ This package contains the CLI program. %patch0 -p1 %endif +%patch2 -p1 + %build # remove bundled libraries @@ -324,6 +345,20 @@ go run build.go -no-upgrade build strelaypoolsrv popd +# TODO: Build process cleanup +# - drop patch to build.go +# - build only assets +# - inject custom upstream build flags here directly +#pushd $BUILDDIR +#go run build.go assets +#popd +#%%gobuild -o syncthing %%{import_path}/cmd/syncthing # FIXME flags +#%%if 0%%{?with_tools} +#%%gobuild -o stdiscosrv %%{import_path}/cmd/stdiscosrv # FIXME flags +#%%gobuild -o strelaysrv %%{import_path}/cmd/strelaysrv # FIXME flags +#%%gobuild -o strelaypoolsrv %%{import_path}/cmd/strelaypoolsrv # FIXME flags +#%%endif + %if 0%{?with_cli} %gobuild -o stcli %{import_path}/cmd/stcli %endif @@ -457,6 +492,7 @@ export GOPATH=%{buildroot}/%{gopath}:%{gopath} %global gotest go test %endif +%gotest %{import_path}/cmd/stdiscosrv %gotest %{import_path}/cmd/syncthing %gotest %{import_path}/lib/auto %gotest %{import_path}/lib/beacon @@ -470,9 +506,9 @@ export GOPATH=%{buildroot}/%{gopath}:%{gopath} %gotest %{import_path}/lib/ignore %gotest %{import_path}/lib/logger -# This test is a bit flaky on some architectures, issue is tracked at: +# This test used to be a bit flaky on some architectures, issue was tracked at: # https://github.com/syncthing/syncthing/issues/4370 -%gotest %{import_path}/lib/model || : +%gotest %{import_path}/lib/model %gotest %{import_path}/lib/nat %gotest %{import_path}/lib/osutil @@ -490,9 +526,9 @@ export GOPATH=%{buildroot}/%{gopath}:%{gopath} %gotest %{import_path}/lib/upnp %gotest %{import_path}/lib/util -# This test is failing randomly right now. Issue is tracked upstream at: +# This test used to fail randomly. Issue was tracked upstream at: # https://github.com/syncthing/syncthing/issues/4351 -%gotest %{import_path}/lib/versioner || : +%gotest %{import_path}/lib/versioner %gotest %{import_path}/lib/watchaggregator %gotest %{import_path}/lib/weakhash @@ -574,6 +610,9 @@ find %{buildroot}/%{gopath}/src/%{import_path}/ -name ".stfolder" -print -delete %changelog +* Tue Feb 13 2018 Fabio Valentini - 0.14.44-1 +- Update to version 0.14.44. + * Fri Feb 09 2018 Fedora Release Engineering - 0.14.43-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild