change @__FILE__, @__DIR__, etc. to give right runtime answer #38682
Closed
Description
Currently these macros are expanded at build time to an absolute path based on the source location at build time. This means that any use of them in precompilable packages causes the resulting .ji
files to be non-relocatable. It also means that any use of them in a stdlib will break the resulting Julia sysimg by causing it to be non-relocatable. I would propose that instead of expanding to a static path, these macros be changed to expand to code that will give the correct path at runtime. This is a technically breaking change, but I suspect that 99% of uses won't notice and changing this will silently make people's code do what they thought it was doing already.
Activity