Skip to content

pkgdir(@__MODULE__) returns nothing during __init__ on 1.11.0 #56077

Open
@SBuercklin

Description

On Julia 1.11.0, generating a new package whose src/MWE.jl is just the following, where we print the pkgdir for the current @__MODULE__:

module MWE

greet() = print("Hello World!")

function __init__()
    println(@__MODULE__)
    println(pkgdir(@__MODULE__))
end

end # module MWE

produces the following when being loaded (note the nothing for pkgdir):

julia> using MWE
[ Info: Precompiling MWE [07383931-b36a-4268-bd90-eec35e6fd057]
MWE
nothing

However, on Julia 1.10.5, the proper directory is printed:

julia> using MWE
  No Changes to `/tmp/tmp.s4wO5AcljZ/MWE/Project.toml`
  No Changes to `/tmp/tmp.s4wO5AcljZ/MWE/Manifest.toml`
Precompiling MWE
  1 dependency successfully precompiled in 1 seconds
MWE
/tmp/tmp.s4wO5AcljZ/MWE

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

    bugIndicates an unexpected problem or unintended behaviorregression 1.11Regression in the 1.11 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions