You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Justin Mclean <ju...@classsoftware.com> on 2015/10/25 02:12:09 UTC

Getting newt setup

Hi,

I followed the steps here[1] but have run into an issue when running "go get github.com/tools/godep”.

package bufio: unrecognized import path "bufio"
package bytes: unrecognized import path "bytes"
package encoding/json: unrecognized import path "encoding/json"
package encoding/xml: unrecognized import path "encoding/xml"
package errors: unrecognized import path "errors"
…. and lots more ….

$echo $GOPATH
/Users/justinmclean/dev/go
$ echo $GOROOT
/usr/local/Cellar/go
$ which go
/usr/local/bin/go
$ ls -l /usr/local/bin/go
lrwxr-xr-x  1 justinmclean  admin  25 25 Oct 11:25 /usr/local/bin/go -> ../Cellar/go/1.4.2/bin/go
$go version
go version go1.4.2 darwin/amd64

I’m running on OS X Yosemite.

A look at stack overflow/google shows a few people with similar issues and it seem the answer was to unset GOROOT. so it looks like GOROOT should not be set in the first place? Anyone more familiar with go can explain why that  was required?

There also a couple of minor issues with the setting instructions for instance this:
 go run %GOPATH%/src/github.com/mynewt/newt/newt.go
Should be this I think:
 go run $GOPATH/src/github.com/mynewt/newt/newt.go

Thanks,
Justin

1. https://github.com/mynewt/documentation/blob/master/docs/chapter1/project1.md

Re: Getting newt setup

Posted by marko kiiskila <ma...@runtime.io>.
> On Oct 24, 2015, at 7:05 PM, Justin Mclean <ju...@classsoftware.com> wrote:
> 
> Hi,
> 
>> I'll poke at this.  Can you try setting GOROOT as mentioned above, and
>> let me know if that works?
> 
> Yep doing this made it work:
> export GOROOT="/usr/local/Cellar/go/1.4.2/libexec"
> 
> (But then so did not having it set.)
> 

I was suffering from similar looking ailment, and I did resolve it by not setting
GOROOT at all.


Re: Getting newt setup

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I'll poke at this.  Can you try setting GOROOT as mentioned above, and
> let me know if that works?

Yep doing this made it work:
export GOROOT="/usr/local/Cellar/go/1.4.2/libexec"

(But then so did not having it set.)

Thanks,
Justin

Re: Getting newt setup

Posted by aditi hilbert <ad...@runtime.io>.
Removed any mention of setting GOROOT as it is not necessary. It is automatically set to the right value depending on the installation method. 

thanks,
aditi
> On Oct 25, 2015, at 7:25 PM, todd mitton <mi...@runtime.io> wrote:
> 
> I don't think you should be setting GOROOT.  GOROOT is baked into the
> binary when it's compiled.  The value baked in will be different depending
> on the installation method you used.  You only need to set GOROOT if you
> move things around after installation.
> 
> Unset the GOROOT env variable and run 'go env'.  If the value for GOROOT
> returned by 'go env' looks good, then don't override it and you should be
> fine.
> 
> -Todd
> 
> On Sat, Oct 24, 2015 at 6:46 PM, Sterling Hughes <st...@apache.org>
> wrote:
> 
>> Hi Justin,
>> 
>> On Sat, Oct 24, 2015 at 6:12 PM, Justin Mclean <ju...@classsoftware.com>
>> wrote:
>>> Hi,
>>> 
>>> I followed the steps here[1] but have run into an issue when running "go
>> get github.com/tools/godep”.
>>> 
>>> package bufio: unrecognized import path "bufio"
>>> package bytes: unrecognized import path "bytes"
>>> package encoding/json: unrecognized import path "encoding/json"
>>> package encoding/xml: unrecognized import path "encoding/xml"
>>> package errors: unrecognized import path "errors"
>>> …. and lots more ….
>>> 
>>> $echo $GOPATH
>>> /Users/justinmclean/dev/go
>>> $ echo $GOROOT
>>> /usr/local/Cellar/go
>>> $ which go
>>> /usr/local/bin/go
>>> $ ls -l /usr/local/bin/go
>>> lrwxr-xr-x  1 justinmclean  admin  25 25 Oct 11:25 /usr/local/bin/go ->
>> ../Cellar/go/1.4.2/bin/go
>>> $go version
>>> go version go1.4.2 darwin/amd64
>>> 
>>> I’m running on OS X Yosemite.
>>> 
>> 
>> That's odd. I'm running the exact same version of go, and don't have
>> this problem.  Only difference is my $GOROOT, perhaps try setting that
>> to the same as mine?
>> 
>> For reference:
>> 
>> $ echo $GOROOT
>> /usr/local/Cellar/go/1.4.2/libexec
>> $ echo $GOPATH
>> /Users/sterling/dev/go/
>> $ which go
>> /usr/local/bin/go
>> $ ls -l /usr/local/bin/go
>> lrwxr-xr-x  1 sterling  admin  25 May 28 14:03 /usr/local/bin/go ->
>> ../Cellar/go/1.4.2/bin/go
>> $ go version
>> go version go1.4.2 darwin/amd64
>> 
>> 
>>> A look at stack overflow/google shows a few people with similar issues
>> and it seem the answer was to unset GOROOT. so it looks like GOROOT should
>> not be set in the first place? Anyone more familiar with go can explain why
>> that  was required?
>>> 
>> 
>> I'll poke at this.  Can you try setting GOROOT as mentioned above, and
>> let me know if that works?
>> 
>>> There also a couple of minor issues with the setting instructions for
>> instance this:
>>> go run %GOPATH%/src/github.com/mynewt/newt/newt.go
>>> Should be this I think:
>>> go run $GOPATH/src/github.com/mynewt/newt/newt.go
>>> 
>> 
>> Yep.
>> 


Re: Getting newt setup

Posted by todd mitton <mi...@runtime.io>.
I don't think you should be setting GOROOT.  GOROOT is baked into the
binary when it's compiled.  The value baked in will be different depending
on the installation method you used.  You only need to set GOROOT if you
move things around after installation.

Unset the GOROOT env variable and run 'go env'.  If the value for GOROOT
returned by 'go env' looks good, then don't override it and you should be
fine.

-Todd

On Sat, Oct 24, 2015 at 6:46 PM, Sterling Hughes <st...@apache.org>
wrote:

> Hi Justin,
>
> On Sat, Oct 24, 2015 at 6:12 PM, Justin Mclean <ju...@classsoftware.com>
> wrote:
> > Hi,
> >
> > I followed the steps here[1] but have run into an issue when running "go
> get github.com/tools/godep”.
> >
> > package bufio: unrecognized import path "bufio"
> > package bytes: unrecognized import path "bytes"
> > package encoding/json: unrecognized import path "encoding/json"
> > package encoding/xml: unrecognized import path "encoding/xml"
> > package errors: unrecognized import path "errors"
> > …. and lots more ….
> >
> > $echo $GOPATH
> > /Users/justinmclean/dev/go
> > $ echo $GOROOT
> > /usr/local/Cellar/go
> > $ which go
> > /usr/local/bin/go
> > $ ls -l /usr/local/bin/go
> > lrwxr-xr-x  1 justinmclean  admin  25 25 Oct 11:25 /usr/local/bin/go ->
> ../Cellar/go/1.4.2/bin/go
> > $go version
> > go version go1.4.2 darwin/amd64
> >
> > I’m running on OS X Yosemite.
> >
>
> That's odd. I'm running the exact same version of go, and don't have
> this problem.  Only difference is my $GOROOT, perhaps try setting that
> to the same as mine?
>
> For reference:
>
> $ echo $GOROOT
> /usr/local/Cellar/go/1.4.2/libexec
> $ echo $GOPATH
> /Users/sterling/dev/go/
> $ which go
> /usr/local/bin/go
> $ ls -l /usr/local/bin/go
> lrwxr-xr-x  1 sterling  admin  25 May 28 14:03 /usr/local/bin/go ->
> ../Cellar/go/1.4.2/bin/go
> $ go version
> go version go1.4.2 darwin/amd64
>
>
> > A look at stack overflow/google shows a few people with similar issues
> and it seem the answer was to unset GOROOT. so it looks like GOROOT should
> not be set in the first place? Anyone more familiar with go can explain why
> that  was required?
> >
>
> I'll poke at this.  Can you try setting GOROOT as mentioned above, and
> let me know if that works?
>
> > There also a couple of minor issues with the setting instructions for
> instance this:
> >  go run %GOPATH%/src/github.com/mynewt/newt/newt.go
> > Should be this I think:
> >  go run $GOPATH/src/github.com/mynewt/newt/newt.go
> >
>
> Yep.
>

Re: Getting newt setup

Posted by Sterling Hughes <st...@apache.org>.
Hi Justin,

On Sat, Oct 24, 2015 at 6:12 PM, Justin Mclean <ju...@classsoftware.com> wrote:
> Hi,
>
> I followed the steps here[1] but have run into an issue when running "go get github.com/tools/godep”.
>
> package bufio: unrecognized import path "bufio"
> package bytes: unrecognized import path "bytes"
> package encoding/json: unrecognized import path "encoding/json"
> package encoding/xml: unrecognized import path "encoding/xml"
> package errors: unrecognized import path "errors"
> …. and lots more ….
>
> $echo $GOPATH
> /Users/justinmclean/dev/go
> $ echo $GOROOT
> /usr/local/Cellar/go
> $ which go
> /usr/local/bin/go
> $ ls -l /usr/local/bin/go
> lrwxr-xr-x  1 justinmclean  admin  25 25 Oct 11:25 /usr/local/bin/go -> ../Cellar/go/1.4.2/bin/go
> $go version
> go version go1.4.2 darwin/amd64
>
> I’m running on OS X Yosemite.
>

That's odd. I'm running the exact same version of go, and don't have
this problem.  Only difference is my $GOROOT, perhaps try setting that
to the same as mine?

For reference:

$ echo $GOROOT
/usr/local/Cellar/go/1.4.2/libexec
$ echo $GOPATH
/Users/sterling/dev/go/
$ which go
/usr/local/bin/go
$ ls -l /usr/local/bin/go
lrwxr-xr-x  1 sterling  admin  25 May 28 14:03 /usr/local/bin/go ->
../Cellar/go/1.4.2/bin/go
$ go version
go version go1.4.2 darwin/amd64


> A look at stack overflow/google shows a few people with similar issues and it seem the answer was to unset GOROOT. so it looks like GOROOT should not be set in the first place? Anyone more familiar with go can explain why that  was required?
>

I'll poke at this.  Can you try setting GOROOT as mentioned above, and
let me know if that works?

> There also a couple of minor issues with the setting instructions for instance this:
>  go run %GOPATH%/src/github.com/mynewt/newt/newt.go
> Should be this I think:
>  go run $GOPATH/src/github.com/mynewt/newt/newt.go
>

Yep.