gvm
gvm copied to clipboard
Install error MacOS 10.13
Hi,
Install of gvm fails for me using MacOS 10.13.
> rm -rf ~/.gvm/
then
--[dansullivan@Dans-MacBook-Pro]-[~/temp]-[]-
> bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
Cloning from https://github.com/moovweb/gvm.git to /Users/dansullivan/.gvm
No existing Go versions detected
Installed GVM v1.0.22
Please restart your terminal session or to get started right away run
`source /Users/dansullivan/.gvm/scripts/gvm`
then
--[dansullivan@Dans-MacBook-Pro]-[~/temp]-[]-
> source /Users/dansullivan/.gvm/scripts/gvm
-bash: local: can only be used in a function
/Users/dansullivan/temp
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_environment_sanitize: line 2: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_environment_sanitize: line 2: `function gvm_environment_sanitize() {'
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_export_path: line 2: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_export_path: line 2: `function gvm_export_path() {'
-bash: /Users/dansullivan/.gvm/scripts/env/gvm: line 4: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/env/gvm: line 4: `function gvm() {'
or
--[dansullivan@Dans-MacBook-Pro]-[~/temp]-[]-
> `source /Users/dansullivan/.gvm/scripts/gvm`
-bash: local: can only be used in a function
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_environment_sanitize: line 2: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_environment_sanitize: line 2: `function gvm_environment_sanitize() {'
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_export_path: line 2: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_export_path: line 2: `function gvm_export_path() {'
-bash: /Users/dansullivan/.gvm/scripts/env/gvm: line 4: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/env/gvm: line 4: `function gvm() {'
-bash: /Users/dansullivan/temp: is a directory
--[dansullivan@Dans-MacBook-Pro]-[~/temp]-[]-
>
so it looks like you have are going to have to put source /Users/<USERNAME>/.gvm/scripts/gvm
in the bashrc or bashprofile so it runs evertime the terminal starts up
Hi @spencer1573 - Thank you for your support. After putting the line you specified in ~/.bashrc
I receive the exact same error as above (when opening a new terminal).
i'm on sierra not high sierra, but i'm just setting it up right now i'll let you know what i find out on my system.
It's not really that big of a deal I don't want you to waste your time. I actually don't need to get this to work to achieve what Im trying to do, although I'd be interested in using gvm. I appreciate you following up. Have a great weekend.
what does it do when you source the gvm script from the terminal? source /Users/<USERNAME>/.gvm/scripts/gvm
I have the output of this invocation in the original post after the second then
. Here it is again (I just re-tested this):
> source /Users/dansullivan/.gvm/scripts/gvm
-bash: local: can only be used in a function
/Users/dansullivan/Dropbox/github/ccs-backend
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_environment_sanitize: line 2: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_environment_sanitize: line 2: `function gvm_environment_sanitize() {'
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_export_path: line 2: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/function/gvm_export_path: line 2: `function gvm_export_path() {'
-bash: /Users/dansullivan/.gvm/scripts/env/gvm: line 4: syntax error near unexpected token `('
-bash: /Users/dansullivan/.gvm/scripts/env/gvm: line 4: `function gvm() {'
why does your bash not end in a dollar sign?
I just set an arbitrary bash prompt by exporting the PS1 variable, export PS1="--[\u@\h]-[\w]-[$RAILS_ENV]-\n> "
i'm not sure what that is. my guess is it could have something to do with why it isn't working. but if sourcing that isn't working from your terminal than we know it probably won't work in the bash profile where I think gvm automatically puts it. I have no idea what i'm doing bytheway.
I have no idea what i'm doing bytheway
LoL!!! At least you're trying to help me. I figured I'd report it since it's reproducible. I might spend some time digging into this more - I'll let you know if I find anything. Have a great weekend.
I feel like this is caused by .gvm/scripts/function/find_local_pkgset
. This uses the anonymous function syntax style of:
function <name>
{
# ...
}
The other files use the named function style of:
<name>() {
# ...
}
I have a feeling that if you change the first lines of that file from:
function find_local_pkgset
{
to:
find_local_pkgset() {
it might fix your issue. .gvm/scripts/function/gvm_environment_sanitize
and .gvm/scripts/function/gvm_export_path
may also need similar changes.
That said, I have no idea why 10.13 is throwing a fit, while my 10.12 system handles those function definitions just fine. They are both using bash 3.2.57(1)-release
, so I would think they should work the same (unless you upgraded your bash to 4.0+, which has different rules about the local
identifier)
Unable to gvm install go1.10.3
on MacOS 10.13.6, what am I overlooking please?
benjamin@Benjamins-MacBook-Pro:~ $ gvm install go1.10.3
Downloading Go source...
Installing go1.10.3...
* Compiling...
/Users/benjamin/.gvm/scripts/install: line 84: go: command not found
ERROR: Failed to compile. Check the logs at /Users/benjamin/.gvm/logs/go-go1.10.3-compile.log
ERROR: Failed to use installed version
Completed reading the docs to see I need to install and bootstrap go1.4 first, so following the directions...
benjamin@Benjamins-MacBook-Pro:~ $ gvm install go1.4 -B
Installing go1.4 from binary source
benjamin@Benjamins-MacBook-Pro:~ $ gvm use go1.4
Now using version go1.4
benjamin@Benjamins-MacBook-Pro:~ $ export GOROOT_BOOTSTRAP=$GOROOT
Then, I tried nvm install go1.10.3
and received the same error:
benjamin@Benjamins-MacBook-Pro:~ $ gvm install go1.10.3
Installing go1.10.3...
* Compiling...
ERROR: Failed to compile. Check the logs at /Users/benjamin/.gvm/logs/go-go1.10.3-compile.log
ERROR: Failed to use installed version
Viewing the compile logs as instructed:
benjamin@Benjamins-MacBook-Pro:~ $ vim ~/.gvm/logs/go-
go-download.log go-go1.10.3-compile.log go-go1.10.3-install.log go-go1.4-download-binary go-go1.4-install.log
benjamin@Benjamins-MacBook-Pro:~ $ vim ~/.gvm/logs/go-go1.10.3-
go-go1.10.3-compile.log go-go1.10.3-install.log
benjamin@Benjamins-MacBook-Pro:~ $ vim ~/.gvm/logs/go-go1.10.3-
go-go1.10.3-compile.log go-go1.10.3-install.log
benjamin@Benjamins-MacBook-Pro:~ $ vim ~/.gvm/logs/go-go1.10.3-
go-go1.10.3-compile.log go-go1.10.3-install.log
benjamin@Benjamins-MacBook-Pro:~ $ vim ~/.gvm/logs/go-go1.10.3-compile.log
Building Go cmd/dist using /Users/benjamin/.gvm/gos/go1.4.
failed MSpanList_Insert 0x1704000 0xba9041680939 0x0
fatal error: MSpanList_Insert
runtime stack:
runtime.throw(0x7ffa6b)
/usr/local/go/src/runtime/panic.go:491 +0xad fp=0x7ffeefbfecd0 sp=0x7ffeefbfeca0
runtime.MSpanList_Insert(0x82af28, 0x1704000)
/usr/local/go/src/runtime/mheap.c:692 +0x8f fp=0x7ffeefbfecf8 sp=0x7ffeefbfecd0
MHeap_FreeSpanLocked(0x827b20, 0x1704000, 0x100)
/usr/local/go/src/runtime/mheap.c:583 +0x163 fp=0x7ffeefbfed38 sp=0x7ffeefbfecf8
MHeap_Grow(0x827b20, 0x8, 0x0)
/usr/local/go/src/runtime/mheap.c:420 +0x1a8 fp=0x7ffeefbfed78 sp=0x7ffeefbfed38
MHeap_AllocSpanLocked(0x827b20, 0x1, 0x122e080)
/usr/local/go/src/runtime/mheap.c:298 +0x365 fp=0x7ffeefbfedb8 sp=0x7ffeefbfed78
mheap_alloc(0x827b20, 0x1, 0x7f0000000012, 0x7fff4fd7f3bf)
/usr/local/go/src/runtime/mheap.c:190 +0x121 fp=0x7ffeefbfede0 sp=0x7ffeefbfedb8
runtime.MHeap_Alloc(0x827b20, 0x1, 0x10000000012, 0x977a9)
/usr/local/go/src/runtime/mheap.c:240 +0x66 fp=0x7ffeefbfee18 sp=0x7ffeefbfede0
MCentral_Grow(0x82f898, 0x1234600)
/usr/local/go/src/runtime/mcentral.c:197 +0x8b fp=0x7ffeefbfee80 sp=0x7ffeefbfee18
runtime.MCentral_CacheSpan(0x82f898, 0x7ffeefbfeef0)
/usr/local/go/src/runtime/mcentral.c:85 +0x167 fp=0x7ffeefbfeeb8 sp=0x7ffeefbfee80
runtime.MCache_Refill(0x1700000, 0x12, 0x7ffeefbfef10)
/usr/local/go/src/runtime/mcache.c:90 +0xa0 fp=0x7ffeefbfeee0 sp=0x7ffeefbfeeb8
runtime.mcacheRefill_m()
/usr/local/go/src/runtime/malloc.c:368 +0x57 fp=0x7ffeefbfef00 sp=0x7ffeefbfeee0
runtime.onM(0x6a2870)
/usr/local/go/src/runtime/asm_amd64.s:273 +0x9a fp=0x7ffeefbfef08 sp=0x7ffeefbfef00
runtime.mallocgc(0x120, 0x590240, 0x0, 0x0)
/usr/local/go/src/runtime/malloc.go:178 +0x85b fp=0x7ffeefbfefb8 sp=0x7ffeefbfef08
runtime.newobject(0x590240, 0x1700000)
/usr/local/go/src/runtime/malloc.go:353 +0x49 fp=0x7ffeefbfefe0 sp=0x7ffeefbfefb8
runtime.newG(0xb17fa)
/usr/local/go/src/runtime/proc.go:233 +0x2a fp=0x7ffeefbfeff8 sp=0x7ffeefbfefe0
allocg(0x817ac0)
/usr/local/go/src/runtime/proc.c:925 +0x1f fp=0x7ffeefbff008 sp=0x7ffeefbfeff8
runtime.malg(0x8000, 0x817e40)
/usr/local/go/src/runtime/proc.c:2106 +0x1f fp=0x7ffeefbff038 sp=0x7ffeefbff008
runtime.mpreinit(0x818680)
/usr/local/go/src/runtime/os_darwin.c:137 +0x27 fp=0x7ffeefbff050 sp=0x7ffeefbff038
mcommoninit(0x818680)
/usr/local/go/src/runtime/proc.c:201 +0xc9 fp=0x7ffeefbff078 sp=0x7ffeefbff050
runtime.schedinit()
/usr/local/go/src/runtime/proc.c:138 +0x6e fp=0x7ffeefbff0a0 sp=0x7ffeefbff078
runtime.rt0_go(0x7ffeefbff0d8, 0x5, 0x7ffeefbff0d8, 0x0, 0x0, 0x5, 0x7ffeefbff330, 0x7ffeefbff356, 0x7ffeefbff35c, 0x7ffeefbff35f, ...)
/usr/local/go/src/runtime/asm_amd64.s:95 +0x116 fp=0x7ffeefbff0a8 sp=0x7ffeefbff0a0
@bdeanindy https://github.com/golang/go/issues/20888
version of 1.4.2 that is patched to work on osx, otherwise use 1.8.3 to
bootstrap```
I generally use the default Homebrew version of Go to bootstrap my first gvm install, to avoid this.
I'm going to close this out unless I hear otherwise