From 9192168904ec4725b92817c580da42ea7a062d32 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Apr 2022 22:12:58 +0200 Subject: [PATCH 1/3] add GOPATH --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index badea49..8a83478 100644 --- a/scripts/install +++ b/scripts/install @@ -126,6 +126,7 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path/build" # Build the sources ynh_use_go + export GOPATH=$final_path/go CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/dendrite-monolith-server > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/goose > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/create-account > /dev/null 2>&1 diff --git a/scripts/upgrade b/scripts/upgrade index 4ae8a4e..1cd0e06 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,6 +120,7 @@ then pushd "$final_path/build" # Build the sources ynh_use_go + export GOPATH=$final_path/go CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/dendrite-monolith-server > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/goose > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/create-account > /dev/null 2>&1 From 034e2144c11bac31dfc860a78760e55ef14d6ea8 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 2 Apr 2022 22:59:26 +0200 Subject: [PATCH 2/3] Fix GOCACHE --- scripts/install | 3 ++- scripts/upgrade | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 8a83478..15d9de9 100644 --- a/scripts/install +++ b/scripts/install @@ -126,7 +126,8 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path/build" # Build the sources ynh_use_go - export GOPATH=$final_path/go + export GOPATH="$final_path/go" + export GOCACHE="$final_path/.cache" CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/dendrite-monolith-server > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/goose > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/create-account > /dev/null 2>&1 diff --git a/scripts/upgrade b/scripts/upgrade index 1cd0e06..c42228c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,7 +120,8 @@ then pushd "$final_path/build" # Build the sources ynh_use_go - export GOPATH=$final_path/go + export GOPATH="$final_path/go" + export GOCACHE="$final_path/.cache" CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/dendrite-monolith-server > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/goose > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/create-account > /dev/null 2>&1 From 15783afe2705f8b42d2637242aee6afc41c85595 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 3 Apr 2022 13:31:51 +0200 Subject: [PATCH 3/3] improving go --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 15d9de9..2394a3d 100644 --- a/scripts/install +++ b/scripts/install @@ -126,8 +126,8 @@ ynh_exec_warn_less ynh_install_go --go_version=$GO_VERSION pushd "$final_path/build" # Build the sources ynh_use_go - export GOPATH="$final_path/go" - export GOCACHE="$final_path/.cache" + export GOPATH="$final_path/build/go" + export GOCACHE="$final_path/build/.cache" CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/dendrite-monolith-server > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/goose > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/create-account > /dev/null 2>&1 diff --git a/scripts/upgrade b/scripts/upgrade index c42228c..7eb6e9b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,8 +120,8 @@ then pushd "$final_path/build" # Build the sources ynh_use_go - export GOPATH="$final_path/go" - export GOCACHE="$final_path/.cache" + export GOPATH="$final_path/build/go" + export GOCACHE="$final_path/build/.cache" CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/dendrite-monolith-server > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/goose > /dev/null 2>&1 CGO_ENABLED=1 go build -trimpath -v -o "$final_path/bin/" ./cmd/create-account > /dev/null 2>&1