Skip to content

Conversation

@vtjnash
Copy link
Member

@vtjnash vtjnash commented Sep 18, 2025

Reverts #58108. It is not allowed for packages to call Base.get_extension, so it should never have been made public. Something simply being documented in the manual is never any allowable argument for making something public.

The correct way to use this functionality is with dispatch. Loosely:

module Main
function get_extension end
end

module MainPkgExt # extension module in Main
using Other
Main.get_extension(args...) = Other.call(args...)
end

@vtjnash vtjnash added the backport 1.12 Change should be backported to release-1.12 label Sep 18, 2025
@ericphanson
Copy link
Contributor

It is not allowed for packages to call Base.get_extension

Why is that? (Asking since I do it: https://github.com/JuliaTesting/ExplicitImports.jl/blob/dbed49f1bbe824d536b4b121580441437a1de11c/src/ExplicitImports.jl#L362)

@DilumAluthge
Copy link
Member

being documented in the manual

Can we also add a note in the manual that these functions are not public?

@KristofferC
Copy link
Member

Regarding get_extension, I think it is better to add to the documentation of it. Just as an example, it is useful in interactive work to poke around inside the extension module, e.g. for debugging.

@KristofferC KristofferC mentioned this pull request Sep 24, 2025
24 tasks
@vtjnash vtjnash changed the title Revert "Base.get_extension & Dates.format made public" Revert "Base.get_extension made public" Sep 26, 2025
@vtjnash
Copy link
Member Author

vtjnash commented Sep 26, 2025

Interactive work is explicitly exempted from the public/private notions, since it is all about poking at implementation details

@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Sep 26, 2025
@KristofferC
Copy link
Member

KristofferC commented Sep 26, 2025

Interactive work is explicitly exempted from the public/private notions,

What, no? You can have scripts that are "interactive" as well. Or packages that call this during runtime to provide debugging features (one such example has already been given) etc etc.

But it is a good idea to add the bad behavior that you are referring to to the docstring.

@KristofferC KristofferC removed the merge me PR is reviewed. Merge when all tests are passing label Sep 26, 2025
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Sep 26, 2025
@vtjnash
Copy link
Member Author

vtjnash commented Sep 26, 2025

That is fine, but you shouldn't block reverting on feature or doc requests

@vtjnash vtjnash merged commit b18ca0f into master Sep 30, 2025
5 of 7 checks passed
@vtjnash vtjnash deleted the revert-58108-public_symbols branch September 30, 2025 14:11
@vtjnash
Copy link
Member Author

vtjnash commented Sep 30, 2025

The additional reason this is not public is that none of the related code is public either (Base.require, Base.loaded_modules_array, Base.PkgId), since packages are not allowed to do those things (they corrupt precompile files if you access them)

@KristofferC
Copy link
Member

KristofferC commented Sep 30, 2025

You shouldn't block reverting on feature or doc requests

You shouldn't merge things like this without proper consensus.

KristofferC added a commit that referenced this pull request Sep 30, 2025
KristofferC pushed a commit that referenced this pull request Sep 30, 2025
Reverts #58108. It is not allowed for packages to call
`Base.get_extension`, so it should never have been made public.
Something simply being documented in the manual is never any allowable
argument for making something public.

The correct way to use this functionality is with dispatch. Loosely:
```julia
module Main
function get_extension end
end

module MainPkgExt # extension module in Main
using Other
Main.get_extension(args...) = Other.call(args...)
end
```

(cherry picked from commit b18ca0f)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Sep 30, 2025
xal-0 pushed a commit to xal-0/julia that referenced this pull request Sep 30, 2025
Reverts JuliaLang#58108. It is not allowed for packages to call
`Base.get_extension`, so it should never have been made public.
Something simply being documented in the manual is never any allowable
argument for making something public.

The correct way to use this functionality is with dispatch. Loosely:
```julia
module Main
function get_extension end
end

module MainPkgExt # extension module in Main
using Other
Main.get_extension(args...) = Other.call(args...)
end
```
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Oct 2, 2025
johnomotani added a commit to mabarnes/moment_kinetics that referenced this pull request Oct 13, 2025
Apparently using `Base.get_extension()` is a bad thing
(JuliaLang/julia#59593), so avoid it, by
defining a couple of extra functions to be overloaded by the extensions.
johnomotani added a commit to mabarnes/moment_kinetics that referenced this pull request Oct 14, 2025
Apparently using `Base.get_extension()` is a bad thing
(JuliaLang/julia#59593), so avoid it, by
defining a couple of extra functions to be overloaded by the extensions.
johnomotani added a commit to mabarnes/moment_kinetics that referenced this pull request Oct 14, 2025
Apparently using `Base.get_extension()` is a bad thing
(JuliaLang/julia#59593), so avoid it, by
defining a couple of extra functions to be overloaded by the extensions.
kbarros added a commit to SunnySuite/Sunny.jl that referenced this pull request Oct 18, 2025
This follows guidance at JuliaLang/julia#59593.
Interactive work is "explicitly exempted", so the access pattern can
still be documented for users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants