Skip to content

change @__FILE__, @__DIR__, etc. to give right runtime answer #38682

Closed
@StefanKarpinski

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    minor changeMarginal behavior change acceptable for a minor release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions