From 6a5acbef4f79a38d69853ef9db15e2c8bfb17a6d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 5 Sep 2019 15:14:13 +0200 Subject: [PATCH 01/20] Update to 0.0.13 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index c0f497f..947ee07 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /toolbox-0.0.10.tar.xz /toolbox-0.0.11.tar.xz /toolbox-0.0.12.tar.xz +/toolbox-0.0.13.tar.xz diff --git a/sources b/sources index 45bd05f..07f4417 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.12.tar.xz) = a1ee0851b7ea9dadb7105f9b7f4ec151c58d9587e2d9b344ca0d7a8c47ccbd8a1e021b2788cc2d30465cecf96fc867d735b6505451bb3ff4a5ae512f8986c87f +SHA512 (toolbox-0.0.13.tar.xz) = 3bced48a7444d041c43d49675dc16b2b6e15d176824124adf8b711ea10973a09f0a5fa4530bf922fa2a4fc99db0ee303088cc1de54d6c4298c331061dac95464 diff --git a/toolbox.spec b/toolbox.spec index 5f5c57e..9d7610d 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,6 +1,6 @@ Name: toolbox -Version: 0.0.12 -Release: 2%{?dist} +Version: 0.0.13 +Release: 1%{?dist} Summary: Unprivileged development environment License: ASL 2.0 @@ -18,7 +18,7 @@ BuildRequires: pkgconfig(bash-completion) BuildRequires: systemd Requires: flatpak-session-helper -Requires: podman +Requires: podman > 1.4.0 # To be removed in Fedora 33 Provides: fedora-toolbox = %{version}-%{release} @@ -130,6 +130,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Thu Sep 05 2019 Debarshi Ray - 0.0.13-1 +- Update to 0.0.13 + * Sat Jul 27 2019 Fedora Release Engineering - 0.0.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From 3ab5e20521a283d4eef135e3919df016b4de3f84 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 18 Sep 2019 19:07:10 +0200 Subject: [PATCH 02/20] Update to 0.0.14 Fix a typo in the minimum Podman version requirement. Podman 1.4.0 is meant to be fine. --- .gitignore | 1 + sources | 2 +- toolbox.spec | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 947ee07..6afee65 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /toolbox-0.0.11.tar.xz /toolbox-0.0.12.tar.xz /toolbox-0.0.13.tar.xz +/toolbox-0.0.14.tar.xz diff --git a/sources b/sources index 07f4417..cbede67 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.13.tar.xz) = 3bced48a7444d041c43d49675dc16b2b6e15d176824124adf8b711ea10973a09f0a5fa4530bf922fa2a4fc99db0ee303088cc1de54d6c4298c331061dac95464 +SHA512 (toolbox-0.0.14.tar.xz) = a66a67ac2955c7a6254bbdd1ef185a4ba4d7c011b9273cc9e356e4325f7a4c34b41132885218843c9b863ef27ffce16a86ef0ac600fb9e0581943fe9b0107fdc diff --git a/toolbox.spec b/toolbox.spec index 9d7610d..173f309 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.13 +Version: 0.0.14 Release: 1%{?dist} Summary: Unprivileged development environment @@ -18,7 +18,7 @@ BuildRequires: pkgconfig(bash-completion) BuildRequires: systemd Requires: flatpak-session-helper -Requires: podman > 1.4.0 +Requires: podman >= 1.4.0 # To be removed in Fedora 33 Provides: fedora-toolbox = %{version}-%{release} @@ -130,6 +130,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Wed Sep 18 2019 Debarshi Ray - 0.0.14-1 +- Update to 0.0.14 + * Thu Sep 05 2019 Debarshi Ray - 0.0.13-1 - Update to 0.0.13 From 798bc279658ac6de41f7aaa8ebb9fd288f16a703 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 30 Sep 2019 18:34:52 +0200 Subject: [PATCH 03/20] Update to 0.0.15 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6afee65..e6e67ad 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /toolbox-0.0.12.tar.xz /toolbox-0.0.13.tar.xz /toolbox-0.0.14.tar.xz +/toolbox-0.0.15.tar.xz diff --git a/sources b/sources index cbede67..6694403 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.14.tar.xz) = a66a67ac2955c7a6254bbdd1ef185a4ba4d7c011b9273cc9e356e4325f7a4c34b41132885218843c9b863ef27ffce16a86ef0ac600fb9e0581943fe9b0107fdc +SHA512 (toolbox-0.0.15.tar.xz) = 3fc4c22dd6d72fddad9d808d1ed1caaf8162cac116fbc814f194ca529c5925d36e24aeb4e6022d0f6817ba3a2cc1e9793d025fab3066072de26d62243747bc45 diff --git a/toolbox.spec b/toolbox.spec index 173f309..163b076 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.14 +Version: 0.0.15 Release: 1%{?dist} Summary: Unprivileged development environment @@ -130,6 +130,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Mon Sep 30 2019 Debarshi Ray - 0.0.15-1 +- Update to 0.0.15 + * Wed Sep 18 2019 Debarshi Ray - 0.0.14-1 - Update to 0.0.14 From b447c49924e0513d3d9016f6c9be9c589d6ad092 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 29 Oct 2019 16:16:55 +0100 Subject: [PATCH 04/20] Update to 0.0.16 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e6e67ad..f58ed5e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /toolbox-0.0.13.tar.xz /toolbox-0.0.14.tar.xz /toolbox-0.0.15.tar.xz +/toolbox-0.0.16.tar.xz diff --git a/sources b/sources index 6694403..3d78cf8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.15.tar.xz) = 3fc4c22dd6d72fddad9d808d1ed1caaf8162cac116fbc814f194ca529c5925d36e24aeb4e6022d0f6817ba3a2cc1e9793d025fab3066072de26d62243747bc45 +SHA512 (toolbox-0.0.16.tar.xz) = 4b87c023090a5862c0b16aa994eb3778158e199525e3a0e8836e361824238df4fae58b020df91b0131a6fb7ac6dc1ee3eaa153cc50f6232826b55eb5a0903c90 diff --git a/toolbox.spec b/toolbox.spec index 163b076..c6c47b7 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,11 +1,11 @@ Name: toolbox -Version: 0.0.15 +Version: 0.0.16 Release: 1%{?dist} Summary: Unprivileged development environment License: ASL 2.0 -URL: https://github.com/debarshiray/toolbox -Source0: https://github.com/debarshiray/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz +URL: https://github.com/containers/toolbox +Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz BuildArch: noarch # buildah and podman only work on the following architectures: @@ -130,6 +130,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Tue Oct 29 2019 Debarshi Ray - 0.0.16-1 +- Update to 0.0.16 + * Mon Sep 30 2019 Debarshi Ray - 0.0.15-1 - Update to 0.0.15 From c34a2d8ce6360b94516c12e414d2743760d67bf2 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 20 Nov 2019 18:13:56 +0100 Subject: [PATCH 05/20] Update to 0.0.17 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f58ed5e..9486667 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /toolbox-0.0.14.tar.xz /toolbox-0.0.15.tar.xz /toolbox-0.0.16.tar.xz +/toolbox-0.0.17.tar.xz diff --git a/sources b/sources index 3d78cf8..cf05866 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.16.tar.xz) = 4b87c023090a5862c0b16aa994eb3778158e199525e3a0e8836e361824238df4fae58b020df91b0131a6fb7ac6dc1ee3eaa153cc50f6232826b55eb5a0903c90 +SHA512 (toolbox-0.0.17.tar.xz) = 0be37d12da982f2e630461de508edbcac58443c33b3c57a8ced008d5115031d0cc61e00eb4d90f9edcdb556aff88af8817bfd468cfe208036793633da5047fb6 diff --git a/toolbox.spec b/toolbox.spec index c6c47b7..90f2fad 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.16 +Version: 0.0.17 Release: 1%{?dist} Summary: Unprivileged development environment @@ -130,6 +130,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Wed Nov 20 2019 Debarshi Ray - 0.0.17-1 +- Update to 0.0.17 + * Tue Oct 29 2019 Debarshi Ray - 0.0.16-1 - Update to 0.0.16 From b287ef8baef409a9fd20d722873482ac23f8c82c Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 14 Jan 2020 16:35:45 +0100 Subject: [PATCH 06/20] Update to 0.0.18 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9486667..4cecead 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /toolbox-0.0.15.tar.xz /toolbox-0.0.16.tar.xz /toolbox-0.0.17.tar.xz +/toolbox-0.0.18.tar.xz diff --git a/sources b/sources index cf05866..9e3fa70 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.17.tar.xz) = 0be37d12da982f2e630461de508edbcac58443c33b3c57a8ced008d5115031d0cc61e00eb4d90f9edcdb556aff88af8817bfd468cfe208036793633da5047fb6 +SHA512 (toolbox-0.0.18.tar.xz) = 4b47e950bbe2dcf31d2cb155664df822f01708188615fae3304289986176002bd2ffd8b630ad2453c8cc20b93e92e2c10f38948515dede67f55b44cd4a697e5c diff --git a/toolbox.spec b/toolbox.spec index 90f2fad..d888696 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.17 +Version: 0.0.18 Release: 1%{?dist} Summary: Unprivileged development environment @@ -130,6 +130,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Tue Jan 14 2020 Debarshi Ray - 0.0.18-1 +- Update to 0.0.18 + * Wed Nov 20 2019 Debarshi Ray - 0.0.17-1 - Update to 0.0.17 From c5ec4c3296980b1de6e61e330538f0abb103470f Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 10 Jun 2020 17:47:48 +0200 Subject: [PATCH 07/20] Update the experience sub-package - Sync it with the current Dockerfile - Make it Require the "support" sub-package --- toolbox.spec | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/toolbox.spec b/toolbox.spec index d888696..d0573b5 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,6 +1,6 @@ Name: toolbox Version: 0.0.18 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Unprivileged development environment License: ASL 2.0 @@ -51,16 +51,18 @@ if the image isn't based on the fedora-toolbox image. %package experience Summary: Set of packages to enhance the %{name} experience +Requires: %{name}-support = %{version}-%{release} Requires: bash-completion Requires: bzip2 Requires: diffutils Requires: dnf-plugins-core Requires: findutils -Requires: flatpak-xdg-utils +Requires: flatpak-spawn Requires: fpaste Requires: git Requires: gnupg Requires: gnupg2-smime +Requires: gvfs-client Requires: hostname Requires: iputils Requires: jwhois @@ -72,7 +74,6 @@ Requires: man-pages Requires: mlocate Requires: mtr Requires: openssh-clients -Requires: PackageKit-command-not-found Requires: pigz Requires: procps-ng Requires: rsync @@ -130,6 +131,10 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Wed Jun 10 2020 Debarshi Ray - 0.0.18-2 +- Sync the "experience" packages with the current Dockerfile +- Make "experience" Require "support" + * Tue Jan 14 2020 Debarshi Ray - 0.0.18-1 - Update to 0.0.18 From d33acf51b118f1e5f0cb390e7de9724669be7814 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 27 Jun 2020 15:45:40 +0200 Subject: [PATCH 08/20] Toolbox no longer uses Buildah No need to issue a build just for this. Fallout from 86f63f79648cbd7f05b807d458b6c02c54774df3 --- toolbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.spec b/toolbox.spec index d0573b5..7156329 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -8,7 +8,7 @@ URL: https://github.com/containers/toolbox Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz BuildArch: noarch -# buildah and podman only work on the following architectures: +# podman only works on the following architectures: ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64 BuildRequires: ShellCheck From 144ed6cf323af0d2cb992a3d41fd398f03eeda26 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 27 Jun 2020 15:50:55 +0200 Subject: [PATCH 09/20] Remove ExclusiveArch to match Podman --- toolbox.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toolbox.spec b/toolbox.spec index 7156329..21c5231 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,6 +1,6 @@ Name: toolbox Version: 0.0.18 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Unprivileged development environment License: ASL 2.0 @@ -8,8 +8,6 @@ URL: https://github.com/containers/toolbox Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz BuildArch: noarch -# podman only works on the following architectures: -ExclusiveArch: aarch64 %{arm} ppc64le s390x x86_64 BuildRequires: ShellCheck BuildRequires: golang-github-cpuguy83-md2man @@ -131,6 +129,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Tue Jul 21 2020 Debarshi Ray - 0.0.18-3 +- Remove ExclusiveArch to match Podman + * Wed Jun 10 2020 Debarshi Ray - 0.0.18-2 - Sync the "experience" packages with the current Dockerfile - Make "experience" Require "support" From ee56ddd49ee4c237243a24681a564542d07647ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harry=20M=C3=ADchal?= Date: Thu, 14 May 2020 18:25:18 +0200 Subject: [PATCH 10/20] Use %{name} instead of hard-coding 'toolbox' There's no need to issue a build just for this. --- toolbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.spec b/toolbox.spec index 21c5231..517c1a4 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -120,7 +120,7 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %{_datadir}/bash-completion %{_mandir}/man1/%{name}.1* %{_mandir}/man1/%{name}-*.1* -%{_sysconfdir}/profile.d/toolbox.sh +%{_sysconfdir}/profile.d/%{name}.sh %{_tmpfilesdir}/%{name}.conf %files support From 50daf8960289bd4c67f1c997729dfe4db8dba47d Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 30 Jun 2020 14:11:35 +0200 Subject: [PATCH 11/20] Use %{name} instead of hard-coding 'toolbox' There's no need to issue a build just for this. --- toolbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.spec b/toolbox.spec index 517c1a4..60e9ef6 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -4,7 +4,7 @@ Release: 3%{?dist} Summary: Unprivileged development environment License: ASL 2.0 -URL: https://github.com/containers/toolbox +URL: https://github.com/containers/%{name} Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz BuildArch: noarch From 38b379b0ab5db8f56c4ee48017222174ee0190a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harry=20M=C3=ADchal?= Date: Tue, 30 Jun 2020 19:17:15 +0200 Subject: [PATCH 12/20] Update to 0.0.91 Toolbox is now written in Go, so this is no longer a noarch package. Unlike idiomatic Go code-bases, Toolbox uses the Meson build system to check for additional non-Go dependencies and install various auxilliary files. This leads to some interesting problems. The Go toolchain doesn't play well with passing compiler and linker flags via environment variables. The linker flags require a second level of quoting, which leaves the build system without a quote level to assign the flags to an environment variable like GOFLAGS. This is one reason why Fedora doesn't have a RPM macro with only the flags. The %{gobuild} RPM macro includes the entire 'go build ...' invocation. Therefore, the entire 'go build ...' invocation is swapped out using a set of downstream patches (one for PPC64 because it doesn't use '-buildmode pie', and another for other CPU architectures) to match the %{gobuild} RPM macro. The Go toolchain also doesn't like the LDFLAGS environment variable as exported by Fedora's %{meson} RPM macro. For some reason, when built on Koji, the final binary gets created as ../src/src instead of ../src/toolbox, but it doesn't happen when building locally with 'rpmbuild -ba ...'. Hence it's necessary to explicitly specify the name of the output binary. Finally, Fedora doesn't support Go modules when building Go programs. This means that Go's semantic import versioning can't be used. A conscious effort was made to minimize the use of exotic Go-specific RPM macros to retain the legibility of the spec file. A proliferation of such RPM macros is a hindrance for those who are not experts in the ins and outs of packaging Go code in Fedora. Some changes by Debarshi Ray. https://src.fedoraproject.org/rpms/toolbox/pull-request/2 --- .gitignore | 1 + sources | 2 +- ...-use-Go-s-semantic-import-versioning.patch | 73 +++++++++++++++++++ toolbox-Make-it-build-on-aarch64.patch | 30 ++++++++ ...ags-match-Fedora-s-gobuild-for-PPC64.patch | 45 ++++++++++++ ...e-build-flags-match-Fedora-s-gobuild.patch | 44 +++++++++++ toolbox.spec | 44 +++++++++-- 7 files changed, 233 insertions(+), 6 deletions(-) create mode 100644 toolbox-Don-t-use-Go-s-semantic-import-versioning.patch create mode 100644 toolbox-Make-it-build-on-aarch64.patch create mode 100644 toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch create mode 100644 toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch diff --git a/.gitignore b/.gitignore index 4cecead..f0c7329 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /toolbox-0.0.16.tar.xz /toolbox-0.0.17.tar.xz /toolbox-0.0.18.tar.xz +/toolbox-0.0.91.tar.xz diff --git a/sources b/sources index 9e3fa70..33a10ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.18.tar.xz) = 4b47e950bbe2dcf31d2cb155664df822f01708188615fae3304289986176002bd2ffd8b630ad2453c8cc20b93e92e2c10f38948515dede67f55b44cd4a697e5c +SHA512 (toolbox-0.0.91.tar.xz) = 5448abb21016003960484203cb550b47a679c852beb205d187a374870bb37c6c68fa25da24d193d557f196906d5b19a9457548987d058945ac4624a27ad7861f diff --git a/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch b/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch new file mode 100644 index 0000000..88a4c43 --- /dev/null +++ b/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch @@ -0,0 +1,73 @@ +From 4a1fc0c94f48c281acd1588f35c3bb95a1a1e2f2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Harry=20M=C3=ADchal?= +Date: Sat, 27 Jun 2020 16:17:56 +0200 +Subject: [PATCH] Don't use Go's semantic import versioning + +Fedora doesn't support Go modules when building Go programs. This +means that source code using semantic import versioning can't be built. + +https://github.com/containers/toolbox/pull/484 +--- + src/cmd/create.go | 2 +- + src/go.mod | 2 +- + src/go.sum | 4 ++-- + src/pkg/utils/utils.go | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/cmd/create.go b/src/cmd/create.go +index 80e4f8c36ca4..98df9d248466 100644 +--- a/src/cmd/create.go ++++ b/src/cmd/create.go +@@ -28,7 +28,7 @@ import ( + "github.com/containers/toolbox/pkg/podman" + "github.com/containers/toolbox/pkg/shell" + "github.com/containers/toolbox/pkg/utils" +- "github.com/godbus/dbus/v5" ++ "github.com/godbus/dbus" + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + ) +diff --git a/src/go.mod b/src/go.mod +index 07891e13a612..45e490f38907 100644 +--- a/src/go.mod ++++ b/src/go.mod +@@ -6,7 +6,7 @@ require ( + github.com/HarryMichal/go-version v1.0.0 + github.com/acobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249 + github.com/briandowns/spinner v1.10.0 +- github.com/godbus/dbus/v5 v5.0.3 ++ github.com/godbus/dbus v4.1.0+incompatible + github.com/sirupsen/logrus v1.4.2 + github.com/spf13/cobra v0.0.5 + golang.org/x/sys v0.0.0-20190422165155-953cdadca894 +diff --git a/src/go.sum b/src/go.sum +index 5ee0d2179a39..5be421de9b13 100644 +--- a/src/go.sum ++++ b/src/go.sum +@@ -15,8 +15,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs + github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= + github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= + github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +-github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME= +-github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= ++github.com/godbus/dbus v4.1.0+incompatible h1:WqqLRTsQic3apZUK9qC5sGNfXthmPXzUZ7nQPrNITa4= ++github.com/godbus/dbus v4.1.0+incompatible/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= + github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= + github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= + github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go +index 08de2997865a..d97d7b86a71b 100644 +--- a/src/pkg/utils/utils.go ++++ b/src/pkg/utils/utils.go +@@ -31,7 +31,7 @@ import ( + + "github.com/acobaugh/osrelease" + "github.com/containers/toolbox/pkg/shell" +- "github.com/godbus/dbus/v5" ++ "github.com/godbus/dbus" + "github.com/sirupsen/logrus" + "golang.org/x/sys/unix" + ) +-- +2.25.4 + diff --git a/toolbox-Make-it-build-on-aarch64.patch b/toolbox-Make-it-build-on-aarch64.patch new file mode 100644 index 0000000..b5c0b2d --- /dev/null +++ b/toolbox-Make-it-build-on-aarch64.patch @@ -0,0 +1,30 @@ +From 38d6d4702c05dfa7dd48bdd70d57348ad24ca877 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Tue, 30 Jun 2020 18:30:26 +0200 +Subject: [PATCH] pkg/utils: Make it build on aarch64 + +The syscall.Dup2 wrapper isn't defined on aarch64, which breaks the +build as: + ../../pkg/utils/utils.go:551:12: undefined: syscall.Dup2 + +https://github.com/containers/toolbox/pull/486 +--- + src/pkg/utils/utils.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go +index 08de2997865a..6d38b709fb7a 100644 +--- a/src/pkg/utils/utils.go ++++ b/src/pkg/utils/utils.go +@@ -548,7 +548,7 @@ func ShowManual(manual string) error { + stderrFdInt := int(stderrFd) + stdoutFd := os.Stdout.Fd() + stdoutFdInt := int(stdoutFd) +- if err := syscall.Dup2(stdoutFdInt, stderrFdInt); err != nil { ++ if err := syscall.Dup3(stdoutFdInt, stderrFdInt, 0); err != nil { + return errors.New("failed to redirect standard error to standard output") + } + +-- +2.25.4 + diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch new file mode 100644 index 0000000..e1ee155 --- /dev/null +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch @@ -0,0 +1,45 @@ +From e3cadcdeb59996eb28ee6499d43ebc4b9b656a21 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Mon, 29 Jun 2020 17:57:47 +0200 +Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} for + PPC64 + +The Go toolchain doesn't play well with passing compiler and linker +flags via environment variables. The linker flags require a second +level of quoting, which leaves the build system without a quote level +to assign the flags to an environment variable like GOFLAGS. + +This is one reason why Fedora doesn't have a RPM macro with only the +flags. The %{gobuild} RPM macro includes the entire 'go build ...' +invocation. + +The Go toolchain also doesn't like the LDFLAGS environment variable as +exported by Fedora's %{meson} RPM macro. + +Note that these flags are only meant for the "ppc64" CPU architecture, +and should be kept updated to match Fedora's Go guidelines. Use +'rpm --eval "%{gobuild}"' to expand the %{gobuild} macro. + +For some reason, when built on Koji, the final binary gets created as +../src/src instead of ../src/toolbox, but it doesn't happen when +building locally with 'rpmbuild -ba ...'. Hence it's necessary to +explicitly specify the name of the output binary. +--- + src/go-build-wrapper | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/go-build-wrapper b/src/go-build-wrapper +index 9bc4e68a6f2a..d62d684b78d3 100755 +--- a/src/go-build-wrapper ++++ b/src/go-build-wrapper +@@ -27,5 +27,6 @@ if ! cd "$1"; then + exit 1 + fi + +-go build -o "$2" ++unset LDFLAGS ++go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x -o "$2/toolbox" + exit "$?" +-- +2.25.4 + diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch new file mode 100644 index 0000000..6d080f7 --- /dev/null +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch @@ -0,0 +1,44 @@ +From f4471c7921bf5a779a586a9375b5fbb252a35857 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Mon, 29 Jun 2020 17:57:47 +0200 +Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} + +The Go toolchain doesn't play well with passing compiler and linker +flags via environment variables. The linker flags require a second +level of quoting, which leaves the build system without a quote level +to assign the flags to an environment variable like GOFLAGS. + +This is one reason why Fedora doesn't have a RPM macro with only the +flags. The %{gobuild} RPM macro includes the entire 'go build ...' +invocation. + +The Go toolchain also doesn't like the LDFLAGS environment variable as +exported by Fedora's %{meson} RPM macro. + +Note that these flags are meant for every CPU architecture other than +PPC64, and should be kept updated to match Fedora's Go guidelines. Use +'rpm --eval "%{gobuild}"' to expand the %{gobuild} macro. + +For some reason, when built on Koji, the final binary gets created as +../src/src instead of ../src/toolbox, but it doesn't happen when +building locally with 'rpmbuild -ba ...'. Hence it's necessary to +explicitly specify the name of the output binary. +--- + src/go-build-wrapper | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/go-build-wrapper b/src/go-build-wrapper +index 9bc4e68a6f2a..41aed1ca3d9f 100755 +--- a/src/go-build-wrapper ++++ b/src/go-build-wrapper +@@ -27,5 +27,6 @@ if ! cd "$1"; then + exit 1 + fi + +-go build -o "$2" ++unset LDFLAGS ++go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x -o "$2/toolbox" + exit "$?" +-- +2.25.4 + diff --git a/toolbox.spec b/toolbox.spec index 60e9ef6..2acb9cb 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,16 +1,33 @@ Name: toolbox -Version: 0.0.18 -Release: 3%{?dist} +Version: 0.0.91 + +%global goipath github.com/containers/%{name} +%gometa + +Release: 1%{?dist} Summary: Unprivileged development environment License: ASL 2.0 URL: https://github.com/containers/%{name} Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz -BuildArch: noarch +Patch0: toolbox-Make-it-build-on-aarch64.patch + +# Fedora specific +Patch100: toolbox-Don-t-use-Go-s-semantic-import-versioning.patch +Patch101: toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch +Patch102: toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch BuildRequires: ShellCheck +BuildRequires: golang >= 1.13 BuildRequires: golang-github-cpuguy83-md2man +BuildRequires: golang(github.com/HarryMichal/go-version) +BuildRequires: golang(github.com/acobaugh/osrelease) +BuildRequires: golang(github.com/briandowns/spinner) >= 1.10.0 +BuildRequires: golang(github.com/godbus/dbus) >= 5.0.3 +BuildRequires: golang(github.com/sirupsen/logrus) >= 1.4.2 +BuildRequires: golang(github.com/spf13/cobra) >= 0.0.5 +BuildRequires: golang(golang.org/x/sys/unix) BuildRequires: meson BuildRequires: pkgconfig(bash-completion) BuildRequires: systemd @@ -97,10 +114,24 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %prep -%autosetup +%setup -q +%patch0 -p1 +%patch100 -p1 + +%ifnarch ppc64 +%patch101 -p1 +%else +%patch102 -p1 +%endif + +%gomkdir %build +export GO111MODULE=off +export GOPATH=%{gobuilddir}:%{gopath} +ln -s src/cmd cmd +ln -s src/pkg pkg %meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d %meson_build @@ -114,7 +145,7 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %files -%doc NEWS README.md +%doc CODE-OF-CONDUCT.md NEWS README.md SECURITY.md %license COPYING %{_bindir}/%{name} %{_datadir}/bash-completion @@ -129,6 +160,9 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %changelog +* Fri Jul 03 2020 Harry Míchal - 0.0.91-1 +- Update to 0.0.91 + * Tue Jul 21 2020 Debarshi Ray - 0.0.18-3 - Remove ExclusiveArch to match Podman From 926409fc5cef34760d9584bfcf8a8244475bed30 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 21 Jul 2020 18:06:02 +0200 Subject: [PATCH 13/20] Fix %changelog --- toolbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.spec b/toolbox.spec index 2acb9cb..ca7b64d 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -160,7 +160,7 @@ ln -s src/pkg pkg %changelog -* Fri Jul 03 2020 Harry Míchal - 0.0.91-1 +* Tue Jul 21 2020 Harry Míchal - 0.0.91-1 - Update to 0.0.91 * Tue Jul 21 2020 Debarshi Ray - 0.0.18-3 From 2e757c8dadd05f461f3a0803c0c94fa61050c58e Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 3 Jul 2020 15:36:51 +0200 Subject: [PATCH 14/20] Fix the 'toolbox --version' output Even though the actual release is 0.0.91, 'toolbox --version' was showing 0.0.90. --- ...e-version-from-Meson-into-the-binary.patch | 173 ++++++++++++++++++ ...ags-match-Fedora-s-gobuild-for-PPC64.patch | 8 +- ...e-build-flags-match-Fedora-s-gobuild.patch | 8 +- toolbox.spec | 7 +- 4 files changed, 187 insertions(+), 9 deletions(-) create mode 100644 toolbox-Embed-the-version-from-Meson-into-the-binary.patch diff --git a/toolbox-Embed-the-version-from-Meson-into-the-binary.patch b/toolbox-Embed-the-version-from-Meson-into-the-binary.patch new file mode 100644 index 0000000..5c7e302 --- /dev/null +++ b/toolbox-Embed-the-version-from-Meson-into-the-binary.patch @@ -0,0 +1,173 @@ +From 982f10e29bd9def93272ef48a2b5ae8a20831b8a Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 3 Jul 2020 14:48:37 +0200 +Subject: [PATCH 1/3] pkg/version: Mark variable as private since there's an + accessor for it + +Clients of this package should use the GetVersion function to get the +version as a string. The variable that actually stores the version +information is an implementation detail and meant to be private. + +https://github.com/containers/toolbox/pull/487 +--- + src/pkg/version/version.go | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/pkg/version/version.go b/src/pkg/version/version.go +index 13c4449ec1b0..b35d9f94351e 100644 +--- a/src/pkg/version/version.go ++++ b/src/pkg/version/version.go +@@ -25,8 +25,8 @@ type Version struct { + Micro int + } + +-// CurrentVersion holds the information about current build version +-var CurrentVersion = Version{ ++// currentVersion holds the information about current build version ++var currentVersion = Version{ + Major: 0, + Minor: 0, + Micro: 90, +@@ -34,5 +34,5 @@ var CurrentVersion = Version{ + + // GetVersion returns string with the version of Toolbox + func GetVersion() string { +- return fmt.Sprintf("%d.%d.%d", CurrentVersion.Major, CurrentVersion.Minor, CurrentVersion.Micro) ++ return fmt.Sprintf("%d.%d.%d", currentVersion.Major, currentVersion.Minor, currentVersion.Micro) + } +-- +2.25.4 + + +From ad87a30caf7a51b8862b993c38170eee128feb74 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 3 Jul 2020 14:52:51 +0200 +Subject: [PATCH 2/3] pkg/version: Use a string, not a struct, to for the + version information + +The subsequent commit will automatically embed the project's version +encoded in Meson into the toolbox binary during the build. This will +remove the need to manually update the version information in the Go +source code. Consolidating the version information reduces the chances +of human error while making a new release. Note, how the 0.0.91 release +forgot to update the version in the Go sources. + +This will be done by feeding the version string from Meson into +go-build-wrapper, which will use Go's -X linker flag to embed it into +the final toolbox binary. Since Meson stores the version information +as a string, it's convenient to have the Go code do the same. + +https://github.com/containers/toolbox/pull/487 +--- + src/pkg/version/version.go | 19 ++++--------------- + 1 file changed, 4 insertions(+), 15 deletions(-) + +diff --git a/src/pkg/version/version.go b/src/pkg/version/version.go +index b35d9f94351e..bbee41f9cde6 100644 +--- a/src/pkg/version/version.go ++++ b/src/pkg/version/version.go +@@ -16,23 +16,12 @@ + + package version + +-import "fmt" +- +-// Version is the version of Toolbox +-type Version struct { +- Major int +- Minor int +- Micro int +-} +- + // currentVersion holds the information about current build version +-var currentVersion = Version{ +- Major: 0, +- Minor: 0, +- Micro: 90, +-} ++var ( ++ currentVersion = "0.0.90" ++) + + // GetVersion returns string with the version of Toolbox + func GetVersion() string { +- return fmt.Sprintf("%d.%d.%d", currentVersion.Major, currentVersion.Minor, currentVersion.Micro) ++ return currentVersion + } +-- +2.25.4 + + +From b5552d3351135096de6b0f4301746e15e1e4c59e Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Fri, 3 Jul 2020 15:01:23 +0200 +Subject: [PATCH 3/3] build, pkg/version: Embed the version from Meson into the + binary + +This removes the need to manually update the version in the Go source +code when making a release. + +https://github.com/containers/toolbox/pull/487 +--- + src/go-build-wrapper | 6 +++--- + src/meson.build | 7 ++++++- + src/pkg/version/version.go | 2 +- + 3 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/src/go-build-wrapper b/src/go-build-wrapper +index 9bc4e68a6f2a..e05b629755b0 100755 +--- a/src/go-build-wrapper ++++ b/src/go-build-wrapper +@@ -16,9 +16,9 @@ + # + + +-if [ "$#" -ne 2 ]; then ++if [ "$#" -ne 3 ]; then + echo "go-build-wrapper: wrong arguments" >&2 +- echo "Usage: go-build-wrapper [SOURCE DIR] [OUTPUT DIR]" >&2 ++ echo "Usage: go-build-wrapper [SOURCE DIR] [OUTPUT DIR] [VERSION]" >&2 + exit 1 + fi + +@@ -27,5 +27,5 @@ if ! cd "$1"; then + exit 1 + fi + +-go build -o "$2" ++go build -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" + exit "$?" +diff --git a/src/meson.build b/src/meson.build +index 0122bc45a066..770d6dc4f63c 100644 +--- a/src/meson.build ++++ b/src/meson.build +@@ -22,7 +22,12 @@ sources = files( + custom_target( + 'toolbox', + build_by_default: true, +- command: [go_build_wrapper_program, meson.current_source_dir(), meson.current_build_dir()], ++ command: [ ++ go_build_wrapper_program, ++ meson.current_source_dir(), ++ meson.current_build_dir(), ++ meson.project_version(), ++ ], + input: sources, + install: true, + install_dir: get_option('bindir'), +diff --git a/src/pkg/version/version.go b/src/pkg/version/version.go +index bbee41f9cde6..2aa6cad6c939 100644 +--- a/src/pkg/version/version.go ++++ b/src/pkg/version/version.go +@@ -18,7 +18,7 @@ package version + + // currentVersion holds the information about current build version + var ( +- currentVersion = "0.0.90" ++ currentVersion string + ) + + // GetVersion returns string with the version of Toolbox +-- +2.25.4 + diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch index e1ee155..ec442f3 100644 --- a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch @@ -1,4 +1,4 @@ -From e3cadcdeb59996eb28ee6499d43ebc4b9b656a21 Mon Sep 17 00:00:00 2001 +From cfd98ecda0e92c237a6b65dccea14dd98b579044 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} for @@ -29,16 +29,16 @@ explicitly specify the name of the output binary. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index 9bc4e68a6f2a..d62d684b78d3 100755 +index e05b629755b0..ec6b9f68bb05 100755 --- a/src/go-build-wrapper +++ b/src/go-build-wrapper @@ -27,5 +27,6 @@ if ! cd "$1"; then exit 1 fi --go build -o "$2" +-go build -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +unset LDFLAGS -+go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x -o "$2/toolbox" ++go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" exit "$?" -- 2.25.4 diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch index 6d080f7..05ad694 100644 --- a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch @@ -1,4 +1,4 @@ -From f4471c7921bf5a779a586a9375b5fbb252a35857 Mon Sep 17 00:00:00 2001 +From 9d5cf38e4e7a07f4850bb4cfae5dac8d6e9bb33a Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} @@ -28,16 +28,16 @@ explicitly specify the name of the output binary. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index 9bc4e68a6f2a..41aed1ca3d9f 100755 +index e05b629755b0..a0caf628435a 100755 --- a/src/go-build-wrapper +++ b/src/go-build-wrapper @@ -27,5 +27,6 @@ if ! cd "$1"; then exit 1 fi --go build -o "$2" +-go build -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +unset LDFLAGS -+go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x -o "$2/toolbox" ++go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" exit "$?" -- 2.25.4 diff --git a/toolbox.spec b/toolbox.spec index ca7b64d..1220ab9 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -4,7 +4,7 @@ Version: 0.0.91 %global goipath github.com/containers/%{name} %gometa -Release: 1%{?dist} +Release: 2%{?dist} Summary: Unprivileged development environment License: ASL 2.0 @@ -12,6 +12,7 @@ URL: https://github.com/containers/%{name} Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz Patch0: toolbox-Make-it-build-on-aarch64.patch +Patch1: toolbox-Embed-the-version-from-Meson-into-the-binary.patch # Fedora specific Patch100: toolbox-Don-t-use-Go-s-semantic-import-versioning.patch @@ -116,6 +117,7 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %prep %setup -q %patch0 -p1 +%patch1 -p1 %patch100 -p1 %ifnarch ppc64 @@ -160,6 +162,9 @@ ln -s src/pkg pkg %changelog +* Tue Jul 21 2020 Debarshi Ray - 0.0.91-2 +- Fix the 'toolbox --version' output + * Tue Jul 21 2020 Harry Míchal - 0.0.91-1 - Update to 0.0.91 From 2c2862e62aa4f8f1d86bc9319d7b210fdc125221 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 3 Jul 2020 16:08:39 +0200 Subject: [PATCH 15/20] Update to 0.0.92 --- .gitignore | 1 + sources | 2 +- ...e-version-from-Meson-into-the-binary.patch | 173 ------------------ toolbox-Make-it-build-on-aarch64.patch | 30 --- toolbox.spec | 12 +- 5 files changed, 7 insertions(+), 211 deletions(-) delete mode 100644 toolbox-Embed-the-version-from-Meson-into-the-binary.patch delete mode 100644 toolbox-Make-it-build-on-aarch64.patch diff --git a/.gitignore b/.gitignore index f0c7329..3868b19 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /toolbox-0.0.17.tar.xz /toolbox-0.0.18.tar.xz /toolbox-0.0.91.tar.xz +/toolbox-0.0.92.tar.xz diff --git a/sources b/sources index 33a10ae..d656451 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.91.tar.xz) = 5448abb21016003960484203cb550b47a679c852beb205d187a374870bb37c6c68fa25da24d193d557f196906d5b19a9457548987d058945ac4624a27ad7861f +SHA512 (toolbox-0.0.92.tar.xz) = c60e7284489fa84b1901be14f6efb0963d94f245f32590d81c6134b93f1b8cb50d9b9f257e58a7cf1b5f21788e5a0543b6ba0ac863366238c81aa09d632c9ca2 diff --git a/toolbox-Embed-the-version-from-Meson-into-the-binary.patch b/toolbox-Embed-the-version-from-Meson-into-the-binary.patch deleted file mode 100644 index 5c7e302..0000000 --- a/toolbox-Embed-the-version-from-Meson-into-the-binary.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 982f10e29bd9def93272ef48a2b5ae8a20831b8a Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Fri, 3 Jul 2020 14:48:37 +0200 -Subject: [PATCH 1/3] pkg/version: Mark variable as private since there's an - accessor for it - -Clients of this package should use the GetVersion function to get the -version as a string. The variable that actually stores the version -information is an implementation detail and meant to be private. - -https://github.com/containers/toolbox/pull/487 ---- - src/pkg/version/version.go | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/pkg/version/version.go b/src/pkg/version/version.go -index 13c4449ec1b0..b35d9f94351e 100644 ---- a/src/pkg/version/version.go -+++ b/src/pkg/version/version.go -@@ -25,8 +25,8 @@ type Version struct { - Micro int - } - --// CurrentVersion holds the information about current build version --var CurrentVersion = Version{ -+// currentVersion holds the information about current build version -+var currentVersion = Version{ - Major: 0, - Minor: 0, - Micro: 90, -@@ -34,5 +34,5 @@ var CurrentVersion = Version{ - - // GetVersion returns string with the version of Toolbox - func GetVersion() string { -- return fmt.Sprintf("%d.%d.%d", CurrentVersion.Major, CurrentVersion.Minor, CurrentVersion.Micro) -+ return fmt.Sprintf("%d.%d.%d", currentVersion.Major, currentVersion.Minor, currentVersion.Micro) - } --- -2.25.4 - - -From ad87a30caf7a51b8862b993c38170eee128feb74 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Fri, 3 Jul 2020 14:52:51 +0200 -Subject: [PATCH 2/3] pkg/version: Use a string, not a struct, to for the - version information - -The subsequent commit will automatically embed the project's version -encoded in Meson into the toolbox binary during the build. This will -remove the need to manually update the version information in the Go -source code. Consolidating the version information reduces the chances -of human error while making a new release. Note, how the 0.0.91 release -forgot to update the version in the Go sources. - -This will be done by feeding the version string from Meson into -go-build-wrapper, which will use Go's -X linker flag to embed it into -the final toolbox binary. Since Meson stores the version information -as a string, it's convenient to have the Go code do the same. - -https://github.com/containers/toolbox/pull/487 ---- - src/pkg/version/version.go | 19 ++++--------------- - 1 file changed, 4 insertions(+), 15 deletions(-) - -diff --git a/src/pkg/version/version.go b/src/pkg/version/version.go -index b35d9f94351e..bbee41f9cde6 100644 ---- a/src/pkg/version/version.go -+++ b/src/pkg/version/version.go -@@ -16,23 +16,12 @@ - - package version - --import "fmt" -- --// Version is the version of Toolbox --type Version struct { -- Major int -- Minor int -- Micro int --} -- - // currentVersion holds the information about current build version --var currentVersion = Version{ -- Major: 0, -- Minor: 0, -- Micro: 90, --} -+var ( -+ currentVersion = "0.0.90" -+) - - // GetVersion returns string with the version of Toolbox - func GetVersion() string { -- return fmt.Sprintf("%d.%d.%d", currentVersion.Major, currentVersion.Minor, currentVersion.Micro) -+ return currentVersion - } --- -2.25.4 - - -From b5552d3351135096de6b0f4301746e15e1e4c59e Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Fri, 3 Jul 2020 15:01:23 +0200 -Subject: [PATCH 3/3] build, pkg/version: Embed the version from Meson into the - binary - -This removes the need to manually update the version in the Go source -code when making a release. - -https://github.com/containers/toolbox/pull/487 ---- - src/go-build-wrapper | 6 +++--- - src/meson.build | 7 ++++++- - src/pkg/version/version.go | 2 +- - 3 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index 9bc4e68a6f2a..e05b629755b0 100755 ---- a/src/go-build-wrapper -+++ b/src/go-build-wrapper -@@ -16,9 +16,9 @@ - # - - --if [ "$#" -ne 2 ]; then -+if [ "$#" -ne 3 ]; then - echo "go-build-wrapper: wrong arguments" >&2 -- echo "Usage: go-build-wrapper [SOURCE DIR] [OUTPUT DIR]" >&2 -+ echo "Usage: go-build-wrapper [SOURCE DIR] [OUTPUT DIR] [VERSION]" >&2 - exit 1 - fi - -@@ -27,5 +27,5 @@ if ! cd "$1"; then - exit 1 - fi - --go build -o "$2" -+go build -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" - exit "$?" -diff --git a/src/meson.build b/src/meson.build -index 0122bc45a066..770d6dc4f63c 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -22,7 +22,12 @@ sources = files( - custom_target( - 'toolbox', - build_by_default: true, -- command: [go_build_wrapper_program, meson.current_source_dir(), meson.current_build_dir()], -+ command: [ -+ go_build_wrapper_program, -+ meson.current_source_dir(), -+ meson.current_build_dir(), -+ meson.project_version(), -+ ], - input: sources, - install: true, - install_dir: get_option('bindir'), -diff --git a/src/pkg/version/version.go b/src/pkg/version/version.go -index bbee41f9cde6..2aa6cad6c939 100644 ---- a/src/pkg/version/version.go -+++ b/src/pkg/version/version.go -@@ -18,7 +18,7 @@ package version - - // currentVersion holds the information about current build version - var ( -- currentVersion = "0.0.90" -+ currentVersion string - ) - - // GetVersion returns string with the version of Toolbox --- -2.25.4 - diff --git a/toolbox-Make-it-build-on-aarch64.patch b/toolbox-Make-it-build-on-aarch64.patch deleted file mode 100644 index b5c0b2d..0000000 --- a/toolbox-Make-it-build-on-aarch64.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 38d6d4702c05dfa7dd48bdd70d57348ad24ca877 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray -Date: Tue, 30 Jun 2020 18:30:26 +0200 -Subject: [PATCH] pkg/utils: Make it build on aarch64 - -The syscall.Dup2 wrapper isn't defined on aarch64, which breaks the -build as: - ../../pkg/utils/utils.go:551:12: undefined: syscall.Dup2 - -https://github.com/containers/toolbox/pull/486 ---- - src/pkg/utils/utils.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go -index 08de2997865a..6d38b709fb7a 100644 ---- a/src/pkg/utils/utils.go -+++ b/src/pkg/utils/utils.go -@@ -548,7 +548,7 @@ func ShowManual(manual string) error { - stderrFdInt := int(stderrFd) - stdoutFd := os.Stdout.Fd() - stdoutFdInt := int(stdoutFd) -- if err := syscall.Dup2(stdoutFdInt, stderrFdInt); err != nil { -+ if err := syscall.Dup3(stdoutFdInt, stderrFdInt, 0); err != nil { - return errors.New("failed to redirect standard error to standard output") - } - --- -2.25.4 - diff --git a/toolbox.spec b/toolbox.spec index 1220ab9..decd505 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,19 +1,16 @@ Name: toolbox -Version: 0.0.91 +Version: 0.0.92 %global goipath github.com/containers/%{name} %gometa -Release: 2%{?dist} +Release: 1%{?dist} Summary: Unprivileged development environment License: ASL 2.0 URL: https://github.com/containers/%{name} Source0: https://github.com/containers/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz -Patch0: toolbox-Make-it-build-on-aarch64.patch -Patch1: toolbox-Embed-the-version-from-Meson-into-the-binary.patch - # Fedora specific Patch100: toolbox-Don-t-use-Go-s-semantic-import-versioning.patch Patch101: toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch @@ -116,8 +113,6 @@ Dockerfile if the image isn't based on the fedora-toolbox image. %prep %setup -q -%patch0 -p1 -%patch1 -p1 %patch100 -p1 %ifnarch ppc64 @@ -162,6 +157,9 @@ ln -s src/pkg pkg %changelog +* Tue Jul 21 2020 Debarshi Ray - 0.0.92-1 +- Update to 0.0.92 + * Tue Jul 21 2020 Debarshi Ray - 0.0.91-2 - Fix the 'toolbox --version' output From 41bc5089398764c3fd3557d51a00f3d68d39ee9e Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 9 Jul 2020 17:01:25 +0200 Subject: [PATCH 16/20] Update to 0.0.93 --- .gitignore | 1 + sources | 2 +- ...-use-Go-s-semantic-import-versioning.patch | 24 +++++++++---------- ...ags-match-Fedora-s-gobuild-for-PPC64.patch | 6 ++--- ...e-build-flags-match-Fedora-s-gobuild.patch | 6 ++--- toolbox.spec | 7 +++++- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 3868b19..f5b798f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /toolbox-0.0.18.tar.xz /toolbox-0.0.91.tar.xz /toolbox-0.0.92.tar.xz +/toolbox-0.0.93.tar.xz diff --git a/sources b/sources index d656451..bcccc11 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.92.tar.xz) = c60e7284489fa84b1901be14f6efb0963d94f245f32590d81c6134b93f1b8cb50d9b9f257e58a7cf1b5f21788e5a0543b6ba0ac863366238c81aa09d632c9ca2 +SHA512 (toolbox-0.0.93.tar.xz) = bab8668b04572ebd2f8aac95b06f8d826e50cce448f272ecb0644e139d5bc949736f3710041040e0c6a59f92123c4edc21f8a893d152778b76332ca5ee940a2c diff --git a/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch b/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch index 88a4c43..537dfbb 100644 --- a/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch +++ b/toolbox-Don-t-use-Go-s-semantic-import-versioning.patch @@ -1,4 +1,4 @@ -From 4a1fc0c94f48c281acd1588f35c3bb95a1a1e2f2 Mon Sep 17 00:00:00 2001 +From deac27651c22ad6e3a4045706c4c35292df736e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harry=20M=C3=ADchal?= Date: Sat, 27 Jun 2020 16:17:56 +0200 Subject: [PATCH] Don't use Go's semantic import versioning @@ -15,7 +15,7 @@ https://github.com/containers/toolbox/pull/484 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd/create.go b/src/cmd/create.go -index 80e4f8c36ca4..98df9d248466 100644 +index 0b78572f4e5c..0b8c30f40297 100644 --- a/src/cmd/create.go +++ b/src/cmd/create.go @@ -28,7 +28,7 @@ import ( @@ -26,25 +26,25 @@ index 80e4f8c36ca4..98df9d248466 100644 + "github.com/godbus/dbus" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - ) + "golang.org/x/crypto/ssh/terminal" diff --git a/src/go.mod b/src/go.mod -index 07891e13a612..45e490f38907 100644 +index 2b1ac3018c8d..e8c4452c341d 100644 --- a/src/go.mod +++ b/src/go.mod -@@ -6,7 +6,7 @@ require ( - github.com/HarryMichal/go-version v1.0.0 +@@ -7,7 +7,7 @@ require ( github.com/acobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249 github.com/briandowns/spinner v1.10.0 + github.com/docker/go-units v0.4.0 - github.com/godbus/dbus/v5 v5.0.3 + github.com/godbus/dbus v4.1.0+incompatible github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v0.0.5 - golang.org/x/sys v0.0.0-20190422165155-953cdadca894 + golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 diff --git a/src/go.sum b/src/go.sum -index 5ee0d2179a39..5be421de9b13 100644 +index 4d6a0034d990..3b33ef9faec8 100644 --- a/src/go.sum +++ b/src/go.sum -@@ -15,8 +15,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs +@@ -17,8 +17,8 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -56,13 +56,13 @@ index 5ee0d2179a39..5be421de9b13 100644 github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go -index 08de2997865a..d97d7b86a71b 100644 +index 634d981e8967..db60739271cf 100644 --- a/src/pkg/utils/utils.go +++ b/src/pkg/utils/utils.go -@@ -31,7 +31,7 @@ import ( - +@@ -33,7 +33,7 @@ import ( "github.com/acobaugh/osrelease" "github.com/containers/toolbox/pkg/shell" + "github.com/docker/go-units" - "github.com/godbus/dbus/v5" + "github.com/godbus/dbus" "github.com/sirupsen/logrus" diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch index ec442f3..f5ce5df 100644 --- a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch @@ -1,4 +1,4 @@ -From cfd98ecda0e92c237a6b65dccea14dd98b579044 Mon Sep 17 00:00:00 2001 +From d83d1f87082cc1cfb3c71844c8266787a258faba Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} for @@ -29,14 +29,14 @@ explicitly specify the name of the output binary. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index e05b629755b0..ec6b9f68bb05 100755 +index 8f84277ed6d8..ec6b9f68bb05 100755 --- a/src/go-build-wrapper +++ b/src/go-build-wrapper @@ -27,5 +27,6 @@ if ! cd "$1"; then exit 1 fi --go build -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +-go build -trimpath -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +unset LDFLAGS +go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" exit "$?" diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch index 05ad694..26afa79 100644 --- a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch @@ -1,4 +1,4 @@ -From 9d5cf38e4e7a07f4850bb4cfae5dac8d6e9bb33a Mon Sep 17 00:00:00 2001 +From 3d5733cc7fe1ad7f6675a948c6f40d1dcbe290ca Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} @@ -28,14 +28,14 @@ explicitly specify the name of the output binary. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index e05b629755b0..a0caf628435a 100755 +index 8f84277ed6d8..a0caf628435a 100755 --- a/src/go-build-wrapper +++ b/src/go-build-wrapper @@ -27,5 +27,6 @@ if ! cd "$1"; then exit 1 fi --go build -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +-go build -trimpath -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +unset LDFLAGS +go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" exit "$?" diff --git a/toolbox.spec b/toolbox.spec index decd505..5be5210 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.92 +Version: 0.0.93 %global goipath github.com/containers/%{name} %gometa @@ -22,7 +22,9 @@ BuildRequires: golang-github-cpuguy83-md2man BuildRequires: golang(github.com/HarryMichal/go-version) BuildRequires: golang(github.com/acobaugh/osrelease) BuildRequires: golang(github.com/briandowns/spinner) >= 1.10.0 +BuildRequires: golang(github.com/docker/go-units) >= 0.4.0 BuildRequires: golang(github.com/godbus/dbus) >= 5.0.3 +BuildRequires: golang(github.com/mattn/go-isatty) >= 0.0.12 BuildRequires: golang(github.com/sirupsen/logrus) >= 1.4.2 BuildRequires: golang(github.com/spf13/cobra) >= 0.0.5 BuildRequires: golang(golang.org/x/sys/unix) @@ -157,6 +159,9 @@ ln -s src/pkg pkg %changelog +* Wed Aug 19 2020 Debarshi Ray - 0.0.93-1 +- Update to 0.0.93 + * Tue Jul 21 2020 Debarshi Ray - 0.0.92-1 - Update to 0.0.92 From 0e63cc440db2af0fd213f51966681e8d77caedc8 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 24 Aug 2020 19:39:43 +0200 Subject: [PATCH 17/20] Update to 0.0.94 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on code written by Ondřej Míchal. --- .gitignore | 1 + sources | 2 +- ...lags-match-Fedora-s-gobuild-for-PPC64.patch | 8 ++++---- ...he-build-flags-match-Fedora-s-gobuild.patch | 8 ++++---- toolbox.spec | 18 +++++++++++++++++- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index f5b798f..e28a0ab 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /toolbox-0.0.91.tar.xz /toolbox-0.0.92.tar.xz /toolbox-0.0.93.tar.xz +/toolbox-0.0.94.tar.xz diff --git a/sources b/sources index bcccc11..030f088 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.93.tar.xz) = bab8668b04572ebd2f8aac95b06f8d826e50cce448f272ecb0644e139d5bc949736f3710041040e0c6a59f92123c4edc21f8a893d152778b76332ca5ee940a2c +SHA512 (toolbox-0.0.94.tar.xz) = 1acff39a7308bd563f3ca232aa59d341d890bfab22e95f91bb57bddabcec6ab23d7c367fe1ac54c637f1de5acee160beacda1244d6de2f713e8d7c26031af96b diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch index f5ce5df..7e03497 100644 --- a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild-for-PPC64.patch @@ -1,4 +1,4 @@ -From d83d1f87082cc1cfb3c71844c8266787a258faba Mon Sep 17 00:00:00 2001 +From d70e3b4bf7825e67f57373fcd6e8da5ed1d5b461 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} for @@ -29,16 +29,16 @@ explicitly specify the name of the output binary. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index 8f84277ed6d8..ec6b9f68bb05 100755 +index f061a1c5ccf6..8baaff53b329 100755 --- a/src/go-build-wrapper +++ b/src/go-build-wrapper @@ -27,5 +27,6 @@ if ! cd "$1"; then exit 1 fi --go build -trimpath -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +-go build -trimpath -ldflags "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +unset LDFLAGS -+go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" ++go build -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" exit "$?" -- 2.25.4 diff --git a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch index 26afa79..4a8661c 100644 --- a/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch +++ b/toolbox-Make-the-build-flags-match-Fedora-s-gobuild.patch @@ -1,4 +1,4 @@ -From 3d5733cc7fe1ad7f6675a948c6f40d1dcbe290ca Mon Sep 17 00:00:00 2001 +From b1d265c4529eb0b23d10633326c075d54e07772f Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 29 Jun 2020 17:57:47 +0200 Subject: [PATCH] build: Make the build flags match Fedora's %{gobuild} @@ -28,16 +28,16 @@ explicitly specify the name of the output binary. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/go-build-wrapper b/src/go-build-wrapper -index 8f84277ed6d8..a0caf628435a 100755 +index f061a1c5ccf6..013a35e52a1a 100755 --- a/src/go-build-wrapper +++ b/src/go-build-wrapper @@ -27,5 +27,6 @@ if ! cd "$1"; then exit 1 fi --go build -trimpath -ldflags "-X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +-go build -trimpath -ldflags "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -o "$2" +unset LDFLAGS -+go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" ++go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--wrap,pthread_sigmask $4' -linkmode external -X github.com/containers/toolbox/pkg/version.currentVersion=$3" -a -v -x -o "$2/toolbox" exit "$?" -- 2.25.4 diff --git a/toolbox.spec b/toolbox.spec index 5be5210..a6238af 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.93 +Version: 0.0.94 %global goipath github.com/containers/%{name} %gometa @@ -113,6 +113,16 @@ The %{name}-experience package should be typically installed from the Dockerfile if the image isn't based on the fedora-toolbox image. +%package tests +Summary: Tests for %{name} + +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: bats + +%description tests +The %{name}-tests package contains system tests for %{name}. + + %prep %setup -q %patch100 -p1 @@ -157,8 +167,14 @@ ln -s src/pkg pkg %files experience +%files tests +%{_datadir}/%{name} + %changelog +* Wed Aug 26 2020 Debarshi Ray - 0.0.94-1 +- Update to 0.0.94 + * Wed Aug 19 2020 Debarshi Ray - 0.0.93-1 - Update to 0.0.93 From e4d9fc5568d1f2ce713f761c01348a9ff6409b1c Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sun, 30 Aug 2020 23:19:32 +0200 Subject: [PATCH 18/20] Update date in %changelog --- toolbox.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.spec b/toolbox.spec index a6238af..1367c1f 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -172,7 +172,7 @@ ln -s src/pkg pkg %changelog -* Wed Aug 26 2020 Debarshi Ray - 0.0.94-1 +* Sun Aug 30 2020 Debarshi Ray - 0.0.94-1 - Update to 0.0.94 * Wed Aug 19 2020 Debarshi Ray - 0.0.93-1 From aeb83b9e81eccf3f84936a34ce998ca5615dff02 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sun, 30 Aug 2020 22:56:44 +0200 Subject: [PATCH 19/20] Update to 0.0.95 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e28a0ab..24b1d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /toolbox-0.0.92.tar.xz /toolbox-0.0.93.tar.xz /toolbox-0.0.94.tar.xz +/toolbox-0.0.95.tar.xz diff --git a/sources b/sources index 030f088..95f4f62 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.94.tar.xz) = 1acff39a7308bd563f3ca232aa59d341d890bfab22e95f91bb57bddabcec6ab23d7c367fe1ac54c637f1de5acee160beacda1244d6de2f713e8d7c26031af96b +SHA512 (toolbox-0.0.95.tar.xz) = 0af9587d8a47df02e15c720453cce688f732de2019ec5ff12cc317fca0faeab317e12abc25edf7bfb36bf8d6b0397071d08c736f94890c8d1f5b22bdde88ab85 diff --git a/toolbox.spec b/toolbox.spec index 1367c1f..8a38a2f 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.94 +Version: 0.0.95 %global goipath github.com/containers/%{name} %gometa @@ -172,6 +172,9 @@ ln -s src/pkg pkg %changelog +* Wed Sep 09 2020 Debarshi Ray - 0.0.95-1 +- Update to 0.0.95 + * Sun Aug 30 2020 Debarshi Ray - 0.0.94-1 - Update to 0.0.94 From 2f468d30275e21b4dd6cce4dd930b2685f2dff28 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 1 Oct 2020 20:25:44 +0200 Subject: [PATCH 20/20] Update to 0.0.96 --- .gitignore | 1 + sources | 2 +- toolbox.spec | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 24b1d9e..f5ddba1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /toolbox-0.0.93.tar.xz /toolbox-0.0.94.tar.xz /toolbox-0.0.95.tar.xz +/toolbox-0.0.96.tar.xz diff --git a/sources b/sources index 95f4f62..0650a35 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.95.tar.xz) = 0af9587d8a47df02e15c720453cce688f732de2019ec5ff12cc317fca0faeab317e12abc25edf7bfb36bf8d6b0397071d08c736f94890c8d1f5b22bdde88ab85 +SHA512 (toolbox-0.0.96.tar.xz) = 843d6c8e0c4784bc89bc5ca6042fff44b8be1f71a4d424ffd82d0900af788fcdd985476cb48680f9817dc8f5f8586a34ff3d97e00ade5afe3107f3b2ca53b04d diff --git a/toolbox.spec b/toolbox.spec index 8a38a2f..8cc9d66 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.95 +Version: 0.0.96 %global goipath github.com/containers/%{name} %gometa @@ -172,6 +172,9 @@ ln -s src/pkg pkg %changelog +* Thu Oct 15 2020 Debarshi Ray - 0.0.96-1 +- Update to 0.0.96 + * Wed Sep 09 2020 Debarshi Ray - 0.0.95-1 - Update to 0.0.95