Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically load environments? #360

Closed
garrison opened this issue Jun 8, 2018 · 3 comments
Closed

Automatically load environments? #360

garrison opened this issue Jun 8, 2018 · 3 comments

Comments

@garrison
Copy link
Member

garrison commented Jun 8, 2018

On Slack, there was discussion about whether julia should automatically load an environment if one exists in the current directory upon julia startup. I mentioned that direnv is my favorite mechanism for automatically loading/unloading environments within my shell, and it would be awesome to see julia support for it. (For instance, putting layout python3 in a directory's .envrc will automatically activate a virtualenv specific to the project when the directory is entered, and unload it when the directory is left.)

One thing direnv does is require the user to say direnv allow . before it will activate the environment. This is a security feature, so that code is never loaded against the user's consent. Any mechanism within Pkg should also make sure it does not permit the execution of arbitrary code without the user's consent.

@StefanKarpinski
Copy link
Member

I did some reading about direnv and it's quite nice. It led me to thinking that perhaps we should not do the CurrentEnv thing inside of Julia at all and instead let people use tools like direnv to set things up this way themselves. It seems like the direnv folks have worked this out better anyway...

@KristofferC
Copy link
Member

Fixed in Base.

@garrison
Copy link
Member Author

For anyone else interested in using direnv with Pkg: I have opened a work-in-progress pull request with direnv to add julia support to its stdlib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants