-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Loading: look for vendored packages in $project/packages
#35222
base: master
Are you sure you want to change the base?
Conversation
I like it. Can you add "closes #35195"? |
Co-Authored-By: Dilum Aluthge <[email protected]>
# Look for bundled packages in `$project/packages` | ||
depot_path = DEPOT_PATH | ||
project = active_project() | ||
if project !== nothing |
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.
if project !== nothing | |
if project !== nothing && project in load_path() |
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.
Could you explain this change?
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.
Seems weird to look for stuff in a path that is not on the LOAD_PATH.
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.
Sure. I think this will be true in 99% of cases anyway. The only way that the active project wouldn’t be the first entry in the load path would be if someone manually popped it off.
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.
Yes, so my suggestion fixes that.
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.
The situation where this can happen is if @
is removed from the LOAD_PATH
. I have to think a little about whether it makes sense for that to interact with this or not...
Then this can be simplified to this:
if project !== nothing | |
if project in load_path() |
That's because load_path
already filters out nothing
values and only returns strings.
How would you get the packages into What is the use case for this? I feel this PR lacks some kind of description / justification of what the goal is to enable and why the current methods are not satisfactory. |
Simple approach:
Advanced approach:
The plan is that someone will develop an external tool to automate that process. We don’t need to add the functionality to Julia for creating the "self-contained standalone bundles." That can go in an external tool. We only need to add support for reading from the standalone bundles. |
The use case is to be able to make a single directory that contains your project, as well as all of the packages and artifacts that your project uses. You can then make a single tarball from that directory and:
I can imagine other use cases as well. I’ve started calling these "self-contained bundles" or "standalone bundles". |
Yeah but that will bring you all of the packages and all versions of them.
Yeah, you would do this now by adding
and doing |
Regarding #35222 (comment), I agree with that a specific |
I think it is important to have a canonical name for path like this. Here is a possible source of inspiration: There is something called |
Just to clarify the thinking here: what we want is the ability download a tarball of an application and run it with the guarantee that it will not need to download any resources (packages or artifacts) in order to run. We may want to go a bit further and say that the app will use only resources within the tarball, not any system-installed resources. This illuminates a few things:
These dos and don'ts are why treating the project as a full-blown depot is not desirable. Looking for packages and artifacts in the project is not arbitrary or a slippery slope: these are the only content-addressed resources that exist in Julia/Pkg; together they are necessary and sufficient to allow a project to be self-contained in terms of dependencies. The idea that we want to enable shipping apps in such a way that they run only using the resources in the project is why it's desirable to look at a project's packages and artifacts directories first: if the the project ships with all the necessary resources, then it's guaranteed that when running the project you won't hit the filesystem outside of the project at all. While content addressing should guarantee that it doesn't matter where we load content-addressed resources from, I think it still makes sense to make projects fully self-contained in the sense that we don't even look outside of the project for resources. The |
Co-Authored-By: Takafumi Arakaki <[email protected]>
Re sysimage, here is an RFC/POC: #35794 |
No description provided.