-
Notifications
You must be signed in to change notification settings - Fork 99
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 |
they are obviously scoped per directory as specified in #668: which is a predictable and rigidly defined set of paths, while still allowing for flexibility. also i invite you to continue this conversation in #668, since pull requests are for implementing things outlined in issues, not for discussing the idea itself. |
I'd like to mention that LSP on which @KrosFire is working (which btw works with couple of bugs that need to be fixed to work properly) will require this PR |
This implements #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