Update to 0.0.92

This commit is contained in:
Debarshi Ray 2020-07-03 16:08:39 +02:00
parent 52cbc50450
commit 795a1681f9
5 changed files with 7 additions and 211 deletions

1
.gitignore vendored
View File

@ -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

View File

@ -1 +1 @@
SHA512 (toolbox-0.0.91.tar.xz) = 5448abb21016003960484203cb550b47a679c852beb205d187a374870bb37c6c68fa25da24d193d557f196906d5b19a9457548987d058945ac4624a27ad7861f
SHA512 (toolbox-0.0.92.tar.xz) = c60e7284489fa84b1901be14f6efb0963d94f245f32590d81c6134b93f1b8cb50d9b9f257e58a7cf1b5f21788e5a0543b6ba0ac863366238c81aa09d632c9ca2

View File

@ -1,173 +0,0 @@
From 982f10e29bd9def93272ef48a2b5ae8a20831b8a Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
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 <rishi@fedoraproject.org>
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 <rishi@fedoraproject.org>
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

View File

@ -1,30 +0,0 @@
From 38d6d4702c05dfa7dd48bdd70d57348ad24ca877 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <rishi@fedoraproject.org>
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

View File

@ -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
@ -112,8 +109,6 @@ Dockerfile if the image isn't based on the fedora-toolbox image.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch100 -p1
%ifnarch ppc64
@ -158,6 +153,9 @@ ln -s src/pkg pkg
%changelog
* Fri Jul 03 2020 Debarshi Ray <rishi@fedoraproject.org> - 0.0.92-1
- Update to 0.0.92
* Fri Jul 03 2020 Debarshi Ray <rishi@fedoraproject.org> - 0.0.91-2
- Fix the 'toolbox --version' output