-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implemented AMBER_PATH for import lookup #681
base: staging
Are you sure you want to change the base?
Conversation
i dont know if this is the right way forward. wouldn't it cause a lot of confusion and inconsistency between different package managers? since there is no rigidly defined place where should they place their packages |
That is how every compiler does it under the hood. There are default values (which I intend to add for Amber as well as soon as I can make sure we can ship stdlib in one of them) but leaving this path system open allows for integrating with other buildsystems like Meson, Autoconf or Nix, where dependencies may not be in standard paths for technical reasons. In the future adding a default package manager to Amber isn't incompatible with this option, just wish to keep modularity in mind -- Another reason to allow flexible paths is virtual environments. The only way to prevent dependency collision is to let users specify where dependencies are on a per-project basis. Just as Python developers rarely think about |
This fixes #668 and opens up possibilities for simpler package managers, as they could export a set of standard paths.
Now, if
AMBER_PATH
is set to/usr/lib/amber:$HOME/.local/lib/amber
for instance, in addition to the current directory, import directives will look in those directories as well.This is a draft/proof-of-concept and there's a couple things to do:
.
or..
from environment lookupAMBER_PATH
paths