tools: Make go tools install using 'go get'.

This commit is contained in:
Andrew Hamilton 2019-06-06 18:53:57 +10:00
parent d62010a1e0
commit 92b99d9b23
3 changed files with 15 additions and 8 deletions

View file

@ -457,8 +457,8 @@ def pil(path):
return Status.normal, result
@deps(deps={"golang-golang-x-tools"}, url="golang-golang-x-tools",
executables={"godoc"})
@deps(deps={"go/github.com/golang/go/src/cmd/godoc" },
url="https://github.com/golang/go", executables={"godoc"})
def godoc(path):
with tempfile.TemporaryDirectory() as temp_dir:
symlink_path = os.path.join(temp_dir, "file.go")

View file

@ -229,11 +229,13 @@ tools_for_extensions = [
command = "luacheck"
[go_vet]
dependencies = ["golang-go", "go/github.com/golang/go/src/cmd/vet"]
command = "go vet"
dependencies = ["go/github.com/golang/go/src/cmd/vet"]
url = "https://github.com/golang/go"
command = "vet"
[golint]
dependencies = ["golint", "go/github.com/golang/lint/golint"]
dependencies = ["go/github.com/golang/lint/golint"]
url = "https://github.com/golang/lint"
command = "golint -set_exit_status"
[yamllint]

View file

@ -8,11 +8,12 @@ import subprocess
import eris.tools
pip_deps, dist_deps = set(), set()
pip_deps, go_deps, dist_deps = set(), set(), set()
dep_types = {"pip": pip_deps, "go": go_deps}
for dependency in eris.tools.dependencies():
if "/" in dependency:
pip_version, pip_dependency = dependency.split("/")
pip_deps.add(pip_dependency)
dep_type, dep = dependency.split("/", maxsplit=1)
dep_types[dep_type].add(dep)
else:
dist_deps.add(dependency)
if dist_deps:
@ -21,3 +22,7 @@ if dist_deps:
if pip_deps:
subprocess.run(["python" + eris.tools.PYTHON_VERSION, "-m", "pip",
"install"] + list(pip_deps), check=True)
if go_deps:
subprocess.run(["sudo", "apt-get", "-y", "install", "golang-go"],
check=True)
subprocess.run(["go", "get", "-u"] + list(go_deps), check=True)