Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove REPL.__init__ #48594

Merged
merged 1 commit into from
Feb 8, 2023
Merged

remove REPL.__init__ #48594

merged 1 commit into from
Feb 8, 2023

Conversation

JeffBezanson
Copy link
Member

Some packages depend on REPL_MODULE_REF being set, which does not work in a compilation process where __init__ methods don't run. It would have been better to use a function like get_repl_if_available(), but here we are.

A related problem is that @doc is exported by Base, but all the code for it is actually in the REPL. I found this interesting use case in RuntimeGeneratedFunctions:

# Duplicate RuntimeGeneratedFunction docs onto @RuntimeGeneratedFunction
@eval @doc $(@doc RuntimeGeneratedFunction) var"@RuntimeGeneratedFunction"

In hindsight, we should have a simple function to get or duplicate a doc string without requiring a lot of REPL code.

@JeffBezanson JeffBezanson added REPL Julia's REPL (Read Eval Print Loop) docsystem The documentation building system compiler:precompilation Precompilation of modules labels Feb 8, 2023
@sostock
Copy link
Contributor

sostock commented Aug 2, 2023

Should this be backported to 1.9? It fixes an issue when creating a Docker image on 1.9 (PainterQubits/Unitful.jl#667).

(I realize that 1.10 is around the corner, but there is a backports PR for 1.9.3, so this PR might as well be added to it.)

@maxstb
Copy link

maxstb commented Aug 2, 2023

I got another issue in OpenSSL.jl which is using the ccall macro as in the Unitful @doc(..) macro PainterQubits/Unitful.jl#667.
Would highly appreciate a fix in 1.9 👍

@vchuravy
Copy link
Member

Some packages depend on REPL_MODULE_REF being set, which does not work in a compilation process where init methods don't run. It would have been better to use a function like get_repl_if_available(), but here we are.

With compilation process you mean PackageCompiler? Because the __init__ methods of dependent packages are being run during pkgimg precompilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules docsystem The documentation building system REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants