Nope, I'm wrong.  It was an invalid test. It's still failing.

I'm going to raise this as an issue on the go tool.

IMO, this should work, and does not:

 c := exec.Command("go", "build", "main.go")
 c.Env = append(os.Environ(), "GOROOT="+goroot)
 err := c.Run()

It should probably even work without setting GOROOT explicitly, but it 
definitely should if I do (presuming GOROOT is correct, of course)

 

On Monday, October 16, 2017 at 12:07:06 AM UTC-4, Nate Finch wrote:
>
> Reporting back: this worked perfectly.
>
> On Sunday, October 15, 2017 at 7:43:47 PM UTC-4, Dave Cheney wrote:
>>
>> Thank should work.
>>
>> On Monday, 16 October 2017 10:30:45 UTC+11, Nate Finch wrote:
>>>
>>> hmm... I really don't want people to have to build Mage, since mage is a 
>>> build tool.  Would it be horrible to just run go env GOROOT and use 
>>> that to set GOROOT in the environs for the command that runs go build?
>>>
>>>
>>> On Sunday, October 15, 2017 at 5:36:43 PM UTC-4, Dave Cheney wrote:
>>>>
>>>> My guess is that GOROOT is not set in the target environment so the 
>>>> value eventually collapses back on the GOROOT compiled into mage from the 
>>>> value compiled into the toolchain that built mage. 
>>>>
>>>> gb has the same problem, I didn’t want to encourage people to set 
>>>> GOROOT, but if they don’t, there is no way to find the right tool chain. 
>>>>
>>>> I gave up and stoped distributing binary images, which 1/2 solved the 
>>>> problem. 
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to