-
-
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
Some uses of @__DIR__
should be relocatable.
#54430
Comments
@__DIR__
relocatable@__DIR__
should be relocatable.
I agree with @gbaraldi that this is a serious limitation. It means that most uses of There are two common exceptions that are relocatable:
#53906 added a |
There are more challenges for PackageCompiler.jl too. It deletes any source files from its relocated "depot". So even if this is relocatable, it would need to have a way to detect a dependency on package source so that it can copy those files to make this work. |
https://github.com/JuliaPackaging/RelocatableFolders.jl is a bit of a "hack" to work around this. |
FWIW Pkg.jl best practices already mention that one should not assume a package to be located in a stable location. So this rules out the use of the current |
What should be done for this issue to be solved? It seems to lack a clear goal right now. |
I personally would not bother with making uses of Instead I would add another macro, something like |
The proposed use I have for this is for when packages are looking for their Artifacts.toml file, they have to annoying things, and non relocatable ones even more annyoingly. (Maybe we need to add something like@__PKGDIR
that does the relocatable thing)Currently
@__DIR__
bakes in the current path of the whenever it's called, but for this it's usually the path of thesrc
directory of a package. Examples of this are theArtifacts.toml
file or aexamples/
directory, The issue arises if one tries to move that package to another place, either via PkgCompiler or via copying the depot around. Those baked in absolute paths mean that it's not safe for this package to be relocatable.I don't have a clear proposal for this, but I imagine it would just be a expansion of the relocatable package image work done by @fatteneder, specially since if you get the package those files are already there, we just don't have a nice way of getting to them.
The text was updated successfully, but these errors were encountered: