-
-
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
Code loading can not find stdlibs outside the sysimage #39504
Comments
The difference is about if the stdlib is in the sysimage or not. Since |
So previously all stdlibs have been in the sysimage? |
Yes |
I assumed code loading had logic to find them anyway, just like Pkg does. I guess we need to implement that then? I think that this is a pretty common pattern to run in an isolated env and use
I use that alot at least and I have recommended it on several occasion in various forums etc. |
IMO this is working as intended. If you want to be able to load stdlibs, you should have What use cases are there for setting |
I disagree, it should be enough to have them in your project + manifest. What is the point of
Thats not what I am suggesting. The previous behavior was that with
It is useful if you want to have control over the exact env and don't rely on stuff lower in |
I don't think we can fix this for 1.6. It is also quite rare to load |
I believe this is enough but I haven't had time to test it properly yet: diff --git a/base/loading.jl b/base/loading.jl
index 093e14e..f6fafd8 100644
--- a/base/loading.jl
+++ b/base/loading.jl
@@ -290,6 +290,10 @@ function locate_package(pkg::PkgId)::Union{Nothing,String}
path = manifest_uuid_path(env, pkg)
path === nothing || return entry_path(path, pkg.name)
end
+ # Allow loading of stdlibs if the name/uuid are given
+ # e.g. if they have been explicitly added to the project/manifest
+ path = manifest_uuid_path(Sys.STDLIB, pkg)
+ path === nothing || return entry_path(path, pkg.name)
end
return nothing
end |
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, this lookup fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB for stdlibs, fixes #39504.
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, this lookup fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB for stdlibs, fixes #39504.
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, looking up the package entrypoint fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB after stdlibs, fixes #39504.
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, looking up the package entrypoint fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB after stdlibs, fixes #39504.
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, looking up the package entrypoint fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB after stdlibs, fixes #39504. (cherry picked from commit 5d7e13f)
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, looking up the package entrypoint fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB after stdlibs, fixes JuliaLang#39504.
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, looking up the package entrypoint fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB after stdlibs, fixes JuliaLang#39504.
Locating a package with known uuid means the uuid was either found in a manifest in LOAD_PATH or a "package folder" in LOAD_PATH. However, looking up the package entrypoint fails for stdlibs that are not in the sysimage, even if they have been explicitly added to project/manifest by the user. This patch allows looking in Sys.STDLIB after stdlibs, fixes #39504. (cherry picked from commit 5d7e13f)
The text was updated successfully, but these errors were encountered: