From 356f0508875dee91d97c7384f6a349c2e08b0fba7c346f822403f6e2533ac69d Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 20 Jun 2019 02:58:19 +0000 Subject: [PATCH 1/8] Accepting request 710984 from home:cyphar:lxc - Update to LXD 3.14. The full upstream changelog is available from: https://discuss.linuxcontainers.org/t/lxd-3-14-has-been-released/5045 boo#1138770 + Cluster: Re-worked DNS forwarding + Script to factory reset LXD + Improvements to syscall interception * Lots of bug fixes... - Update build to use go_nostrip, in order to attempt to fix the broken binaries on Leap 15.1. boo#1138769 OBS-URL: https://build.opensuse.org/request/show/710984 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=18 --- lxd-3.13.tar.gz | 3 --- lxd-3.13.tar.gz.asc | 16 ---------------- lxd-3.14.tar.gz | 3 +++ lxd-3.14.tar.gz.asc | 16 ++++++++++++++++ lxd.changes | 13 ++++++++++++- lxd.spec | 11 +++++++++-- 6 files changed, 40 insertions(+), 22 deletions(-) delete mode 100644 lxd-3.13.tar.gz delete mode 100644 lxd-3.13.tar.gz.asc create mode 100644 lxd-3.14.tar.gz create mode 100644 lxd-3.14.tar.gz.asc diff --git a/lxd-3.13.tar.gz b/lxd-3.13.tar.gz deleted file mode 100644 index 7c50ea1..0000000 --- a/lxd-3.13.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:025138d2ac7ade6e34446f90f2d25ded86aedcad726d85ba8f2b7188dab75acd -size 28049572 diff --git a/lxd-3.13.tar.gz.asc b/lxd-3.13.tar.gz.asc deleted file mode 100644 index fc96662..0000000 --- a/lxd-3.13.tar.gz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEEYC9WdmPlk7y9FPM4xjiXTWR5LWcFAlzULZcACgkQxjiXTWR5 -LWd2bRAAzkfiOrynp9pipW9HqSnGldCAU6s9vpn6IuWcblx1XYXzEOEoCxJsa/aQ -WOxUx8KsqfKMidyLSGONDBhfp4aqvGMjgD6jSTSPa2OBnOTlG9hQbdkStTky6s8Y -Rv3ZsiHcCf5WSvrfnPvB5hlLqAkQUkkC/eiUavJzC6zeiHG1Jpyf4fQp4cn2Knrp -ztcoHCSu9srpjlw5yG2kJARnWkpdSFRTd22acIJU5uMxvG6usb+W236PJZPLx47g -SMoYGeUu/8ZSZdm93kCmrQXpOkm/BR3eZ+1KqzNxhRncF3EMgQf10JUGjBzx1Tko -sIqPhWbwTs2NlszYmYURAGzTbImTB9pl3lMEcVSoDc5AXXnyYrszqHJTBCmGH43V -v6jzEfUn+Mwu6FpCfCMUbSdGS7FOB211EjTgwUIleigQ5yGXEMG/scILou8Xt99J -ztxgw7QcpOitdwm9GSgE0jxrsAb6cmlZmdF8G1sXq7FKmAxHYx0aOwJQIjTB5XGv -CoBcM1MAEc07+FYgvhGf1/nFMstfh5Z8kcoi7E/UxUVdXfst4PglYdIfsdhbmgiu -PRuFjmHyPfFUR1/u6zTP9pWEz5yIJGgj3/j/y9L5ZsA+QXZ2cfEnq9J8BHhgS4TE -DdaufUczXghBhaYrOd2BE0M6rFv3zNZxVrsEG8N+pLkvJ92FugU= -=bH7F ------END PGP SIGNATURE----- diff --git a/lxd-3.14.tar.gz b/lxd-3.14.tar.gz new file mode 100644 index 0000000..8129813 --- /dev/null +++ b/lxd-3.14.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:409e4758cbeb43b098d0265c4ce05aeeac5ae73f8914ceb1006e6a6d89fe1fe5 +size 26141949 diff --git a/lxd-3.14.tar.gz.asc b/lxd-3.14.tar.gz.asc new file mode 100644 index 0000000..18972d8 --- /dev/null +++ b/lxd-3.14.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEYC9WdmPlk7y9FPM4xjiXTWR5LWcFAl0Cr30ACgkQxjiXTWR5 +LWeuWBAA3CXtmzJNItxK4E8tBLhSZHZQTzcU+Bef/q+FJJWGLT5HX+/VMdCgmaCZ +JuR2KHkVx1t58oGD0TuxXWtnKzdV4HY1DLgUwaHcesEBbgjVxt2gKq/jBofmaqMu ++WrWGOqBp925ZBTO2fR52ZisGAFR/CMB0csHeoAc8TR2MoJiARSWhIdGXKywZPLC +/9XSS2XS0hU+/bRvSx76XYhVWtiiEl583K47GdEfN06cRVQ3CO72TZJ+SOq3ddeu +Wlu3oqMoLxyMtLXDurNX4qScFt7A6XOs3ViHOAj4Y+hUeLkkYDQKHxs+mFfsO1uN +pVeaqHk882gBDzlWsbOHkPcOTcsK/fLTBQhNc2+IiAkwNIR/GOqTE1NCtIrsXtZp +idAu4BE8WQVKQxDA8wsjTwPqmLtRvi5CF5IDG7nl3U122fHRpiHa2y6WZu9Wx+CZ +xLe3HEyE30w6fptKKk++JJjesp0k6WzEmAxs/+pJqAQUu0ZP+KzUmYcdJc5xrUXu +0ZgzNAC6Ek00DlfDYIxX8aLnsnlDJFqDkPPnCetCemZO1gJSiCGC+6INhT22Dbve +l2FyIYb1qPrWkvDND4pK4DFL5DYsIPGZEhGme/H8SrMCb5nwnALnFLxx0j8LGm9N +NnAQFPIvRUXZ94V+dVm2/8e1olngXIxxKcUNuQm3IeGW+u5aIFY= +=a5X+ +-----END PGP SIGNATURE----- diff --git a/lxd.changes b/lxd.changes index d980af6..ee192c9 100644 --- a/lxd.changes +++ b/lxd.changes @@ -1,8 +1,19 @@ +------------------------------------------------------------------- +Wed Jun 19 07:21:29 UTC 2019 - Aleksa Sarai + +- Update to LXD 3.14. The full upstream changelog is available from: + https://discuss.linuxcontainers.org/t/lxd-3-14-has-been-released/5045 + boo#1138770 + + Cluster: Re-worked DNS forwarding + + Script to factory reset LXD + + Improvements to syscall interception + * Lots of bug fixes... + ------------------------------------------------------------------- Wed Jun 19 03:16:40 UTC 2019 - Aleksa Sarai - Update build to use go_nostrip, in order to attempt to fix the broken - binaries on Leap 15.1. + binaries on Leap 15.1. boo#1138769 ------------------------------------------------------------------- Sun Jun 9 08:21:19 UTC 2019 - Aleksa Sarai diff --git a/lxd.spec b/lxd.spec index 1e8c662..6444574 100644 --- a/lxd.spec +++ b/lxd.spec @@ -23,7 +23,7 @@ %define import_path github.com/lxc/lxd Name: lxd -Version: 3.13 +Version: 3.14 Release: 0 Summary: Container hypervisor based on LXC License: Apache-2.0 @@ -86,6 +86,13 @@ Bash command line completion support for %{name}. %prep %setup -q + +# If there is a vendor/ move it to dist/src/. +if [ -d vendor ] +then + cp -at dist/src vendor/* + rm -rf vendor/ +fi # Move dist/src (which is LXD's variant of vendoring) to vendor/. mv -v dist/src vendor @@ -152,7 +159,7 @@ do CGO_CFLAGS="%{optflags} -I$PKGDIR/dist/sqlite/ -I$PKGDIR/dist/dqlite/include/" \ CGO_LDFLAGS="-L$PKGDIR/dist/sqlite/.libs/ -L$PKGDIR/dist/dqlite/.libs/" \ PKG_CONFIG_PATH="$PKGDIR/dist/sqlite:$PKGDIR/dist/dqlite" ||: - go build -buildmode=pie -tags "$BUILDTAGS" -o "bin/$binary" "$mainpkg" + go build -buildmode=pie -tags "$BUILDTAGS" -ldflags "-s -w" -o "bin/$binary" "$mainpkg" ) done From 6d889db61f3da8ae9fe2577f87e4918fff93b0fc6fd96b99abbe306b7e891683 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 20 Jun 2019 03:14:10 +0000 Subject: [PATCH 2/8] Accepting request 710986 from home:cyphar:lxc - Update to LXD 3.14. The full upstream changelog is available from: https://discuss.linuxcontainers.org/t/lxd-3-14-has-been-released/5045 boo#1138770 + Cluster: Re-worked DNS forwarding + Script to factory reset LXD + Improvements to syscall interception * Lots of bug fixes... - Update build to use go_nostrip, in order to attempt to fix the broken binaries on Leap 15.1. boo#1138769 OBS-URL: https://build.opensuse.org/request/show/710986 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=19 --- lxd.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lxd.spec b/lxd.spec index 6444574..621b478 100644 --- a/lxd.spec +++ b/lxd.spec @@ -250,6 +250,11 @@ install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} %fdupes %{buildroot} +%check +# Make sure the main binaries work enough to print help information. boo#1138769 +%{_bindir}/lxd help >/dev/null +%{_bindir}/lxc help >/dev/null + %pre # Group which owns the lxd socket, which allows people to administer it. getent group %{name} >/dev/null || groupadd -r %{name} From 6a00d13f46b31a907b69b5630c549d8982568722b2a105f24f1e7a7dd77239b7 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 20 Jun 2019 08:36:13 +0000 Subject: [PATCH 3/8] Accepting request 711033 from home:cyphar:lxc Fix builds. OBS-URL: https://build.opensuse.org/request/show/711033 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=20 --- lxd.spec | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lxd.spec b/lxd.spec index 621b478..e7ab74e 100644 --- a/lxd.spec +++ b/lxd.spec @@ -188,6 +188,14 @@ done # # [1]: https://github.com/NixOS/nixpkgs/issues/24844 +( + # A simple check that lxd isn't broken. We can't do this after patchelf + # because we'd need to chroot(2) into {buildroot} which isn't permitted due + # to user namespaces being blocked inside rpmbuild. boo#1138769 + export LD_LIBRARY_PATH="$PKGDIR/dist/sqlite/.libs/:$PKGDIR/dist/dqlite/.libs/" + ./bin/lxd help >/dev/null +) + # Give our libraries unrecognisable DT_SONAME entries. patchelf --set-soname '._LXD_INTERNAL-libsqlite3.so.0' "$PKGDIR/dist/sqlite/.libs/libsqlite3.so.0" patchelf --set-soname '._LXD_INTERNAL-libdqlite.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so.0" @@ -204,6 +212,14 @@ patchelf --replace-needed {,%{_libdir}/%{name}/}'libsqlite3.so.0' "$PKGDIR/dist/ mkdir man ./bin/lxc manpage man/ +# Ensure that all our binaries are dynamic. boo#1138769 +pushd bin/ +for bin in * +do + file "$bin" | grep 'dynamically linked' +done +popd + %install export GOPATH="$PWD/.gopath" export PKGDIR="$GOPATH/src/%{import_path}" @@ -250,11 +266,6 @@ install -d -m 0755 %{buildroot}%{_localstatedir}/log/%{name} %fdupes %{buildroot} -%check -# Make sure the main binaries work enough to print help information. boo#1138769 -%{_bindir}/lxd help >/dev/null -%{_bindir}/lxc help >/dev/null - %pre # Group which owns the lxd socket, which allows people to administer it. getent group %{name} >/dev/null || groupadd -r %{name} From f0621baf94293a599e0d7b2bf3d2902657e14165cb7eef7ce8616318bfb5599b Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 20 Jun 2019 10:59:54 +0000 Subject: [PATCH 4/8] Accepting request 711062 from home:cyphar:lxc Strip internal .so libraries. OBS-URL: https://build.opensuse.org/request/show/711062 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=21 --- lxd.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lxd.spec b/lxd.spec index e7ab74e..799e643 100644 --- a/lxd.spec +++ b/lxd.spec @@ -199,6 +199,9 @@ done # Give our libraries unrecognisable DT_SONAME entries. patchelf --set-soname '._LXD_INTERNAL-libsqlite3.so.0' "$PKGDIR/dist/sqlite/.libs/libsqlite3.so.0" patchelf --set-soname '._LXD_INTERNAL-libdqlite.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so.0" +# Strip debug symbols (we disabled debuginfo so we must do it manually). +strip "$PKGDIR/dist/sqlite/.libs/libsqlite3.so" +strip "$PKGDIR/dist/dqlite/.libs/libdqlite.so" # Switch to absolute DT_NEEDED for the lxd binary. patchelf --remove-rpath bin/lxd From 4d592de923ff6430e81dac8157365627b351c2acd57e0f55726091e3d135b69e Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Thu, 20 Jun 2019 11:11:33 +0000 Subject: [PATCH 5/8] Accepting request 711067 from home:cyphar:lxc Fix strip usage. OBS-URL: https://build.opensuse.org/request/show/711067 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=22 --- lxd.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lxd.spec b/lxd.spec index 799e643..5c86c10 100644 --- a/lxd.spec +++ b/lxd.spec @@ -196,12 +196,12 @@ done ./bin/lxd help >/dev/null ) -# Give our libraries unrecognisable DT_SONAME entries. -patchelf --set-soname '._LXD_INTERNAL-libsqlite3.so.0' "$PKGDIR/dist/sqlite/.libs/libsqlite3.so.0" -patchelf --set-soname '._LXD_INTERNAL-libdqlite.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so.0" # Strip debug symbols (we disabled debuginfo so we must do it manually). strip "$PKGDIR/dist/sqlite/.libs/libsqlite3.so" strip "$PKGDIR/dist/dqlite/.libs/libdqlite.so" +# Give our libraries unrecognisable DT_SONAME entries. +patchelf --set-soname '._LXD_INTERNAL-libsqlite3.so.0' "$PKGDIR/dist/sqlite/.libs/libsqlite3.so.0" +patchelf --set-soname '._LXD_INTERNAL-libdqlite.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so.0" # Switch to absolute DT_NEEDED for the lxd binary. patchelf --remove-rpath bin/lxd From a76926536b8d4943290c0b891899e2026bf33d6d0b4a91716f4028d8687f2a49 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Tue, 24 Sep 2019 13:02:14 +0000 Subject: [PATCH 6/8] Accepting request 732945 from home:cyphar:lxc - Update to LXD 3.17. The full upstream changelog is available from: https://discuss.linuxcontainers.org/t/lxd-3-17-has-been-released/5679 + Storage pool backed image tarballs and backups + Container configuration as YAML on lxc init and lxc launch * Ported to final Dqlite 1.0 * Database rework * Container devices rework * Storage rework OBS-URL: https://build.opensuse.org/request/show/732945 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=23 --- lxd-3.14.tar.gz | 3 - lxd-3.14.tar.gz.asc | 16 ------ lxd-3.17.tar.gz | 3 + lxd-3.17.tar.gz.asc | 16 ++++++ lxd.changes | 30 ++++++++++ lxd.spec | 130 +++++++++++++++++++++++++++++--------------- 6 files changed, 136 insertions(+), 62 deletions(-) delete mode 100644 lxd-3.14.tar.gz delete mode 100644 lxd-3.14.tar.gz.asc create mode 100644 lxd-3.17.tar.gz create mode 100644 lxd-3.17.tar.gz.asc diff --git a/lxd-3.14.tar.gz b/lxd-3.14.tar.gz deleted file mode 100644 index 8129813..0000000 --- a/lxd-3.14.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:409e4758cbeb43b098d0265c4ce05aeeac5ae73f8914ceb1006e6a6d89fe1fe5 -size 26141949 diff --git a/lxd-3.14.tar.gz.asc b/lxd-3.14.tar.gz.asc deleted file mode 100644 index 18972d8..0000000 --- a/lxd-3.14.tar.gz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCgAdFiEEYC9WdmPlk7y9FPM4xjiXTWR5LWcFAl0Cr30ACgkQxjiXTWR5 -LWeuWBAA3CXtmzJNItxK4E8tBLhSZHZQTzcU+Bef/q+FJJWGLT5HX+/VMdCgmaCZ -JuR2KHkVx1t58oGD0TuxXWtnKzdV4HY1DLgUwaHcesEBbgjVxt2gKq/jBofmaqMu -+WrWGOqBp925ZBTO2fR52ZisGAFR/CMB0csHeoAc8TR2MoJiARSWhIdGXKywZPLC -/9XSS2XS0hU+/bRvSx76XYhVWtiiEl583K47GdEfN06cRVQ3CO72TZJ+SOq3ddeu -Wlu3oqMoLxyMtLXDurNX4qScFt7A6XOs3ViHOAj4Y+hUeLkkYDQKHxs+mFfsO1uN -pVeaqHk882gBDzlWsbOHkPcOTcsK/fLTBQhNc2+IiAkwNIR/GOqTE1NCtIrsXtZp -idAu4BE8WQVKQxDA8wsjTwPqmLtRvi5CF5IDG7nl3U122fHRpiHa2y6WZu9Wx+CZ -xLe3HEyE30w6fptKKk++JJjesp0k6WzEmAxs/+pJqAQUu0ZP+KzUmYcdJc5xrUXu -0ZgzNAC6Ek00DlfDYIxX8aLnsnlDJFqDkPPnCetCemZO1gJSiCGC+6INhT22Dbve -l2FyIYb1qPrWkvDND4pK4DFL5DYsIPGZEhGme/H8SrMCb5nwnALnFLxx0j8LGm9N -NnAQFPIvRUXZ94V+dVm2/8e1olngXIxxKcUNuQm3IeGW+u5aIFY= -=a5X+ ------END PGP SIGNATURE----- diff --git a/lxd-3.17.tar.gz b/lxd-3.17.tar.gz new file mode 100644 index 0000000..45097a0 --- /dev/null +++ b/lxd-3.17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9484acb489b91f58ae8fe4518e5a09bdf2460808817efd32765ad9241ef729ef +size 23494267 diff --git a/lxd-3.17.tar.gz.asc b/lxd-3.17.tar.gz.asc new file mode 100644 index 0000000..47f48c8 --- /dev/null +++ b/lxd-3.17.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEYC9WdmPlk7y9FPM4xjiXTWR5LWcFAl1xitgACgkQxjiXTWR5 +LWdE7A//Zfjh5PPnzIAd+It5ACVjApJ7ya+cprP3lUBVhh4ZUouawjJXkD6ZwvGw +3LFXYTXHmtcZZV26Yq/9akppI/6Ag12EEr/Ejg6UA9I9Zbni+hAD44elTpzMYJUQ +jzfAHc1D9yu6st/RJl3mi10vAdUVSa07WqfrSWBFQycbFoFI6Ec2WBAgbLmTcfJ8 +9vQNMb/Uo1LJWW/lrNaRvg0+PZPz86XH8lM19m75rTYlKpSchkvJiDkJbMzweVCx +rs/RYCBjn99+nthl5i3uv9VvVecWUitU1pPFJDQqFVsp1FkaFwVdDztttfLCpa2A +MN/F0gr5IZMdw2R4n6HalPzUatvs4s5+zreJU33mUkhl+P821Ljn0R34Dh0Y3SXx +OrV+xQ928+vrvDmEEZcC+Ql/T+9bjKRXN6wCMU6hcyTFZYK/5DMHv9K7iXto5vkv +6fAEl4SRuBTOaF63raVy1eV09auOHiZPKMWiJ6SQfP1H2cmguQJD2ccEQsF8LenL +zD2E3g40daCBAOpcp3x9WQJnoc6QqeVnBDvTUzexRPPM/4a2jfGcFZ4+oPTco0pr +CAizSdjdaS4McKfJ5qoQZqKbdG78jpgZQBNHQDBnjKy2nGMa+fTrHDtUzYntmaaf +OIB50d9POjv1POyCey23kg7AaQbKpL2Ta+Zo1mPlkiCyg64YmAo= +=oI/X +-----END PGP SIGNATURE----- diff --git a/lxd.changes b/lxd.changes index ee192c9..e4a99e0 100644 --- a/lxd.changes +++ b/lxd.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Tue Sep 24 12:31:21 UTC 2019 - Aleksa Sarai + +- Update to LXD 3.17. The full upstream changelog is available from: + https://discuss.linuxcontainers.org/t/lxd-3-17-has-been-released/5679 + + Storage pool backed image tarballs and backups + + Container configuration as YAML on lxc init and lxc launch + * Ported to final Dqlite 1.0 + * Database rework + * Container devices rework + * Storage rework + +------------------------------------------------------------------- +Mon Jul 15 06:40:30 UTC 2019 - Aleksa Sarai + +- Update to LXD 3.15. The full upstream changelog is available from: + https://discuss.linuxcontainers.org/t/lxd-3-15-has-been-released/5218 + + Switch to dqlite 1.0. + * Reworked DHCP lease handling + * Reworked cluster heartbeat handling + * Better syscall interception framework + * More reliable unix socket proxying + + Hardware VLAN and MAC filtering on SR-IOV + + New storage-size option for lxd-p2c + + IPv4 and IPv6 filtering (spoof protection) + * Reworked resources API (host hardware) + + Control over uid, gid and cwd during command execution + + Quota support for custom storage volumes on dir backend + * Lots of bug fixes... + ------------------------------------------------------------------- Wed Jun 19 07:21:29 UTC 2019 - Aleksa Sarai diff --git a/lxd.spec b/lxd.spec index 5c86c10..e6a27e6 100644 --- a/lxd.spec +++ b/lxd.spec @@ -23,7 +23,7 @@ %define import_path github.com/lxc/lxd Name: lxd -Version: 3.14 +Version: 3.17 Release: 0 Summary: Container hypervisor based on LXC License: Apache-2.0 @@ -87,58 +87,91 @@ Bash command line completion support for %{name}. %prep %setup -q -# If there is a vendor/ move it to dist/src/. +# If there is a vendor/ move it to _dist/src/. if [ -d vendor ] then - cp -at dist/src vendor/* + cp -at _dist/src vendor/* rm -rf vendor/ fi -# Move dist/src (which is LXD's variant of vendoring) to vendor/. -mv -v dist/src vendor +# Move _dist/src (which is LXD's variant of vendoring) to vendor/. +mv -v _dist/src vendor %build # Make sure any leftover go build caches are gone. go clean -cache +# Keep track of the current set of paths needed to generate the include-related +# variables for later stages. +declare -a CURRENT_DEPLIST + # Set up GOPATH. export GOPATH="$PWD/.gopath" export PKGDIR="$GOPATH/src/%{import_path}" mkdir -p "$PKGDIR" cp -a * "$PKGDIR" -# First we need to build the sqlite fork and dqlite. We build them as static -# libs because they are only ever going to be used for LXD, and so it makes no -# sense to go through the pain of packaging them properly (hopefully the code -# will one day be merged into upstream sqlite). +# First we need to build the sqlite fork and dqlite. We need to build them +# dynamically (to avoid binary bloat), but we also then need to mess with +# patchelf to stop us from breaking openSUSE packaging. export CFLAGS="%{optflags} -fPIC -DPIC" +# We have a temporary-install directory which contains our pkg-configs. +export PKG_CONFIG_SYSROOT_DIR="$PKGDIR/.install" +export PKG_CONFIG_PATH="$PKG_CONFIG_SYSROOT_DIR/%{_libdir}/%{name}/pkgconfig:$PKG_CONFIG_SYSROOT_DIR/%{_datadir}/pkgconfig" + # SQLite -pushd "$PKGDIR/dist/sqlite" +pushd "$PKGDIR/_dist/deps/sqlite" autoreconf -fiv %configure \ --libdir="%{_libdir}/%{name}" \ --disable-static \ --enable-replication \ - --disable-tcl \ + --disable-tcl make clean make %{?_smp_mflags} +make DESTDIR="$PKGDIR/.install" install +# Add sqlite to dependency list. +CURRENT_DEPLIST+=("$PWD") +popd + +# libco +pushd "$PKGDIR/_dist/deps/libco" +make \ + CFLAGS="$CFLAGS" \ + PREFIX="" \ + INCLUDEDIR="%{_includedir}" \ + LIBDIR="%{_libdir}/%{name}" \ + DESTDIR="$PKGDIR/.install" \ + all install +# Add libco to dependency list. +CURRENT_DEPLIST+=("$PWD") +popd + +# raft +pushd "$PKGDIR/_dist/deps/raft" +autoreconf -fiv +%configure \ + --libdir="%{_libdir}/%{name}" \ + --disable-static +make %{?_smp_mflags} +make DESTDIR="$PKGDIR/.install" install +# Add raft to dependency list. +CURRENT_DEPLIST+=("$PWD") popd # dqlite -pushd "$PKGDIR/dist/dqlite" +pushd "$PKGDIR/_dist/deps/dqlite" ( -# We need to make sure *our* sqlite build is used. -export PKG_CONFIG_PATH="$PWD/../sqlite/" -export CPPFLAGS="-I$PWD/../sqlite/" -export LDFLAGS="-L$PWD/../sqlite/.libs/" - autoreconf -fiv %configure \ --libdir="%{_libdir}/%{name}" \ --disable-static make clean make %{?_smp_mflags} +make DESTDIR="$PKGDIR/.install" install ) +# Add raft to dependency list. +CURRENT_DEPLIST+=("$PWD") popd # Find all of the main packages using go-list. @@ -156,17 +189,16 @@ do # We need to link against sqlite and dqlite only when dealing with lxd proper. [ "$binary" == "lxd" ] && export \ BUILDTAGS="libsqlite3" \ - CGO_CFLAGS="%{optflags} -I$PKGDIR/dist/sqlite/ -I$PKGDIR/dist/dqlite/include/" \ - CGO_LDFLAGS="-L$PKGDIR/dist/sqlite/.libs/ -L$PKGDIR/dist/dqlite/.libs/" \ - PKG_CONFIG_PATH="$PKGDIR/dist/sqlite:$PKGDIR/dist/dqlite" ||: - go build -buildmode=pie -tags "$BUILDTAGS" -ldflags "-s -w" -o "bin/$binary" "$mainpkg" + CGO_CFLAGS="-I $PKGDIR/.install/%{_includedir}" \ + CGO_LDFLAGS="-L $PKGDIR/.install/%{_libdir}/%{name}" ||: + go build -buildmode=pie -tags "$BUILDTAGS" -o "bin/$binary" "$mainpkg" ) done # This part is quite ugly, so I apologise upfront. # -# We want to have our dist/* libraries be dylibs so that we don't bloat our lxd -# binary. Unfortunately, we are presented with a few challenges: +# We want to have our _dist/deps/* libraries be dylibs so that we don't bloat +# our lxd binary. Unfortunately, we are presented with a few challenges: # # * Doing this naively (put it in {_libdir}) results in sqlite3 package # conflicts -- and we aren't going to maintain sqlite3 for all of openSUSE @@ -180,9 +212,9 @@ done # # So, the only reasonable choice left is to use absolute paths as DT_NEEDED # entries -- which bypasses the need for RUNPATH and allows us to set garbage -# sonames for our dist/* libraries. Absolute paths for DT_NEEDED is *slightly* -# undefined behaviour, but glibc has had this behaviour for a very long time -- -# and others have considered using it in a similar manner[1]. +# sonames for our _dist/deps/* libraries. Absolute paths for DT_NEEDED is +# *slightly* undefined behaviour, but glibc has had this behaviour for a very +# long time -- and others have considered using it in a similar manner[1]. # # What F U N. # @@ -192,33 +224,46 @@ done # A simple check that lxd isn't broken. We can't do this after patchelf # because we'd need to chroot(2) into {buildroot} which isn't permitted due # to user namespaces being blocked inside rpmbuild. boo#1138769 - export LD_LIBRARY_PATH="$PKGDIR/dist/sqlite/.libs/:$PKGDIR/dist/dqlite/.libs/" + export LD_LIBRARY_PATH="$PKGDIR/.install/%{_libdir}/%{name}" ./bin/lxd help >/dev/null ) -# Strip debug symbols (we disabled debuginfo so we must do it manually). -strip "$PKGDIR/dist/sqlite/.libs/libsqlite3.so" -strip "$PKGDIR/dist/dqlite/.libs/libdqlite.so" -# Give our libraries unrecognisable DT_SONAME entries. -patchelf --set-soname '._LXD_INTERNAL-libsqlite3.so.0' "$PKGDIR/dist/sqlite/.libs/libsqlite3.so.0" -patchelf --set-soname '._LXD_INTERNAL-libdqlite.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so.0" +for lib in $PKGDIR/.install/%{_libdir}/%{name}/lib*.so +do + # Strip off last two version digits. + name="$(basename "$(readlink "$lib")" | sed -E 's/\.[0-9]+\.[0-9]+$//')" + # Give our libraries unrecognisable DT_SONAME entries. + patchelf --set-soname "._LXD_INTERNAL-$name" "$lib" +done -# Switch to absolute DT_NEEDED for the lxd binary. -patchelf --remove-rpath bin/lxd -patchelf --replace-needed {,%{_libdir}/%{name}/}'libsqlite3.so.0' bin/lxd -patchelf --replace-needed {,%{_libdir}/%{name}/}'libdqlite.so.0' bin/lxd -# Just to be sure, fix libdqlite.so as well. -patchelf --remove-rpath "$PKGDIR/dist/dqlite/.libs/libdqlite.so" -patchelf --replace-needed {,%{_libdir}/%{name}/}'libsqlite3.so.0' "$PKGDIR/dist/dqlite/.libs/libdqlite.so" +# Switch to absolute DT_NEEDED for all dylibs we have as well as the main LXD +# binary. We do this for all dylibs to make sure we don't end up with weird +# chain-loading problems. +for target in bin/lxd $PKGDIR/.install/%{_libdir}/%{name}/lib*.so +do + # Drop RPATH in case it got included during builds. + patchelf --remove-rpath "$target" + # Strip binaries manually. + strip --strip-debug "$target" + # And now replace all the possible DT_NEEDEDs to absolute paths. + for lib in $PKGDIR/.install/%{_libdir}/%{name}/lib*.so + do + # Strip off last two version digits. + name="$(basename "$(readlink "$lib")" | sed -E 's/\.[0-9]+\.[0-9]+$//')" + patchelf --replace-needed {,%{_libdir}/%{name}/}"$name" "$target" + done +done # Generate man pages. mkdir man ./bin/lxc manpage man/ -# Ensure that all our binaries are dynamic. boo#1138769 pushd bin/ for bin in * do + # Strip binaries manually. + strip --strip-debug "$target" + # Ensure that all our binaries are dynamic. boo#1138769 file "$bin" | grep 'dynamically linked' done popd @@ -230,8 +275,7 @@ export PKGDIR="$GOPATH/src/%{import_path}" install -d -m 0755 %{buildroot}%{_libdir}/%{name} pushd "$PKGDIR" # We can't use install because *.so.$n are symlinks. -cp -avt %{buildroot}%{_libdir}/%{name}/ dist/sqlite/.libs/libsqlite3.so.* -cp -avt %{buildroot}%{_libdir}/%{name}/ dist/dqlite/.libs/libdqlite.so.* +cp -avt %{buildroot}%{_libdir}/%{name}/ $PKGDIR/.install/%{_libdir}/%{name}/lib*.so.* popd # Install all the binaries. From f7692764ea7cbd28cfa942fa432b2a440bb163b553228bbc0b749a9a9b3efd75 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Tue, 24 Sep 2019 13:52:57 +0000 Subject: [PATCH 7/8] Accepting request 732956 from home:cyphar:lxc - Completely drop all stripping -- it appears to cause all sorts of problems with unresolved symbol errors. OBS-URL: https://build.opensuse.org/request/show/732956 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=24 --- lxd.changes | 2 ++ lxd.spec | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lxd.changes b/lxd.changes index e4a99e0..3da0d6b 100644 --- a/lxd.changes +++ b/lxd.changes @@ -1,6 +1,8 @@ ------------------------------------------------------------------- Tue Sep 24 12:31:21 UTC 2019 - Aleksa Sarai +- Completely drop all stripping -- it appears to cause all sorts of problems + with unresolved symbol errors. - Update to LXD 3.17. The full upstream changelog is available from: https://discuss.linuxcontainers.org/t/lxd-3-17-has-been-released/5679 + Storage pool backed image tarballs and backups diff --git a/lxd.spec b/lxd.spec index e6a27e6..b1eb187 100644 --- a/lxd.spec +++ b/lxd.spec @@ -243,8 +243,6 @@ for target in bin/lxd $PKGDIR/.install/%{_libdir}/%{name}/lib*.so do # Drop RPATH in case it got included during builds. patchelf --remove-rpath "$target" - # Strip binaries manually. - strip --strip-debug "$target" # And now replace all the possible DT_NEEDEDs to absolute paths. for lib in $PKGDIR/.install/%{_libdir}/%{name}/lib*.so do @@ -261,8 +259,6 @@ mkdir man pushd bin/ for bin in * do - # Strip binaries manually. - strip --strip-debug "$target" # Ensure that all our binaries are dynamic. boo#1138769 file "$bin" | grep 'dynamically linked' done From 662a16aa943546ffb2fa0ec74e4e95ff25fdce248504723b0d21a4497be5c9a7 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Tue, 24 Sep 2019 14:14:12 +0000 Subject: [PATCH 8/8] Accepting request 732960 from home:cyphar:lxc Add trackerbug. OBS-URL: https://build.opensuse.org/request/show/732960 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/lxd?expand=0&rev=25 --- lxd.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/lxd.changes b/lxd.changes index 3da0d6b..72a1034 100644 --- a/lxd.changes +++ b/lxd.changes @@ -5,6 +5,7 @@ Tue Sep 24 12:31:21 UTC 2019 - Aleksa Sarai with unresolved symbol errors. - Update to LXD 3.17. The full upstream changelog is available from: https://discuss.linuxcontainers.org/t/lxd-3-17-has-been-released/5679 + boo#1151874 + Storage pool backed image tarballs and backups + Container configuration as YAML on lxc init and lxc launch * Ported to final Dqlite 1.0