all: replace dep with Go modules

We've moved to go modules, and keeping both working is burdensome.
In fact, I think dep already wasn't working.
This commit is contained in:
Ayke van Laethem
2019-08-18 18:03:47 +02:00
committed by Ron Evans
parent 02c4020228
commit 8d959b7c63
5 changed files with 37 additions and 97 deletions
+8 -6
View File
@@ -61,18 +61,19 @@ commands:
- install-node - install-node
- restore_cache: - restore_cache:
keys: keys:
- go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }} - go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
- go-cache-{{ checksum "Gopkg.lock" }} - go-cache-v2-{{ checksum "go.mod" }}
- llvm-source-linux - llvm-source-linux
- run: go install . - run: go install .
- run: go test -v - run: go test -v
- run: make gen-device -j4 - run: make gen-device -j4
- run: make smoketest RISCV=0 - run: make smoketest RISCV=0
- save_cache: - save_cache:
key: go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_BUILD_NUM }} key: go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
paths: paths:
- ~/.cache/go-build - ~/.cache/go-build
- ~/.cache/tinygo - ~/.cache/tinygo
- /go/pkg/mod
- run: make fmt-check - run: make fmt-check
build-linux: build-linux:
steps: steps:
@@ -95,8 +96,8 @@ commands:
- install-node - install-node
- restore_cache: - restore_cache:
keys: keys:
- go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }} - go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
- go-cache-{{ checksum "Gopkg.lock" }} - go-cache-v2-{{ checksum "go.mod" }}
- llvm-source-linux - llvm-source-linux
- restore_cache: - restore_cache:
keys: keys:
@@ -138,10 +139,11 @@ commands:
- store_artifacts: - store_artifacts:
path: /tmp/tinygo.linux-amd64.tar.gz path: /tmp/tinygo.linux-amd64.tar.gz
- save_cache: - save_cache:
key: go-cache-{{ checksum "Gopkg.lock" }}-{{ .Environment.CIRCLE_BUILD_NUM }} key: go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
paths: paths:
- ~/.cache/go-build - ~/.cache/go-build
- ~/.cache/tinygo - ~/.cache/tinygo
- /go/pkg/mod
- run: - run:
name: "Extract release tarball" name: "Extract release tarball"
command: | command: |
+7 -4
View File
@@ -16,7 +16,6 @@ LLVM, Clang and LLD are quite light on dependencies, requiring only standard
build tools to be built. Go is of course necessary to build TinyGo itself. build tools to be built. Go is of course necessary to build TinyGo itself.
* Go (1.11+) * Go (1.11+)
* [dep](https://golang.github.io/dep/)
* Standard build tools (gcc/clang) * Standard build tools (gcc/clang)
* git * git
* CMake * CMake
@@ -28,15 +27,19 @@ on a different system like Mac.
## Download the source ## Download the source
The first step is to download the TinyGo sources (use `--recursive` if you clone The first step is to download the TinyGo sources (use `--recursive` if you clone
the git repository). Then, inside the directory, perform these steps: the git repository). Then, inside the directory, download the LLVM source:
dep ensure -vendor-only # download Go dependencies make llvm-source
make llvm-source # download LLVM
You can also store LLVM outside of the TinyGo root directory by setting the You can also store LLVM outside of the TinyGo root directory by setting the
`LLVM_BUILDDIR`, `CLANG_SRC` and `LLD_SRC` make variables, but that is not `LLVM_BUILDDIR`, `CLANG_SRC` and `LLD_SRC` make variables, but that is not
covered by this guide. covered by this guide.
TinyGo uses Go modules, so if you clone TinyGo inside your GOPATH (and are using
Go below 1.13), make sure that Go modules are enabled:
export GO111MODULE=on
## Build LLVM, Clang, LLD ## Build LLVM, Clang, LLD
Before starting the build, you may want to set the following environment Before starting the build, you may want to set the following environment
+22 -25
View File
@@ -6,26 +6,23 @@ RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \
apt-get update && \ apt-get update && \
apt-get install -y llvm-8-dev libclang-8-dev git apt-get install -y llvm-8-dev libclang-8-dev git
RUN wget -O- https://raw.githubusercontent.com/golang/dep/master/install.sh | sh COPY . /tinygo
COPY . /go/src/github.com/tinygo-org/tinygo
# remove submodules directories and re-init them to fix any hard-coded paths # remove submodules directories and re-init them to fix any hard-coded paths
# after copying the tinygo directory in the previous step. # after copying the tinygo directory in the previous step.
RUN cd /go/src/github.com/tinygo-org/tinygo/ && \ RUN cd /tinygo/ && \
rm -rf ./lib/* && \ rm -rf ./lib/* && \
git submodule update --init --recursive --force git submodule update --init --recursive --force
RUN cd /go/src/github.com/tinygo-org/tinygo/ && \ RUN cd /tinygo/ && \
dep ensure --vendor-only && \ go install /tinygo/
go install /go/src/github.com/tinygo-org/tinygo/
# tinygo-wasm stage installs the needed dependencies to compile TinyGo programs for WASM. # tinygo-wasm stage installs the needed dependencies to compile TinyGo programs for WASM.
FROM tinygo-base AS tinygo-wasm FROM tinygo-base AS tinygo-wasm
COPY --from=tinygo-base /go/bin/tinygo /go/bin/tinygo COPY --from=tinygo-base /go/bin/tinygo /go/bin/tinygo
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/src /go/src/github.com/tinygo-org/tinygo/src COPY --from=tinygo-base /tinygo/src /tinygo/src
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/targets /go/src/github.com/tinygo-org/tinygo/targets COPY --from=tinygo-base /tinygo/targets /tinygo/targets
RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \ RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \
echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" >> /etc/apt/sources.list && \ echo "deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main" >> /etc/apt/sources.list && \
@@ -36,13 +33,13 @@ RUN wget -O- https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && \
FROM tinygo-base AS tinygo-avr FROM tinygo-base AS tinygo-avr
COPY --from=tinygo-base /go/bin/tinygo /go/bin/tinygo COPY --from=tinygo-base /go/bin/tinygo /go/bin/tinygo
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/src /go/src/github.com/tinygo-org/tinygo/src COPY --from=tinygo-base /tinygo/src /tinygo/src
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/targets /go/src/github.com/tinygo-org/tinygo/targets COPY --from=tinygo-base /tinygo/targets /tinygo/targets
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/Makefile /go/src/github.com/tinygo-org/tinygo/ COPY --from=tinygo-base /tinygo/Makefile /tinygo/
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/tools /go/src/github.com/tinygo-org/tinygo/tools COPY --from=tinygo-base /tinygo/tools /tinygo/tools
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/lib /go/src/github.com/tinygo-org/tinygo/lib COPY --from=tinygo-base /tinygo/lib /tinygo/lib
RUN cd /go/src/github.com/tinygo-org/tinygo/ && \ RUN cd /tinygo/ && \
apt-get update && \ apt-get update && \
apt-get install -y apt-utils python3 make binutils-avr gcc-avr avr-libc && \ apt-get install -y apt-utils python3 make binutils-avr gcc-avr avr-libc && \
make gen-device-avr && \ make gen-device-avr && \
@@ -54,13 +51,13 @@ RUN cd /go/src/github.com/tinygo-org/tinygo/ && \
FROM tinygo-base AS tinygo-arm FROM tinygo-base AS tinygo-arm
COPY --from=tinygo-base /go/bin/tinygo /go/bin/tinygo COPY --from=tinygo-base /go/bin/tinygo /go/bin/tinygo
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/src /go/src/github.com/tinygo-org/tinygo/src COPY --from=tinygo-base /tinygo/src /tinygo/src
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/targets /go/src/github.com/tinygo-org/tinygo/targets COPY --from=tinygo-base /tinygo/targets /tinygo/targets
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/Makefile /go/src/github.com/tinygo-org/tinygo/ COPY --from=tinygo-base /tinygo/Makefile /tinygo/
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/tools /go/src/github.com/tinygo-org/tinygo/tools COPY --from=tinygo-base /tinygo/tools /tinygo/tools
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/lib /go/src/github.com/tinygo-org/tinygo/lib COPY --from=tinygo-base /tinygo/lib /tinygo/lib
RUN cd /go/src/github.com/tinygo-org/tinygo/ && \ RUN cd /tinygo/ && \
apt-get update && \ apt-get update && \
apt-get install -y apt-utils python3 make clang-8 && \ apt-get install -y apt-utils python3 make clang-8 && \
make gen-device-nrf && make gen-device-stm32 && \ make gen-device-nrf && make gen-device-stm32 && \
@@ -71,11 +68,11 @@ RUN cd /go/src/github.com/tinygo-org/tinygo/ && \
# tinygo-all stage installs the needed dependencies to compile TinyGo programs for all platforms. # tinygo-all stage installs the needed dependencies to compile TinyGo programs for all platforms.
FROM tinygo-wasm AS tinygo-all FROM tinygo-wasm AS tinygo-all
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/Makefile /go/src/github.com/tinygo-org/tinygo/ COPY --from=tinygo-base /tinygo/Makefile /tinygo/
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/tools /go/src/github.com/tinygo-org/tinygo/tools COPY --from=tinygo-base /tinygo/tools /tinygo/tools
COPY --from=tinygo-base /go/src/github.com/tinygo-org/tinygo/lib /go/src/github.com/tinygo-org/tinygo/lib COPY --from=tinygo-base /tinygo/lib /tinygo/lib
RUN cd /go/src/github.com/tinygo-org/tinygo/ && \ RUN cd /tinygo/ && \
apt-get update && \ apt-get update && \
apt-get install -y apt-utils python3 make clang-8 binutils-avr gcc-avr avr-libc && \ apt-get install -y apt-utils python3 make clang-8 binutils-avr gcc-avr avr-libc && \
make gen-device && \ make gen-device && \
Generated
-51
View File
@@ -1,51 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
branch = "master"
digest = "1:06519a2ec1d59040eaccec40206f9d0b59dc662db2a032f974d6d6b9a2bcb839"
name = "github.com/blakesmith/ar"
packages = ["."]
pruneopts = "UT"
revision = "8bd4349a67f2533b078dbc524689d15dba0f4659"
[[projects]]
branch = "master"
digest = "1:00b45e06c7843541372fc17d982242bd6adfc2fc382b6f2e9ef9ce53d87a50b9"
name = "github.com/marcinbor85/gohex"
packages = ["."]
pruneopts = "UT"
revision = "7a43cd876e46e0f6ddc553f10f91731a78e6e949"
[[projects]]
branch = "master"
digest = "1:ba70784a3deee74c0ca3c87bcac3c2f93d3b2d27d8f237b768c358b45ba47da8"
name = "golang.org/x/tools"
packages = [
"go/ast/astutil",
"go/ssa",
"go/types/typeutil",
]
pruneopts = "UT"
revision = "8dcc6e70cdefe9a82236b6e195e4f4e2108fcb9f"
[[projects]]
branch = "llvm8"
digest = "1:bf5539bdf6b3cc3ec1e45926db05d81180da11ce722fa1edcce3f0b4e1967da5"
name = "tinygo.org/x/go-llvm"
packages = ["."]
pruneopts = "UT"
revision = "7707ae5d1261a8929edea7336c8087ca8b520d8d"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
input-imports = [
"github.com/blakesmith/ar",
"github.com/marcinbor85/gohex",
"golang.org/x/tools/go/ast/astutil",
"golang.org/x/tools/go/ssa",
"tinygo.org/x/go-llvm",
]
solver-name = "gps-cdcl"
solver-version = 1
-11
View File
@@ -1,11 +0,0 @@
[[constraint]]
branch = "llvm8"
name = "tinygo.org/x/go-llvm"
[[constraint]]
branch = "master"
name = "golang.org/x/tools"
[prune]
go-tests = true
unused-packages = true