Skip to content
Permalink
Browse files

make.go: upgrade to go 1.13 (#1278)

Also modify sftp's TempFile file opening flags (in particular drop
O_APPEND) so they're not incompatible with WriteAt.

Fixes #1280
  • Loading branch information
mpl committed Sep 26, 2019
1 parent c9f78d0 commit d342b0e26632217a93a7b9a2ce85acca0c5cd00b
Showing with 11 additions and 8 deletions.
  1. +1 −1 .travis.yml
  2. +2 −2 Dockerfile
  3. +4 −1 make.go
  4. +3 −3 misc/docker/go/Dockerfile
  5. +1 −1 pkg/blobserver/sftp/sftp.go
@@ -3,7 +3,7 @@ dist: trusty
go_import_path: perkeep.org
language: go
go:
- "1.12.x"
- "1.13.x"
before_install:
- sudo apt-get install -qq pkg-config fuse build-essential
- sudo modprobe fuse
@@ -22,11 +22,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libsqlite3-dev

ENV GOLANG_VERSION 1.12.4
ENV GOLANG_VERSION 1.13.1

WORKDIR /usr/local
RUN wget -O go.tgz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz
RUN echo "d7d1f1f88ddfe55840712dc1747f37a790cbcaa448f6c9cf51bbe10aa65442f5 go.tgz" | sha256sum -c -
RUN echo "94f874037b82ea5353f4061e543681a0e79657f787437974214629af8407d124 go.tgz" | sha256sum -c -
RUN tar -zxvf go.tgz

ENV GOROOT /usr/local/go
@@ -876,7 +876,7 @@ func validateDirInGOPATH(dir string) error {
}

const (
goVersionMinor = 12
goVersionMinor = 13
gopherJSGoMinor = 12
)

@@ -927,6 +927,9 @@ func verifyGoVersion() {
}

func verifyGopherjsGoroot(goFound string) {
if !*buildWebUI {
return
}
gopherjsGoroot = os.Getenv("CAMLI_GOPHERJS_GOROOT")
goBin := hostExeName(filepath.Join(gopherjsGoroot, "bin", "go"))
if gopherjsGoroot == "" {
@@ -8,6 +8,6 @@ RUN apt-get -y --no-install-recommends install git

# Get Go stable release
WORKDIR /tmp
RUN curl -O https://storage.googleapis.com/golang/go1.11.linux-amd64.tar.gz
RUN echo 'b3fcf280ff86558e0559e185b601c9eade0fd24c900b4c63cd14d1d38613e499 go1.11.linux-amd64.tar.gz' | sha256sum -c
RUN tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
RUN curl -O https://storage.googleapis.com/golang/go1.13.1.linux-amd64.tar.gz
RUN echo '94f874037b82ea5353f4061e543681a0e79657f787437974214629af8407d124 go1.13.1.linux-amd64.tar.gz' | sha256sum -c
RUN tar -C /usr/local -xzf go1.13.1.linux-amd64.tar.gz
@@ -392,7 +392,7 @@ func (s sftpFS) TempFile(dir, prefix string) (files.WritableFile, error) {
rand.Read(sufRand)
suffix := fmt.Sprintf("%x", sufRand)
name := path.Join(dir, prefix+suffix)
f, err := sc.OpenFile(name, os.O_CREATE|os.O_EXCL|os.O_APPEND|os.O_WRONLY)
f, err := sc.OpenFile(name, os.O_CREATE|os.O_EXCL|os.O_RDWR)
if err == nil {
return writableFile{
name: name,

0 comments on commit d342b0e

Please sign in to comment.
You can’t perform that action at this time.