mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:14:42 +01:00
build: make go1.14 the minimum supported Go for building
This commit is contained in:
parent
e4fb5e99ef
commit
2cefae51a1
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
job_name: ['linux', 'mac_amd64', 'mac_arm64', 'windows_amd64', 'windows_386', 'other_os', 'go1.13', 'go1.14', 'go1.15']
|
job_name: ['linux', 'mac_amd64', 'mac_arm64', 'windows_amd64', 'windows_386', 'other_os', 'go1.14', 'go1.15', 'go1.16']
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- job_name: linux
|
- job_name: linux
|
||||||
@ -83,11 +83,6 @@ jobs:
|
|||||||
compile_all: true
|
compile_all: true
|
||||||
deploy: true
|
deploy: true
|
||||||
|
|
||||||
- job_name: go1.13
|
|
||||||
os: ubuntu-latest
|
|
||||||
go: '1.13.x'
|
|
||||||
quicktest: true
|
|
||||||
|
|
||||||
- job_name: go1.14
|
- job_name: go1.14
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
go: '1.14.x'
|
go: '1.14.x'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Package azureblob provides an interface to the Microsoft Azure blob object storage system
|
// Package azureblob provides an interface to the Microsoft Azure blob object storage system
|
||||||
|
|
||||||
// +build !plan9,!solaris,!js,go1.14
|
// +build !plan9,!solaris,!js
|
||||||
|
|
||||||
package azureblob
|
package azureblob
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// +build !plan9,!solaris,!js,go1.14
|
// +build !plan9,!solaris,!js
|
||||||
|
|
||||||
package azureblob
|
package azureblob
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Test AzureBlob filesystem interface
|
// Test AzureBlob filesystem interface
|
||||||
|
|
||||||
// +build !plan9,!solaris,!js,go1.14
|
// +build !plan9,!solaris,!js
|
||||||
|
|
||||||
package azureblob
|
package azureblob
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Build for azureblob for unsupported platforms to stop go complaining
|
// Build for azureblob for unsupported platforms to stop go complaining
|
||||||
// about "no buildable Go source files "
|
// about "no buildable Go source files "
|
||||||
|
|
||||||
// +build plan9 solaris js !go1.14
|
// +build plan9 solaris js
|
||||||
|
|
||||||
package azureblob
|
package azureblob
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// +build !plan9,!solaris,!js,go1.14
|
// +build !plan9,!solaris,!js
|
||||||
|
|
||||||
package azureblob
|
package azureblob
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// +build !plan9,!solaris,!js,go1.14
|
// +build !plan9,!solaris,!js
|
||||||
|
|
||||||
package azureblob
|
package azureblob
|
||||||
|
|
||||||
|
@ -50,9 +50,6 @@ then an additional 1 PiB of free space is assumed. If the remote does not
|
|||||||
[support](https://rclone.org/overview/#optional-features) the about feature
|
[support](https://rclone.org/overview/#optional-features) the about feature
|
||||||
at all, then 1 PiB is set as both the total and the free size.
|
at all, then 1 PiB is set as both the total and the free size.
|
||||||
|
|
||||||
**Note**: As of |rclone| 1.52.2, |rclone mount| now requires Go version 1.13
|
|
||||||
or newer on some platforms depending on the underlying FUSE library in use.
|
|
||||||
|
|
||||||
### Installing on Windows
|
### Installing on Windows
|
||||||
|
|
||||||
To run rclone @ on Windows, you will need to
|
To run rclone @ on Windows, you will need to
|
||||||
|
@ -185,7 +185,7 @@ kill %1
|
|||||||
|
|
||||||
## Install from source ##
|
## Install from source ##
|
||||||
|
|
||||||
Make sure you have at least [Go](https://golang.org/) go1.13
|
Make sure you have at least [Go](https://golang.org/) go1.14
|
||||||
installed. [Download go](https://golang.org/dl/) if necessary. The
|
installed. [Download go](https://golang.org/dl/) if necessary. The
|
||||||
latest release is recommended. Then
|
latest release is recommended. Then
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//+build !go1.13
|
//+build !go1.14
|
||||||
|
|
||||||
package fs
|
package fs
|
||||||
|
|
||||||
// Upgrade to Go version 1.13 to compile rclone - latest stable go
|
// Upgrade to Go version 1.14 to compile rclone - latest stable go
|
||||||
// compiler recommended.
|
// compiler recommended.
|
||||||
func init() { Go_version_1_13_required_for_compilation() }
|
func init() { Go_version_1_14_required_for_compilation() }
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/dop251/scsu"
|
||||||
"github.com/klauspost/compress/huff0"
|
"github.com/klauspost/compress/huff0"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ func DecodeBytes(table byte, data []byte) (string, error) {
|
|||||||
case tableReserved:
|
case tableReserved:
|
||||||
return "", ErrUnsupported
|
return "", ErrUnsupported
|
||||||
case tableSCSUPlain:
|
case tableSCSUPlain:
|
||||||
return scsuDecode(data)
|
return scsu.Decode(data)
|
||||||
case tableRLE:
|
case tableRLE:
|
||||||
if len(data) < 2 {
|
if len(data) < 2 {
|
||||||
return "", ErrCorrupted
|
return "", ErrCorrupted
|
||||||
@ -87,7 +88,7 @@ func DecodeBytes(table byte, data []byte) (string, error) {
|
|||||||
return "", ErrCorrupted
|
return "", ErrCorrupted
|
||||||
}
|
}
|
||||||
if table == tableSCSU {
|
if table == tableSCSU {
|
||||||
return scsuDecode(name)
|
return scsu.Decode(name)
|
||||||
}
|
}
|
||||||
return string(name), nil
|
return string(name), nil
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package filename
|
package filename
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -120,10 +119,6 @@ func TestDecode(t *testing.T) {
|
|||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
got, err := Decode(tt.encoded)
|
got, err := Decode(tt.encoded)
|
||||||
if (err != nil) != tt.wantErr {
|
if (err != nil) != tt.wantErr {
|
||||||
if err != nil && err.Error() == scsuNotEnabled && runtime.Version() < "go1.13" {
|
|
||||||
t.Skip(err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if tt.encoded == "" && tt.want != "" {
|
if tt.encoded == "" && tt.want != "" {
|
||||||
proposed := Encode(tt.want)
|
proposed := Encode(tt.want)
|
||||||
table := decodeMap[proposed[0]] - 1
|
table := decodeMap[proposed[0]] - 1
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
|
||||||
|
"github.com/dop251/scsu"
|
||||||
"github.com/klauspost/compress/huff0"
|
"github.com/klauspost/compress/huff0"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ func EncodeBytes(s string) (table byte, payload []byte) {
|
|||||||
if i == tableSCSU {
|
if i == tableSCSU {
|
||||||
var err error
|
var err error
|
||||||
olen := len(org)
|
olen := len(org)
|
||||||
org, err = scsuEncodeStrict(s, make([]byte, 0, len(org)))
|
org, err = scsu.EncodeStrict(s, make([]byte, 0, len(org)))
|
||||||
if err != nil || olen <= len(org) {
|
if err != nil || olen <= len(org) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
package filename
|
|
||||||
|
|
||||||
import "errors"
|
|
||||||
|
|
||||||
const scsuNotEnabled = "scsu encoding not enabled in this build due to old go version"
|
|
||||||
|
|
||||||
// Functions wrap scsu package, since it doesn't build on old Go versions.
|
|
||||||
// Remove once v1.13 is minimum supported version.
|
|
||||||
|
|
||||||
var scsuDecode = func(b []byte) (string, error) {
|
|
||||||
return "", errors.New(scsuNotEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
var scsuEncodeStrict = func(src string, dst []byte) ([]byte, error) {
|
|
||||||
return nil, errors.New(scsuNotEnabled)
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
// +build go1.13
|
|
||||||
|
|
||||||
package filename
|
|
||||||
|
|
||||||
import "github.com/dop251/scsu"
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
scsuDecode = scsu.Decode
|
|
||||||
scsuEncodeStrict = scsu.EncodeStrict
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user