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. 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= 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 {