-
Notifications
You must be signed in to change notification settings - Fork 17
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
Use MYST_HOME
environment variable for configuring load dirs.
#194
base: master
Are you sure you want to change the base?
Conversation
The old `MYST_PATH` that allows multiple paths similar to `$PATH` has been removed in favor of `MYST_HOME`, which _should_ always point to the install location of the currently-active version of Myst. This should correspond with changes coming in `mtenv` that will set `MYST_HOME` in the shim before running `myst`. For now, users who do not use `mtenv` will have to set this manually, though we can probably check and ensure it is set as part of the VM setup.
end.as(Array(String)) | ||
@load_dirs ||= [ | ||
Dir.current, | ||
ENV["MYST_HOME"]? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if MYST_HOME
is empty? We just let it go? Who needs the stdlib anyways?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it definitely needs more discussion. Ideally load_dirs
wouldn't even live here and we could have a more authoritative place for configurable things like this (probably with dependency injection as well? for embedded versions).
One other thing to consider with this is that running scripts without a login shell would probably end up not setting With On manual installs, even if a user sets |
A myst daemon sounds like a terrible idea IMO. It'd be more like a myst demon 😛 As the primary goal of myst is to support users as best as possible, I think a strong competitor for how to set A manual installation should be done with the Makefile, any kind of other manual installation would be little, but meaningless. This is how I imagine a manual installation:
Where If not: every OS should have some way for environment variables to be set (even when not running login shells) – so worst case scenario is to force manual setting. EDIT: Although for embedded Myst, this would not be sufficient though. |
That sounds like a pretty solid plan to me. I certainly think it's fair to say "if you don't use |
The old
MYST_PATH
that allowed multiple paths similar to$PATH
has been removed in favor ofMYST_HOME
, which should always point to the install location of the currently-active version of Myst. This is both simpler in terms of the implementation, and more intuitive to reason aboutThis should correspond with changes coming in
mtenv
that will setMYST_HOME
in the shim before runningmyst
.For now, users who do not use
mtenv
will have to set this manually, though we can probably check and ensure it is set as part of the VM setup. I think this should probably emit a warning and notify the user what the VM will use in its place, since it might not always be accurate (e.g., if a user wrongly installed myst directly into/usr/local/bin
without moving the standard library as well).Perhaps a better solution would be to disallow execution if
MYST_HOME
is not set?