exec: "go": executable file not found in $PATH

5,772 views
Skip to first unread message

Nathaniel Clinger

unread,
Jan 27, 2018, 11:41:24 PM1/27/18
to bazel-...@googlegroups.com
I have a bazel rule (based off of this post) which grabs the go root from go_context(ctx).root, and then uses the root in order to execute a bash command:
export GOROOT={goroot} &&
export PATH=$GOROOT/bin:$PATH &&
export GOPATH={gopath} &&
{mockgen} {args}

While this works for others on my team, its not working for me and I can't figure out where I have messed up with setting up Bazel that it fails to place the go executable on the go path.

Thoughts for how to fix or debug this issue?


Thanks!

Marcel Hlopko

unread,
Jan 30, 2018, 11:16:19 AM1/30/18
to Nathaniel Clinger, jayc...@google.com, bazel-...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CALtgRPAsO%3DbA3_LoRs0QGht5SwNckBGFMYGdovB7ym927pKYOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
-- 
Marcel Hlopko | Software Engineer | hlo...@google.com | 

Google Germany GmbH | Erika-Mann-Str. 33  | 80636 München | Germany | Geschäftsführer: Geschäftsführer: Paul Manicle, Halimah DeLaine Prado | Registergericht und -nummer: Hamburg, HRB 86891

Nathaniel Clinger

unread,
Jan 30, 2018, 11:28:59 AM1/30/18
to Marcel Hlopko, jayc...@google.com, bazel-...@googlegroups.com

Got some feedback from Jay already. Thanks!

Nathaniel Clinger

unread,
Jan 30, 2018, 11:33:55 AM1/30/18
to Marcel Hlopko, bazel-...@googlegroups.com, jayc...@google.com
It seems to be an issue with the way gomocks using a reflection feature that is not supported in Go 1.8 and above (or so I've read still need to test this theory). However, what's really confusing me is that Bazel should be hermetic so why it works on some machines and not others is buffling (works on a few Macs, but then failed on my own Mac and Linux). Tested the version of Go bazel is  using on all machines and it's 1.9.2 so at a loss for why it sometimes works at all. 

Jay Conrod

unread,
Jan 30, 2018, 12:07:53 PM1/30/18
to Nathaniel Clinger, Marcel Hlopko, bazel-discuss
That's very strange. Are you using the same version of Bazel and rules_go on all machines? By default, rules_go will download a Go SDK and use that instead of the SDK installed on the machine. So there shouldn't be any variation there.

On Tue, Jan 30, 2018 at 11:33 AM, Nathaniel Clinger <clinge...@gmail.com> wrote:
It seems to be an issue with the way gomocks using a reflection feature that is not supported in Go 1.8 and above (or so I've read still need to test this theory). However, what's really confusing me is that Bazel should be hermetic so why it works on some machines and not others is buffling (works on a few Macs, but then failed on my own Mac and Linux). Tested the version of Go bazel is  using on all machines and it's 1.9.2 so at a loss for why it sometimes works at all. 
On Tue, Jan 30, 2018, 08:28 Nathaniel Clinger <clinge...@gmail.com> wrote:

Got some feedback from Jay already. Thanks!


On Tue, Jan 30, 2018, 08:16 Marcel Hlopko <hlo...@google.com> wrote:

On Sun, Jan 28, 2018 at 5:41 AM Nathaniel Clinger <clinge...@gmail.com> wrote:
I have a bazel rule (based off of this post) which grabs the go root from go_context(ctx).root, and then uses the root in order to execute a bash command:
export GOROOT={goroot} &&
export PATH=$GOROOT/bin:$PATH &&
export GOPATH={gopath} &&
{mockgen} {args}

While this works for others on my team, its not working for me and I can't figure out where I have messed up with setting up Bazel that it fails to place the go executable on the go path.

Thoughts for how to fix or debug this issue?


Thanks!

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.

Nathaniel Clinger

unread,
Jan 30, 2018, 1:28:27 PM1/30/18
to Jay Conrod, Marcel Hlopko, bazel-discuss
Using WORKSPACE to get the rules_go, we are all on Bazel 0.9.0, using the default Go SDK downloaded by rules_go.

On Tue, Jan 30, 2018 at 9:07 AM Jay Conrod <jayc...@google.com> wrote:
That's very strange. Are you using the same version of Bazel and rules_go on all machines? By default, rules_go will download a Go SDK and use that instead of the SDK installed on the machine. So there shouldn't be any variation there.
On Tue, Jan 30, 2018 at 11:33 AM, Nathaniel Clinger <clinge...@gmail.com> wrote:
It seems to be an issue with the way gomocks using a reflection feature that is not supported in Go 1.8 and above (or so I've read still need to test this theory). However, what's really confusing me is that Bazel should be hermetic so why it works on some machines and not others is buffling (works on a few Macs, but then failed on my own Mac and Linux). Tested the version of Go bazel is  using on all machines and it's 1.9.2 so at a loss for why it sometimes works at all. 
On Tue, Jan 30, 2018, 08:28 Nathaniel Clinger <clinge...@gmail.com> wrote:

Got some feedback from Jay already. Thanks!


On Tue, Jan 30, 2018, 08:16 Marcel Hlopko <hlo...@google.com> wrote:

On Sun, Jan 28, 2018 at 5:41 AM Nathaniel Clinger <clinge...@gmail.com> wrote:
I have a bazel rule (based off of this post) which grabs the go root from go_context(ctx).root, and then uses the root in order to execute a bash command:
export GOROOT={goroot} &&
export PATH=$GOROOT/bin:$PATH &&
export GOPATH={gopath} &&
{mockgen} {args}

While this works for others on my team, its not working for me and I can't figure out where I have messed up with setting up Bazel that it fails to place the go executable on the go path.

Thoughts for how to fix or debug this issue?


Thanks!

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages