From 9358a5fb3770e754319dd2467d75425af8fc15af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:03:25 +0000 Subject: [PATCH 1/3] build(deps): bump github.com/Azure/azure-sdk-for-go/sdk/storage/azblob Bumps [github.com/Azure/azure-sdk-for-go/sdk/storage/azblob](https://github.com/Azure/azure-sdk-for-go) from 0.5.1 to 1.0.0. - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/armcore/v0.5.1...v1.0) --- updated-dependencies: - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/storage/azblob dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d0e514220..752e88019 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/restic/restic require ( cloud.google.com/go/storage v1.30.1 github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.5.1 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 github.com/anacrolix/fuse v0.2.0 github.com/cenkalti/backoff/v4 v4.2.0 github.com/cespare/xxhash/v2 v2.2.0 diff --git a/go.sum b/go.sum index ce664c15a..493f95aad 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDr github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2 h1:+5VZ72z0Qan5Bog5C+ZkgSqUbeVUd9wgtHOrIKuc5b8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.2/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.5.1 h1:BMTdr+ib5ljLa9MxTJK8x/Ds0MbBb4MfuW5BL0zMJnI= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.5.1/go.mod h1:c6WvOhtmjNUWbLfOG1qxM/q0SPvQNSVJvolm+C52dIU= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 h1:u/LLAOFgsMv7HmNL4Qufg58y+qElGOt5qv0z1mURkRY= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0/go.mod h1:2e8rMJtl2+2j+HXbTBwnyGpm5Nou7KhvSfxOq8JpTag= github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Julusian/godocdown v0.0.0-20170816220326-6d19f8ff2df8/go.mod h1:INZr5t32rG59/5xeltqoCJoNY7e5x/3xoY9WSWVWg74= From faa83db9e477324baf90f965c771e92c0d8d76de Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 7 Apr 2023 15:05:55 +0200 Subject: [PATCH 2/3] azure: Adapt code to API change --- internal/backend/azure/azure.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/backend/azure/azure.go b/internal/backend/azure/azure.go index 02433795b..c92fa3f89 100644 --- a/internal/backend/azure/azure.go +++ b/internal/backend/azure/azure.go @@ -228,7 +228,7 @@ func (be *Backend) saveSmall(ctx context.Context, objName string, rd restic.Rewi reader := bytes.NewReader(buf) _, err = blockBlobClient.StageBlock(ctx, id, streaming.NopCloser(reader), &blockblob.StageBlockOptions{ - TransactionalContentMD5: rd.Hash(), + TransactionalValidation: blob.TransferValidationTypeMD5(rd.Hash()), }) if err != nil { return errors.Wrap(err, "StageBlock") @@ -271,7 +271,7 @@ func (be *Backend) saveLarge(ctx context.Context, objName string, rd restic.Rewi reader := bytes.NewReader(buf) debug.Log("StageBlock %v with %d bytes", id, len(buf)) _, err = blockBlobClient.StageBlock(ctx, id, streaming.NopCloser(reader), &blockblob.StageBlockOptions{ - TransactionalContentMD5: h[:], + TransactionalValidation: blob.TransferValidationTypeMD5(h[:]), }) if err != nil { From 806a0cdce3ee2542caa16dbcbf5bf279988e58b3 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 7 Apr 2023 15:31:20 +0200 Subject: [PATCH 3/3] bump minimum go version on Solaris to 1.20 --- build.go | 6 ++++++ changelog/unreleased/pull-4201 | 9 +++++++++ doc/020_installation.rst | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/pull-4201 diff --git a/build.go b/build.go index dddc3b964..b3b7f5eee 100644 --- a/build.go +++ b/build.go @@ -380,6 +380,12 @@ func main() { } } + solarisMinVersion := GoVersion{Major: 1, Minor: 20, Patch: 0} + if env["GOARCH"] == "solaris" && !goVersion.AtLeast(solarisMinVersion) { + fmt.Fprintf(os.Stderr, "Detected version %s is too old, restic requires at least %s for Solaris\n", goVersion, solarisMinVersion) + os.Exit(1) + } + verbosePrintf("detected Go version %v\n", goVersion) preserveSymbols := false diff --git a/changelog/unreleased/pull-4201 b/changelog/unreleased/pull-4201 new file mode 100644 index 000000000..500bbdbb1 --- /dev/null +++ b/changelog/unreleased/pull-4201 @@ -0,0 +1,9 @@ +Change: Require Go 1.20 for Solaris builds + +Building restic on Solaris now requires Go 1.20, as the library used to access +Azure uses the mmap syscall, which is only available on Solaris starting from +Go 1.20. + +All other platforms continue to build with Go 1.18. + +https://github.com/restic/restic/pull/4201 diff --git a/doc/020_installation.rst b/doc/020_installation.rst index 4488e31f9..4d591356d 100644 --- a/doc/020_installation.rst +++ b/doc/020_installation.rst @@ -269,7 +269,8 @@ From Source *********** restic is written in the Go programming language and you need at least -Go version 1.18. Building restic may also work with older versions of Go, +Go version 1.18. Building for Solaris requires at least Go version 1.20. +Building restic may also work with older versions of Go, but that's not supported. See the `Getting started `__ guide of the Go project for instructions how to install Go.