-
Notifications
You must be signed in to change notification settings - Fork 65
go build Integration #10
Comments
@kevinsawicki This issue is dependent on resolution of an issue (that I believe is in a private Atom repo, and so not visible / linkable) to ensure the current environment is available to Atom (and its packages). This would ensure Reference: http://discuss.atom.io/t/atom-command-doesnt-pass-environment-variables-to-atom/1596 / #9. |
@probablycorey Notification that this refers to an issue you created against Atom. |
I started making some progress, mattetti@b55540c the issue is that indeed without |
My PR requires the user to set their GOPATH in the preferences for now, I think that's totally acceptable. If the user doesn't set the path, a warning is displayed on save. |
Is it not possible that Atom reads it automatically from the environment variables instead of setting it manually? |
@fatih: Atom is affected by an issue that affects all OS X GUI apps – because of the way the OS launches processes in this way, the user's environment is not available. However, if you launch your app from the command line (e.g. by installing Atom's command line tools, and then running The issue there is that Atom uses a technique to open the app that does not provide the current environment to the app:
If this was changed to use env to launch Atom, the current environment is provided to the app:
This is an issue with the Atom command line tools, but we cannot link to a specific issue because (I believe) it's in a private repo. Hope that clarifies things. |
When you add them to launchd.conf the GUI reads it then from there: ~ ❯ cat /etc/launchd.conf
setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin I do this for both MacVim and SublimeText. |
Yes, this is also how I address things also:
But it would be preferable to fix the Atom command line tools to launch Atom with the current environment so that you could potentially use different $GOPATH values for different projects (putting aside religion of one $GOPATH vs many $GOPATH's). This is an issue that affects many, many packages - essentially anything that launches external processes. |
@joefitzgerald When I open Atom via the command line tools I already have access to the user environment using |
@probablycorey The issue is in the way the command line tools launch Atom:
In particular, the following line results in the current environment not being available to Atom (I'm using iTerm2 + zsh):
The following change to the line (prepending
I know Launched with only
Launched with
|
Note that even if we fix the opening from terminal, users coming from
|
@mattetti thanks, should have re-asserted that also 👍 – though I'm not sure that is fixable. Most people are mutating their environment in I think I would be satisfied with having to launch Atom from the command line to get the current environment - it's how I open Atom mostly today anyway. Just means that package authors need to accommodate both scenarios (use the environment – if set – otherwise, rely on configured values in Preferences). Perhaps there is something there to generalize as a pattern in Atom preferences? |
Closing in deference to joefitzgerald/go-plus#1 |
Suggested by @mattetti in #9. Add the option to run
go build
on save and display any errors in Atom.The text was updated successfully, but these errors were encountered: