Skip to content

1.11.1: breaking change in extension loading #56204

Closed
@aplavin

Description

@aplavin

Not too often I see packages broken by patch versions of Julia, but it's one of those cases :(
As a specific example, using UnionCollections, Dictionaries, FlexiMaps throws ERROR: LoadError: type Nothing has no field UnionDictionary on this line: https://github.com/JuliaAPlavin/UnionCollections.jl/blob/0000000018ecd297a2e7448671da83c035b3da4c/ext/FlexiMapsDictionariesExt.jl#L8.

Effectively, it does get_extension(MyPackage, :WeakDepA) in the extension for WeakDepA + WeakDepB.
Judging by the documentation, it should work:

  • get_extension returns the extension if it's loaded

get_extension(parent::Module, extension::Symbol)
Return the module for extension of parent or return nothing if the extension is not loaded.

  • Pkg docs say the following about extension loading:

A package extension is a module in a file (similar to a package) that is automatically loaded when some other set of packages are loaded into the Julia session.

In the specific case with UnionCollections, this is what I expect to happen on that using line:

  1. UnionCollections is loaded
  2. Dictionaries is loaded
  3. UnionCollections -> DictionariesExt is loaded (following Pkg docs)
  4. FlexiMaps is loaded
  5. UnionCollections -> FlexiMapsDictionariesExt is loaded, it sees DictionariesExt loaded already and successfully imports that (following get_extension docs)

And that's indeed how the observable behavior worked on earlier Julia versions, including 1.11.0. But not on 1.11.1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions