Repository navigation
Don't update the NODE_PATH when updating the environment on launch - #12317
Conversation
Signed-off-by: Nathan Sobo <[email protected]>
|
Thanks to @rahatarmanahmed for explaining the problem so clearly in #12006. |
Don't update the NODE_PATH when updating the environment on launch
Don't update the NODE_PATH when updating the environment on launch
Don't update the NODE_PATH when updating the environment on launch
In Atom 1.7 and 1.8, the environment would be patched for users of the zsh shell on OS X. A whitelist of shells was established in #12317, which is extended here.
…ssion Fix Regression In #12317 For zsh and Patch Environment On OSX For Users Of fish
…ssion Fix Regression In #12317 For zsh and Patch Environment On OSX For Users Of fish
…ssion Fix Regression In #12317 For zsh and Patch Environment On OSX For Users Of fish
| } | ||
| } | ||
|
|
||
| function getEnvFromShell () { |
There was a problem hiding this comment.
@maxbrunsfeld would you guys be interested in replacing this homegrown function with consistent-env. It supports both sync/async (no startup delay) and a wide variety of shells and is well tested and robust
There was a problem hiding this comment.
👎 on the basis that it's not worth taking on additional dependencies to replace this small piece of code (which has since evolved to be more simple and address more shells and more platforms).
I write a lot of go code, so to draw inspiration from one of the creators of go:
"A little copying is better than a little dependency"
-Rob Pike
This is cogent, given parables like left-pad (not to suggest consistent-env is in any way like left-pad).
There was a problem hiding this comment.
Tell me if I'm wrong but I personally believe that a project should be focused and Atom's mission is to be a Text Editor not an env patcher. The reason I suggest this time and time again is that the current method is not reliable and we still have to patch PATH in all of the linter providers, if we can get it done in the core it'll make all those linter providers have one less dependency.
While you can copy a little to save a dependency, but if you keep doing this you'll end up with a bunch of bloatware that will be hard to maintain. and we can already see that Atom's maintaining power is being wasted into something that's already available as a module.
There was a problem hiding this comment.
I think your last statements create false dichotomies. It is possible to make Atom a great text editor without taking on dependencies in all areas where you could depend on something. And having code in this specific area does not make Atom "bloatware".
If you believe the patching behavior should differ in some way you should file an issue substantiating the ways in which it should differ. The PATH patching you have to do for linters is a good example of a potential issue you could open. I don't currently understand why you need to do this, so opening an issue would enhance our shared understanding of your needs.
In general, further discussion of this in this line comment trail seems counter productive as the code has changed materially.
There was a problem hiding this comment.
Tell me if I'm wrong but I personally believe that a project should be focused and Atom's mission is to be a Text Editor not an env patcher.
By that line of reasoning, Atom shouldn't have any env patching code in it at all and we still shouldn't accept your module as a dependency.
This conversation is done, @steelbrain. I've discussed it with the team, we aren't going to be accepting your module as a dependency, stop suggesting it.
There was a problem hiding this comment.
@steelbrain As someone who is ultimately responsible for maintaining this behavior in core, I find it easier to be able to browse to a specific chunk of code that performs this logic and immediately see what's going on rather than needing to dig it up in a dependency. It just doesn't seem complex enough to warrant it. That isn't always the case, but for this concern it is. It's a subjective call but that's my preference.
I would be very interested in accepting a specific PR addressing specific issues in the current code, however.
Fixes #12313
Fixes atom/fuzzy-finder#205
Refs #12006 (solves same problem, but with a different approach)
Both
NODE_ENVandNODE_PATHaffect Atom's own behavior, so when loading environment variables from the main process, Atom needs to control these two variables explicitly.