From cdd799359b6f7050fc5e3aa128bf1776a95a8a68 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 27 May 2016 19:30:39 +0900 Subject: [PATCH] add build instructions --- INSTALL.md | 17 +++++++++++++++++ circle.yml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 INSTALL.md create mode 100644 circle.yml diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..aa7b961 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,17 @@ +# arc - build instructions + +arc is written in Go and all dependencies are vendored so building can be +as simple as running `go get github.com/wg/arc` or checking out the code +into a Go workspace and running `go install github.com/wg/arc`. + +Building an executable that is identical to a released binary requires a +number of conditions be met: + + 1. the Go toolchain version must be identical + 2. GOROOT, GOPATH and PWD must be identical + 3. the path separator character must be "/" + +The Go compiler creates executables with debug information containing +filesystem paths of all packages used to build the executable as well as +the working directory. Aside from that its output is deterministic, even +when cross compiling. diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..bfb9ef2 --- /dev/null +++ b/circle.yml @@ -0,0 +1,34 @@ +machine: + environment: + GOPATH: /go + PROJECT: $CIRCLE_PROJECT_REPONAME + IMPORT: github.com/$CIRCLE_PROJECT_USERNAME/$PROJECT + GOPKG: go1.6.2.linux-amd64.tar.gz + +checkout: + post: + - sudo mkdir -p $GOPATH + - sudo chown $USER $GOPATH + - mkdir -p $GOPATH/src/$IMPORT + - cp -r * $GOPATH/src/$IMPORT + +dependencies: + pre: + - sudo rm -rf /usr/local/go + - curl -O https://storage.googleapis.com/golang/$GOPKG + - sudo tar -xf $GOPKG -C /usr/local + override: + - echo 'export GOPATH=$GOPATH' >> ~/.circlerc + +test: + pre: + - go version + - go env + override: + - go test -v -race $IMPORT/... + post: + - cd /go && GOOS=darwin GOARCH=amd64 go build -o $CIRCLE_ARTIFACTS/darwin/amd64/$PROJECT $IMPORT + - cd /go && GOOS=freebsd GOARCH=amd64 go build -o $CIRCLE_ARTIFACTS/freebsd/amd64/$PROJECT $IMPORT + - cd /go && GOOS=linux GOARCH=amd64 go build -o $CIRCLE_ARTIFACTS/linux/amd64/$PROJECT $IMPORT + - cd /go && GOOS=windows GOARCH=amd64 go build -o $CIRCLE_ARTIFACTS/windows/amd64/$PROJECT.exe $IMPORT + - find $CIRCLE_ARTIFACTS -type f -exec shasum -a 256 {} \; | tee $CIRCLE_ARTIFACTS/sha256.txt