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

macos: can potentially avoid needing opam setenv #3327

Open
avsm opened this issue May 2, 2018 · 1 comment
Open

macos: can potentially avoid needing opam setenv #3327

avsm opened this issue May 2, 2018 · 1 comment

Comments

@avsm
Copy link
Member

avsm commented May 2, 2018

I recently discovered via @djs55 that macOS has a launchctl setenv command that can set the environment variables for a user without having to be root.

There is more information here: http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-launchd-plist/

opam could possibly generate a launchctl file that sets the relevant environment variables and avoid the need for a user to have to run the env setting every time.

@AltGr
Copy link
Member

AltGr commented May 3, 2018

Interesting indeed, sounds better than our current (new) approach of using shell hooks to automatically update. Won't be in 2.0.0 but definitely worth investigating ; if I understand correctly, it would mean writing a ~/Library/LaunchAgents/opam-env file on every opam switch command (or whenever we rewrite ~/.opam/opam-init/variables.*sh)

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

No branches or pull requests

4 participants