From 0ea81b86222b4ad3a86f0883ba6fb40a243699eb Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 10 Jun 2020 17:29:32 +0200 Subject: [PATCH 01/18] 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 b969cfd..ab5f0e9 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 @@ -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-3 +- Sync the "experience" packages with the current Dockerfile +- Make "experience" Require "support" + * Fri Jan 31 2020 Fedora Release Engineering - 0.0.18-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 4c6ab16fc6cee2fb7d23736675def70581a2a737 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 27 Jun 2020 15:45:40 +0200 Subject: [PATCH 02/18] 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 ab5f0e9..5d6e851 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 51cb8a91568adac68661d114c6f37cc2d9bb20b8 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sat, 27 Jun 2020 15:50:55 +0200 Subject: [PATCH 03/18] Remove ExclusiveArch to match Podman --- toolbox.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/toolbox.spec b/toolbox.spec index 5d6e851..652f822 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,6 +1,6 @@ Name: toolbox Version: 0.0.18 -Release: 3%{?dist} +Release: 4%{?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 +* Fri Jul 03 2020 Debarshi Ray - 0.0.18-4 +- Remove ExclusiveArch to match Podman + * Wed Jun 10 2020 Debarshi Ray - 0.0.18-3 - Sync the "experience" packages with the current Dockerfile - Make "experience" Require "support" From 96f723f2b554056be1e74df8c3e7b0a3b6ac21e7 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 04/18] 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 652f822..186e3b3 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 c648963e0515aca31bb8878e5389b197eff3a8ee Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 30 Jun 2020 14:11:35 +0200 Subject: [PATCH 05/18] 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 186e3b3..6edb1e2 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -4,7 +4,7 @@ Release: 4%{?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 8e43572b65b959d8e3fd304b1e6fc875e34cb547 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 30 Jun 2020 14:13:27 +0200 Subject: [PATCH 06/18] Update URL to point at the latest extra-packages file for Fedora 32 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 6edb1e2..392a816 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -28,7 +28,7 @@ Toolbox is offers a familiar RPM based environment for developing and debugging software that runs fully unprivileged using Podman. # The list of requires packages for -support and -experience should be in sync with: -# https://github.com/debarshiray/toolbox/blob/master/images/fedora/f31/extra-packages +# https://github.com/containers/toolbox/blob/master/images/fedora/f32/extra-packages %package support Summary: Required packages for the container image to support %{name} From 4c523a5706ab1d7f97c9c0e20f4d4952ee25c970 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 07/18] 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 392a816..08836ee 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,16 +1,33 @@ Name: toolbox -Version: 0.0.18 -Release: 4%{?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 + * Fri Jul 03 2020 Debarshi Ray - 0.0.18-4 - Remove ExclusiveArch to match Podman From c70a3fb8464cd6844b1b9240f26e5a307405b30a Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 3 Jul 2020 15:36:51 +0200 Subject: [PATCH 08/18] 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 08836ee..6148153 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 +* Fri Jul 03 2020 Debarshi Ray - 0.0.91-2 +- Fix the 'toolbox --version' output + * Fri Jul 03 2020 Harry Míchal - 0.0.91-1 - Update to 0.0.91 From 5922da1902292530ba71b584b5fd3d18395b601e Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 3 Jul 2020 16:08:39 +0200 Subject: [PATCH 09/18] 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 6148153..63761be 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 +* Fri Jul 03 2020 Debarshi Ray - 0.0.92-1 +- Update to 0.0.92 + * Fri Jul 03 2020 Debarshi Ray - 0.0.91-2 - Fix the 'toolbox --version' output From ec621c6645020c4bbd6e414460d7df8a89270a9c Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 9 Jul 2020 17:01:25 +0200 Subject: [PATCH 10/18] Update to 0.0.93 The test suite has been temporarily disabled because ShellCheck 0.7.1 triggers SC2086 for some unquoted variables. It should be re-enabled as soon as it's fixed upstream. --- .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 | 11 ++++++--- 6 files changed, 28 insertions(+), 22 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 63761be..b25765c 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) @@ -133,8 +135,8 @@ ln -s src/pkg pkg %meson_build -%check -%meson_test +# %%check +# %%meson_test %install @@ -157,6 +159,9 @@ ln -s src/pkg pkg %changelog +* Sat Jul 25 2020 Debarshi Ray - 0.0.93-1 +- Update to 0.0.93 + * Fri Jul 03 2020 Debarshi Ray - 0.0.92-1 - Update to 0.0.92 From 68dd70c5aec575e7981641b4d5cc5ad29e6a4b5a Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 24 Aug 2020 19:39:43 +0200 Subject: [PATCH 11/18] 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 +- ...ags-match-Fedora-s-gobuild-for-PPC64.patch | 8 +++---- ...e-build-flags-match-Fedora-s-gobuild.patch | 8 +++---- toolbox.spec | 22 ++++++++++++++++--- 5 files changed, 29 insertions(+), 12 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 b25765c..0b643bf 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 @@ -135,8 +145,8 @@ ln -s src/pkg pkg %meson_build -# %%check -# %%meson_test +%check +%meson_test %install @@ -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 + * Sat Jul 25 2020 Debarshi Ray - 0.0.93-1 - Update to 0.0.93 From d6f6e9266b06f755b8ca03a699b745243bb4adf9 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Sun, 30 Aug 2020 22:56:44 +0200 Subject: [PATCH 12/18] 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 0b643bf..fc9510d 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 +* Sun Aug 30 2020 Debarshi Ray - 0.0.95-1 +- Update to 0.0.95 + * Wed Aug 26 2020 Debarshi Ray - 0.0.94-1 - Update to 0.0.94 From 5444c36172a96ce5d0ff5b02b3834e534e1ded66 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 1 Oct 2020 20:25:44 +0200 Subject: [PATCH 13/18] 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 fc9510d..d087554 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 01 2020 Debarshi Ray - 0.0.96-1 +- Update to 0.0.96 + * Sun Aug 30 2020 Debarshi Ray - 0.0.95-1 - Update to 0.0.95 From 0ecd0560b926b8d68e22957d2b3ee83ee4dc84ef Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 3 Nov 2020 20:33:37 +0100 Subject: [PATCH 14/18] Update to 0.0.97 --- .gitignore | 1 + sources | 2 +- ...-use-Go-s-semantic-import-versioning.patch | 20 +++++++++---------- toolbox.spec | 6 +++++- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index f5ddba1..d0608a7 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /toolbox-0.0.94.tar.xz /toolbox-0.0.95.tar.xz /toolbox-0.0.96.tar.xz +/toolbox-0.0.97.tar.xz diff --git a/sources b/sources index 0650a35..590ca40 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.96.tar.xz) = 843d6c8e0c4784bc89bc5ca6042fff44b8be1f71a4d424ffd82d0900af788fcdd985476cb48680f9817dc8f5f8586a34ff3d97e00ade5afe3107f3b2ca53b04d +SHA512 (toolbox-0.0.97.tar.xz) = e8c9b3713346a8e1ecabda4518af3955ca2b729a7a99000b15ac8275243d81d5eb53a8accb876f89ef7320ea8bc6e683547ae5cd027ee5e5054494032727f85d 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 537dfbb..a39257b 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 deac27651c22ad6e3a4045706c4c35292df736e8 Mon Sep 17 00:00:00 2001 +From 4039c49b0cd2111cd1c505b9a9aef25aeebb6a0e 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 0b78572f4e5c..0b8c30f40297 100644 +index 50938890b22f..29bc0f2c42f7 100644 --- a/src/cmd/create.go +++ b/src/cmd/create.go @@ -28,7 +28,7 @@ import ( @@ -28,25 +28,25 @@ index 0b78572f4e5c..0b8c30f40297 100644 "github.com/spf13/cobra" "golang.org/x/crypto/ssh/terminal" diff --git a/src/go.mod b/src/go.mod -index 2b1ac3018c8d..e8c4452c341d 100644 +index 219d3d578992..7e1a6807fd7e 100644 --- a/src/go.mod +++ b/src/go.mod -@@ -7,7 +7,7 @@ require ( - github.com/acobaugh/osrelease v0.0.0-20181218015638-a93a0a55a249 +@@ -8,7 +8,7 @@ require ( github.com/briandowns/spinner v1.10.0 github.com/docker/go-units v0.4.0 + github.com/fsnotify/fsnotify v1.4.7 - github.com/godbus/dbus/v5 v5.0.3 + github.com/godbus/dbus v4.1.0+incompatible + github.com/mattn/go-isatty v0.0.8 github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v0.0.5 - golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 diff --git a/src/go.sum b/src/go.sum -index 4d6a0034d990..3b33ef9faec8 100644 +index 5a03a6823698..d9ce63604fcf 100644 --- a/src/go.sum +++ b/src/go.sum -@@ -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= +@@ -18,8 +18,8 @@ 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 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= 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= @@ -56,7 +56,7 @@ index 4d6a0034d990..3b33ef9faec8 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 634d981e8967..db60739271cf 100644 +index 5455298cbce4..3f7fc26147fc 100644 --- a/src/pkg/utils/utils.go +++ b/src/pkg/utils/utils.go @@ -33,7 +33,7 @@ import ( diff --git a/toolbox.spec b/toolbox.spec index d087554..ef74976 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.96 +Version: 0.0.97 %global goipath github.com/containers/%{name} %gometa @@ -23,6 +23,7 @@ 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/fsnotify/fsnotify) >= 1.4.7 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 @@ -172,6 +173,9 @@ ln -s src/pkg pkg %changelog +* Tue Nov 03 2020 Debarshi Ray - 0.0.97-1 +- Update to 0.0.97 + * Thu Oct 01 2020 Debarshi Ray - 0.0.96-1 - Update to 0.0.96 From b57128da101182639d1ed6926d6864f4b0b60c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20M=C3=ADchal?= Date: Wed, 25 Nov 2020 22:06:47 +0100 Subject: [PATCH 15/18] Move krb5-libs to -experience, and update the list of packages The krb5-libs package is necessary to ensure the presence of the /etc/krb5.conf.d directory with the correct permissions. However, it's not strictly necessary and toolbox(1) can work without it. No need to issue a build just for this. https://src.fedoraproject.org/rpms/toolbox/pull-request/4 --- toolbox.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolbox.spec b/toolbox.spec index ef74976..9d163f2 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -53,7 +53,6 @@ Summary: Required packages for the container image to support %{name} # These are really required to make the image work with toolbox Requires: passwd Requires: shadow-utils -Requires: krb5-libs Requires: vte-profile %description support @@ -83,12 +82,14 @@ Requires: hostname Requires: iputils Requires: jwhois Requires: keyutils +Requires: krb5-libs Requires: less Requires: lsof Requires: man-db Requires: man-pages Requires: mlocate Requires: mtr +Requires: nss-mdns Requires: openssh-clients Requires: pigz Requires: procps-ng @@ -102,6 +103,7 @@ Requires: unzip Requires: wget Requires: which Requires: words +Requires: xorg-x11-xauth Requires: xz Requires: zip From 240ed1959b29d6593dcfad5a90158912d91d8408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20M=C3=ADchal?= Date: Wed, 25 Nov 2020 22:49:41 +0100 Subject: [PATCH 16/18] Tweak the description 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 9d163f2..b36f7bd 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -57,7 +57,7 @@ Requires: vte-profile %description support The %{name}-support package contains all the required packages that are needed -to be installed in the container image to make it work with the %{name}. +to be installed in the OCI image to make it work with %{name}. The %{name}-support package should be typically installed from the Dockerfile if the image isn't based on the fedora-toolbox image. From a92ce29d8e2201f59ee1d8632a7a677330091187 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 5 Jan 2021 18:29:31 +0100 Subject: [PATCH 17/18] Update to 0.0.98 --- .gitignore | 1 + sources | 2 +- ...ild-flags-match-Fedora-s-gobuild-for-PPC64.patch | 13 ++++--------- ...ake-the-build-flags-match-Fedora-s-gobuild.patch | 13 ++++--------- toolbox.spec | 5 ++++- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index d0608a7..fa26659 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /toolbox-0.0.95.tar.xz /toolbox-0.0.96.tar.xz /toolbox-0.0.97.tar.xz +/toolbox-0.0.98.tar.xz diff --git a/sources b/sources index 590ca40..ea2ee10 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.97.tar.xz) = e8c9b3713346a8e1ecabda4518af3955ca2b729a7a99000b15ac8275243d81d5eb53a8accb876f89ef7320ea8bc6e683547ae5cd027ee5e5054494032727f85d +SHA512 (toolbox-0.0.98.tar.xz) = 52b25633fcc660bfce4a3e7df591c272dec35f1cdb63a17b529d0402e195743e7f2f034495fc100dd7ad1b479520a8369923d794833de3e10232e46ebeb8be69 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 7e03497..43df0c9 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 d70e3b4bf7825e67f57373fcd6e8da5ed1d5b461 Mon Sep 17 00:00:00 2001 +From e9bfc40bbbf7af1a20819b6840441cbe52a7d1b7 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 @@ -19,27 +19,22 @@ 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 f061a1c5ccf6..8baaff53b329 100755 +index 515e1d8a0670..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 "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -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/toolbox" +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 -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 +2.29.2 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 4a8661c..16c844d 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 b1d265c4529eb0b23d10633326c075d54e07772f Mon Sep 17 00:00:00 2001 +From d204528ce3b3c70727c12e1911d1c5562b56d474 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} @@ -18,27 +18,22 @@ 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 f061a1c5ccf6..013a35e52a1a 100755 +index 515e1d8a0670..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 "-extldflags '-Wl,--wrap,pthread_sigmask $4' -linkmode external -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/toolbox" +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 -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 +2.29.2 diff --git a/toolbox.spec b/toolbox.spec index b36f7bd..fbd21c6 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.97 +Version: 0.0.98 %global goipath github.com/containers/%{name} %gometa @@ -175,6 +175,9 @@ ln -s src/pkg pkg %changelog +* Tue Jan 05 2021 Debarshi Ray - 0.0.98-1 +- Update to 0.0.98 + * Tue Nov 03 2020 Debarshi Ray - 0.0.97-1 - Update to 0.0.97 From 68e2b3a10cf9a9fea58c72d74650d08562a81138 Mon Sep 17 00:00:00 2001 From: Alejandro Saez Morollon Date: Wed, 20 Jan 2021 16:26:27 +0000 Subject: [PATCH 18/18] Update to 0.0.99.1 Harden the binary by using the same CGO_CFLAGS as on RHEL 8. --- .gitignore | 1 + sources | 2 +- ...tify-the-terminal-when-running-as-ro.patch | 61 +++++++++++++++++++ toolbox.spec | 13 +++- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 toolbox-cmd-run-Don-t-notify-the-terminal-when-running-as-ro.patch diff --git a/.gitignore b/.gitignore index fa26659..ad230fd 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /toolbox-0.0.96.tar.xz /toolbox-0.0.97.tar.xz /toolbox-0.0.98.tar.xz +/toolbox-0.0.99.1.tar.xz diff --git a/sources b/sources index ea2ee10..668e2bc 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (toolbox-0.0.98.tar.xz) = 52b25633fcc660bfce4a3e7df591c272dec35f1cdb63a17b529d0402e195743e7f2f034495fc100dd7ad1b479520a8369923d794833de3e10232e46ebeb8be69 +SHA512 (toolbox-0.0.99.1.tar.xz) = 6021653eb7fbfc85ea700a9f52f9cfb552efbd4127eb3332a53bd340c8270c4d7a4e54b4a435202fd9e95ee0d90555a46ae9363a930b37fa35e63f239dffc027 diff --git a/toolbox-cmd-run-Don-t-notify-the-terminal-when-running-as-ro.patch b/toolbox-cmd-run-Don-t-notify-the-terminal-when-running-as-ro.patch new file mode 100644 index 0000000..8b98a1e --- /dev/null +++ b/toolbox-cmd-run-Don-t-notify-the-terminal-when-running-as-ro.patch @@ -0,0 +1,61 @@ +From bec898b4fcf56a0b94226a4b024057668793c29a Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Wed, 10 Mar 2021 12:44:13 +0100 +Subject: [PATCH] cmd/run: Don't notify the terminal when running as root + +This is a one-off and a hacky workaround for Fedora 32. + +Toolbox 0.0.98 added support for rootful toolbox containers, and as +part of that it communicates to the terminal emulator whether the +container is rootful or rootless. The idea is that GNOME Terminal +won't preserve rootful toolbox containers. Just like it doesn't +preserve the current working directory for su(1) or sudo(8) sessions. +Otherwise, it would try to spawn a rootful container as rootless +inside a new terminal and fail. + +However, the GNOME Terminal and VTE in Fedora 32 are old and don't +know how to do this. Therefore, to avoid breaking the terminal emulator +when running rootful toolbox containers, Toolbox simply doesn't emit +the notification. + +This an imperfect solution because, strictly speaking, one needs to +detect when Toolbox is running with a different UID than the terminal +emulator, and Toolbox can't know this without any help from the +terminal. Therefore, this solution won't work if the user is running +their entire graphical session as root, or is using su(1) or sudo(8) to +run an interactive shell session as another user that's not root. + +Regardless, this is still better than modifying GNOME Terminal and VTE +so late in the Fedora 32 lifecycle, and it's safe to say that rootful +toolbox containers are still an experimental feature. The cases where +this solution won't work are either unsupported environments (eg., +running the graphical session as root) or simply quite rare. +--- + src/cmd/run.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cmd/run.go b/src/cmd/run.go +index 61a100b375d4..7d1c3ae11336 100644 +--- a/src/cmd/run.go ++++ b/src/cmd/run.go +@@ -314,7 +314,7 @@ func runCommand(container string, + + execArgs = append(execArgs, command...) + +- if emitEscapeSequence { ++ if emitEscapeSequence && currentUser.Uid != "0" { + fmt.Printf("\033]777;container;push;%s;toolbox;%s\033\\", container, currentUser.Uid) + } + +@@ -326,7 +326,7 @@ func runCommand(container string, + + exitCode, err := shell.RunWithExitCode("podman", os.Stdin, os.Stdout, nil, execArgs...) + +- if emitEscapeSequence { ++ if emitEscapeSequence && currentUser.Uid != "0" { + fmt.Printf("\033]777;container;pop;;;%s\033\\", currentUser.Uid) + } + +-- +2.29.2 + diff --git a/toolbox.spec b/toolbox.spec index fbd21c6..9ef11ef 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -1,5 +1,5 @@ Name: toolbox -Version: 0.0.98 +Version: 0.0.99.1 %global goipath github.com/containers/%{name} %gometa @@ -15,6 +15,7 @@ Source0: https://github.com/containers/%{name}/releases/download/%{version 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 +Patch103: toolbox-cmd-run-Don-t-notify-the-terminal-when-running-as-ro.patch BuildRequires: ShellCheck BuildRequires: golang >= 1.13 @@ -42,8 +43,9 @@ Obsoletes: fedora-toolbox < 0.0.5-2 %description -Toolbox is offers a familiar RPM based environment for developing and -debugging software that runs fully unprivileged using Podman. +Toolbox is a tool for Linux operating systems, which allows the use of +containerized command line environments. It is built on top of Podman and +other standard container technologies from OCI. # The list of requires packages for -support and -experience should be in sync with: # https://github.com/containers/toolbox/blob/master/images/fedora/f32/extra-packages @@ -136,12 +138,14 @@ The %{name}-tests package contains system tests for %{name}. %patch102 -p1 %endif +%patch103 -p1 %gomkdir %build export GO111MODULE=off export GOPATH=%{gobuilddir}:%{gopath} +export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" ln -s src/cmd cmd ln -s src/pkg pkg %meson --buildtype=plain -Dprofile_dir=%{_sysconfdir}/profile.d @@ -175,6 +179,9 @@ ln -s src/pkg pkg %changelog +* Wed Mar 10 2021 Alejandro Sáez - 0.0.99.1-1 +- Update to 0.0.99.1 + * Tue Jan 05 2021 Debarshi Ray - 0.0.98-1 - Update to 0.0.98