Comments (10)
Thanks for creating a ticket. I am unable to recreate the issue on my end.
Here is my console output:
➜ vultr-cli git:(master) make build_mac
building vultr-cli
env GOOS=darwin GOARCH=amd64 go build -gcflags=-trimpath=$GOPATH -o /Users/ddymko/Desktop/del/vultr-cli/builds/vultr-cli_darwin_amd64
built /Users/ddymko/Desktop/del/vultr-cli/builds/vultr-cli_darwin_amd64
➜ vultr-cli git:(master) go version
go version go1.12.7 darwin/amd64
➜ vultr-cli git:(master) gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
We are using go modules for this project and I noticed you are running on go 1.10 not sure if that may be causing issues on your end.
from vultr-cli.
I have never used go
myself. I have downloaded the latest version 1.12.7 and followed installation instructions successfully, but could not detect any change in the path and calling go
on my machine still runs the old version.
The page https://golang.org/doc/install suggests way of installing multiple versions but I was unable to follow them. If those instructions work correctly on your machine, maybe you could reproduce my errors running make
along with go1.10.1, to see whether the error is caused by the older version or something else.
from vultr-cli.
I will take a deeper dive into what your exact issue may be.
For now you can download a precompiled release for mac os from:
https://github.com/vultr/vultr-cli/releases
or if you are running homebrew on your mac you can run the follow two commands
brew tap vultr/vultr-cli
brew install vultr-cli
from vultr-cli.
I noticed in your error that you are trying to build the go project outside of your GOPATH
env GOOS=darwin ... /Users/dmitrizaitsev/Repos/vultr-cli/builds/vultr-cli_darwin_amd64
and since you are go 1.10.1
go is trying to look up your GOPATH
for the source code
/Users/dmitrizaitsev/go/src/github.com/vultr/vultr-cli/cmd (from $GOPATH)
If you move the code to /Users/dmitrizaitsev/Repos/vultr-cli/
over to /Users/dmitrizaitsev/go/src/github.com/vultr/
This will resolve your issue.
This is replicated on my machine with go 1.10.7
by moving the code outside of my gopath
. As of go 1.11.x
you could build outside of your gopath with gomodules
➜ vultr-cli git:(master) ✗ go1.10.7 version
go version go1.10.7 darwin/amd64
➜ vultr-cli git:(master) ✗ make build_mac
building vultr-cli
env GOOS=darwin GOARCH=amd64 go1.10.7 build -gcflags=-trimpath=$GOPATH -o /Users/ddymko/Desktop/vultr-cli/builds/vultr-cli_darwin_amd64
main.go:17:8: cannot find package "github.com/vultr/vultr-cli/cmd" in any of:
/Users/ddymko/sdk/go1.10.7/src/github.com/vultr/vultr-cli/cmd (from $GOROOT)
/Users/ddymko/go/src/github.com/vultr/vultr-cli/cmd (from $GOPATH)
make: *** [_build] Error 1
from vultr-cli.
Thank you very much for your help!
I have moved the project to the go
subdirectory as you suggested and it had indeed solved some problems and allowed me to install go1.11.12
(I still could not install go1.12
on my OSX 10.8.5).
Also thanks for directing me to the precompiled release that I somehow missed earlier!
Not anymore critical for me, but that build error didn't go away even with 1.11.12:
→ go version
go version go1.11.12 darwin/amd64
→ make build_mac
building vultr-cli
env GOOS=darwin GOARCH=amd64 go build -gcflags=-trimpath=$GOPATH -o /Users/dmitrizaitsev/go/src/github.com/vultr/builds/vultr-cli_darwin_amd64
main.go:17:8: cannot find package "github.com/vultr/vultr-cli/cmd" in any of:
/Users/dmitrizaitsev/go/src/github.com/vultr/vendor/github.com/vultr/vultr-cli/cmd (vendor tree)
/Users/dmitrizaitsev/sdk/go1.11.12/src/github.com/vultr/vultr-cli/cmd (from $GOROOT)
/Users/dmitrizaitsev/go/src/github.com/vultr/vultr-cli/cmd (from $GOPATH)
make: *** [Makefile:34: _build] Error 1
from vultr-cli.
Glad it helped a bit!
As for the issue of getting Go 1.12 on your macchine this is because your macOS version isn't supported.
Go 1.12 is the last release that will run on macOS 10.10 Yosemite. Go 1.13 will require macOS 10.11 El Capitan or later.
https://golang.org/doc/go1.12#darwin
I will take a look into the build error some time today (If i have a chance).
from vultr-cli.
As for the issue of getting Go 1.12 on your macchine this is because your macOS version isn't supported.
Sometimes these versions still work, so I tried anyway :)
The problem with Go it still reports success but fails later on with cryptic messages that do not refer to the real cause - my OS version if that is the one.
Generally I have been having a rough ride with any Go software, where errors have always been hard to understand. :(
Still don't quite understand how the $GOPATH works, it is currently unset for me, maybe that is one of the problems?
from vultr-cli.
Still don't quite understand how the $GOPATH works...
You're in good company here.
Part of the difficulty is that the official docs do a rather poor job of explaining what, why, and how to set the various $GO*
environmental variable bits.
Also, there seem to be a couple of gotchas.
StackOverflow tries to explain but the values/locations seem conditional on things poorly defined.
As best I can tell, $GOROOT
is where golang
is installed, and $GOPATH
is where golang
looks for the fiddly bits that make it...actually go.
Can someone knowledgeable correct my (our?) misconceptions?
from vultr-cli.
You are correct
$GOROOT
is the location of your go installation
$GOPATH
is where you could keep your compiled packages, executables, and source files.
Prior to go 1.11
you were required to build your go applications within your $GOPATH
. This is due to go get || go install
storing the requires files and packages into go your $GOPATH
However, with the introduction of of Gomodules
you can build your applications outside of your gopath. This is due to the ability to vendor packages now as opposed to needing requiring them in your gopath
Hopefully this can clear it up a bit:
- https://www.programming-books.io/essential/go/gopath-goroot-gobin-d6da4b8481f94757bae43be1fdfa9e73
- https://github.com/golang/go/wiki/Modules
- https://www.digitalocean.com/community/tutorials/understanding-the-gopath
I would also suggest joining the gopher slack. Really helpful
https://invite.slack.golangbridge.org/
from vultr-cli.
Also, you can use modules in your GOPATH by either using Go 1.13+ or setting GO111MODULE=on.
from vultr-cli.
Related Issues (20)
- [DOC] - document the default location of the config file
- [BUG] - Option plans list HOT 5
- [BUG] - Composer detected issues in your platform. Your Composer dependencies require a PHP version > HOT 2
- Reporting a vulnerability HOT 1
- [Feature] - Allow attach and detach of VPC from an existing instance
- Docker usage docs should be in the readme HOT 1
- Allow creating custom ISO via CLI HOT 1
- [BUG] - API requirement for bash completion HOT 1
- [Feature] - Allow update of bare metal user data without reading from a file
- [BUG] - Load balancer rule create command doesn't work
- [BUG] - CLI requires non-empty VULTR_API_KEY for "help [..]" and "version" subcommands HOT 4
- [Feature] - Omit the `-cli` suffix? (not the repository) HOT 1
- Can't create bare metal instance HOT 2
- [Feature] - iPXE
- Expose "enable firewall" option for kubernetes create command HOT 1
- [BUG] - read_write isn't being passed on Docker Credentials Create
- [BUG] - Listing region availabilities causes a panic HOT 1
- [BUG] - Unable to get cluster config from CLI HOT 2
- [BUG] cannot add firewall rule HOT 4
- [BUG] - Detaching VPC2 does not work, api issue? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vultr-cli.