From dc4f364a4bf244c68c6d00ef955d995d9cc7964c Mon Sep 17 00:00:00 2001 From: "Juvenal A. Silva Jr" Date: Thu, 31 Aug 2017 23:27:08 -0300 Subject: [PATCH 1/4] Fix the test cases This change updates the test cases to make use of clean versions of Go that did not build break on latest macOS/Darwin. --- tests/00gvm_install_comment_test.sh | 12 ++++++------ tests/gvm_alias_comment_test.sh | 14 +++++++------- tests/gvm_use_comment_test.sh | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/00gvm_install_comment_test.sh b/tests/00gvm_install_comment_test.sh index 50963110..e4379038 100644 --- a/tests/00gvm_install_comment_test.sh +++ b/tests/00gvm_install_comment_test.sh @@ -1,14 +1,14 @@ ## Cleanup test objects -gvm uninstall go1.4 > /dev/null 2>&1 +gvm uninstall go1.4.3 > /dev/null 2>&1 gvm uninstall master > /dev/null 2>&1 -gvm uninstall go1.1.1 > /dev/null 2>&1 gvm uninstall go1.2.2 > /dev/null 2>&1 +gvm uninstall go1.3.3 > /dev/null 2>&1 ####################### -gvm install go1.4 #status=0 +gvm install go1.4.3 #status=0 GOROOT_BOOTSTRAP=$GVM_ROOT/gos/go1.4 gvm install master #status=0 gvm list #status=0; match=/master/ -CGO_ENABLED=0 gvm install go1.1.1 #status=0 -gvm list #status=0; match=/go1.1.1/ -CGO_ENABLED=0 gvm install go1.2.2 #status=0 +gvm install go1.2.2 -B #status=0 gvm list #status=0; match=/go1.2.2/ +gvm install go1.3.3 -B #status=0 +gvm list #status=0; match=/go1.3.3/ diff --git a/tests/gvm_alias_comment_test.sh b/tests/gvm_alias_comment_test.sh index e9bac9b8..1e5b8000 100644 --- a/tests/gvm_alias_comment_test.sh +++ b/tests/gvm_alias_comment_test.sh @@ -6,14 +6,14 @@ gvm alias delete bar ####################### gvm alias # status=0 -gvm alias create foo go1.2.2 # status=0 -gvm alias create bar go1.1.1 # status=0 -gvm alias list # status=0; match=/gvm go aliases/; match=/foo \(go1\.2\.2\)/; match=/bar \(go1\.1\.1\)/ +gvm alias create foo go1.3.3 # status=0 +gvm alias create bar go1.2.2 # status=0 +gvm alias list # status=0; match=/gvm go aliases/; match=/foo \(go1\.3\.3\)/; match=/bar \(go1\.2\.2\)/ gvm use foo # status=0 -go version # status=0; match=/go1\.2\.2/ +go version # status=0; match=/go1\.3\.3/ gvm use bar # status=0 -go version # status=0; match=/go1\.1\.1/ +go version # status=0; match=/go1\.2\.2/ gvm alias delete foo -gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.2\.2\)/; match=/bar \(go1\.1\.1\)/ +gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.3\.3\)/; match=/bar \(go1\.2\.2\)/ gvm alias delete bar -gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.2\.2\)/; match!=/bar \(go1\.1\.1\)/ +gvm alias list # status=0; match=/gvm go aliases/; match!=/foo \(go1\.3\.3\)/; match!=/bar \(go1\.2\.2\)/ diff --git a/tests/gvm_use_comment_test.sh b/tests/gvm_use_comment_test.sh index 1c8774de..09b44613 100644 --- a/tests/gvm_use_comment_test.sh +++ b/tests/gvm_use_comment_test.sh @@ -1,5 +1,5 @@ source $GVM_ROOT/scripts/gvm +gvm use go1.3.3 # status=0 +go version # status=0; match=/go1\.3\.3/ gvm use go1.2.2 # status=0 go version # status=0; match=/go1\.2\.2/ -gvm use go1.1.1 # status=0 -go version # status=0; match=/go1\.1\.1/ From a9deb8bd4e7d487566a6073f5e984bd95534bb02 Mon Sep 17 00:00:00 2001 From: "Juvenal A. Silva Jr." Date: Mon, 22 Jun 2026 15:28:26 -0300 Subject: [PATCH 2/4] fix: correct git install hints --- scripts/gvm-check | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gvm-check b/scripts/gvm-check index 870cacf3..5db7e5c0 100755 --- a/scripts/gvm-check +++ b/scripts/gvm-check @@ -8,8 +8,8 @@ command -v git &> /dev/null || error_message="${error_message} Could not find git - linux: apt-get install mercurial - mac: brew install mercurial + linux: apt-get install git + mac: brew install git " # Check for ar command -v ar &> /dev/null || From b082c8815017188d203fd61e5269d9016ec51908 Mon Sep 17 00:00:00 2001 From: "Juvenal A. Silva Jr." Date: Tue, 23 Jun 2026 10:50:51 -0300 Subject: [PATCH 3/4] fix: use git worktree for Go installs Changing from `git clone` to `git worktree` reduces used space by 70%. --- scripts/install | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index a039c275..4cc5a6d5 100755 --- a/scripts/install +++ b/scripts/install @@ -73,9 +73,14 @@ update_source() { display_fatal "Couldn't get latest Go version info. Check the logs $GVM_ROOT/logs/go-download.log") } -copy_source() { - git clone -b "$version" "$GO_CACHE_PATH" "$GO_INSTALL_ROOT" >> "$GVM_ROOT/logs/go-$GO_NAME-install.log" 2>&1 || - display_fatal "Couldn't copy source to target folder. Check the logs $GVM_ROOT/logs/go-$GO_NAME-install.log" +create_worktree() { + # $GO_CACHE_PATH – shared repository (created by download_source) + # $GO_INSTALL_ROOT – target directory under $GVM_ROOT/gos/ + # $version – exact tag matching the requested version + # Create the worktree and log any problem. + git -C "$GO_CACHE_PATH" worktree add "$GO_INSTALL_ROOT" "$version" \ + >> "$GVM_ROOT/logs/go-${GO_NAME}-worktree.log" 2>&1 \ + || display_fatal "Failed to create worktree for $version. See $GVM_ROOT/logs/go-${GO_NAME}-worktree.log" } @@ -153,7 +158,7 @@ install_go() { fi create_global_package_set - copy_source + create_worktree compile_go create_enviroment From 3e2c74080e39e4008a2ff219d15d1d4ca78e38e5 Mon Sep 17 00:00:00 2001 From: "Juvenal A. Silva Jr." Date: Tue, 23 Jun 2026 10:51:35 -0300 Subject: [PATCH 4/4] chore: ignore logs directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index aaa9c451..99455070 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ pkgsets/ archive/ environments/ tmp/ +logs/ *.log scripts/gvm Gemfile.lock