moovweb / gvm

Go Version Manager
http://github.com/moovweb/gvm
MIT License
9.88k stars 520 forks source link

gvm v1.0.22 issue installing on ubuntu #405

Open nkostic opened 2 years ago

nkostic commented 2 years ago

No go installed I wanted to start clean:

My prerequisite installation step: install go version manager: bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) than, because ubuntu: sudo apt-get install curl git mercurial make binutils bison gcc build-essential vm version returns: Go Version Manager v1.0.22 installed at /home/nkostic/.gvm So now to golang instalation step gvm install go1.4 In terminal:

Downloading Go source...
Installing go1.4...
 * Compiling...
/home/nkostic/.gvm/scripts/install: line 84: go: command not found
ERROR: Failed to compile. Check the logs at /home/nkostic/.gvm/logs/go-go1.4-compile.log
ERROR: Failed to use installed version

if I check the log:

at /home/nkostic/.gvm/logs/go-go1.4-compile.log
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, linux/amd64.
lib9
/home/nkostic/.gvm/gos/go1.4/src/lib9/fmt/fltfmt.c: In function '__efgfmt':
/home/nkostic/.gvm/gos/go1.4/src/lib9/fmt/fltfmt.c:437:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
  437 |   if(ndigits > prec) {
      |     ^
/home/nkostic/.gvm/gos/go1.4/src/lib9/fmt/fltfmt.c:451:2: note: here
  451 |  default:
      |  ^~~~~~~
cc1: all warnings being treated as errors
go tool dist: FAILED: gcc -Wall -Wstrict-prototypes -Wextra -Wunused -Wno-sign-compare -Wno-missing-braces -Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-comment -Wno-missing-field-initializers -Werror -fno-common -ggdb -pipe -Wuninitialized -O2 -fmessage-length=0 -c -m64 -I /home/nkostic/.gvm/gos/go1.4/include -DPLAN9PORT -I /home/nkostic/.gvm/gos/go1.4/src/lib9 -o $WORK/fltfmt.o /home/nkostic/.gvm/gos/go1.4/src/lib9/fmt/fltfmt.c

Installed go 1.18 manually tried again from the top and same result. If zlog used the issue might be coming from there, not sure but unable to use this tool on Ubuntu 20.04.3 LTS following the readme instruction.

soulteary commented 2 years ago

Maybe this will help you: https://github.com/moovweb/gvm/issues/406

prashant3286 commented 2 years ago

same issue with my device as well with Ubuntu 20.04.3 LTS , I could download gvm with version v1.0.22 but getting the same error as

Downloading Go source...
Installing go1.4...
 * Compiling...
/home/nkostic/.gvm/scripts/install: line 84: go: command not found
ERROR: Failed to compile. Check the logs at /home/nkostic/.gvm/logs/go-go1.4-compile.log
ERROR: Failed to use installed version
soulteary commented 2 years ago

Simple question, I'm guessing you didn't see a reply to this post. @prashant3286

Maybe this will help you: #406

prashant3286 commented 2 years ago

@soulteary Does this work for ubuntu as well cause you are mentioning it works doe mac m1 OS , so confused there :)

soulteary commented 2 years ago

Aha, you reminded me that my description is not rigorous, it applies to both x86 and arm.

You can try the installation, the code is open source and can be reviewed at will, hope enjoy. @prashant3286

prashant3286 commented 2 years ago

Still getting the same error for my device @soulteary

soulteary commented 2 years ago

I'm guessing you have this problem:

@prashant3286

justinfarrelldev commented 1 year ago

I'm encountering the same issue on Lubuntu (not an M1 chip, just a converted Macbook Pro 2012 that I wiped MacOS off of)

soulteary commented 1 year ago

https://soulteary.com/2022/07/04/build-a-maintainable-golang-development-environment.html#%E5%AE%89%E8%A3%85-golang-%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7soultearygvm

I have written another tutorial, you can try it here. @justinfarrelldev

sudo apt install -y binutils bison gcc make

curl -sSL https://github.com/soulteary/gvm/raw/master/binscripts/gvm-installer | bash
justinfarrelldev commented 1 year ago

https://soulteary.com/2022/07/04/build-a-maintainable-golang-development-environment.html#%E5%AE%89%E8%A3%85-golang-%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7soultearygvm

I have written another tutorial, you can try it here. @justinfarrelldev

sudo apt install -y binutils bison gcc make

curl -sSL https://github.com/soulteary/gvm/raw/master/binscripts/gvm-installer | bash

Thank you, I'll take a look at this later and see if it works.

madalinignisca commented 1 year ago

gvm wants to install go from source, so go is a dependency. I guess in most cases it is not looking to get the binary distribution of the version you ask for, which most exist on the official site.

madalinignisca commented 1 year ago

Wanna leave a tip for anybody else trying to use it until the project is improved/fixed:

pjkaufman commented 1 year ago

Did this have an actual fix or workaround? I am hitting this problem myself and would like to keep using gvm, but this issue is making it hard for me to do so.

Edit:

The following seems to fix it for me since it no longer has the compiler issue.

Wanna leave a tip for anybody else trying to use it until the project is improved/fixed:

  • Add export GO_BINARY_BASE_URL=https://go.dev/dl in your ~/.bashrc file, just before sourcing gvm. Add GO_BINARY_BASE_URL env #329 allowed the URL from where to download the binary to be overridden and the one I suggested I took it from the official download link.
  • Install any go version adding -B, which will download the official binary version.
  • Enjoy.
ankitcharolia commented 11 months ago

@pjkaufman @madalinignisca @justinfarrelldev @prashant3286 @soulteary @nkostic kindly try this GO Version Manager: https://github.com/ankitcharolia/goenv

soulteary commented 9 months ago

@pjkaufman @madalinignisca @justinfarrelldev @prashant3286 @soulteary @nkostic kindly try this GO Version Manager: https://github.com/ankitcharolia/goenv

same to https://github.com/moovweb/gvm/issues/406#issuecomment-1666529704

the advantage of the bash tool is that it can automatically adapt to scenarios with multiple different CPU architectures. Also, including this issue, it mainly deals with the use of the ARM environment. Your warehouse only handles x86, and the original version of gvm is in There is no problem in x86

ankitcharolia commented 9 months ago

@soulteary I think it's pretty easy to release the binary for different CPU architecture. now, goevn supports arm, arm64, amd64 cpu architecture: https://github.com/ankitcharolia/goenv/releases/tag/1.1.7

sheghun commented 7 months ago

@madalinignisca thank you, your fix worked for me

BoThe1K commented 4 months ago

The same issue on wsl2 22.04, fix of @madalinignisca helped (using binary installation directly). Thanks!