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

Incremental compilation error with @doc on a submodule #37771

Closed
tkf opened this issue Sep 27, 2020 · 3 comments · Fixed by #38013
Closed

Incremental compilation error with @doc on a submodule #37771

tkf opened this issue Sep 27, 2020 · 3 comments · Fixed by #38013
Milestone

Comments

@tkf
Copy link
Member

tkf commented Sep 27, 2020

In recent versions of Julia 1.6-DEV, this MWE (tkf/MyPlayground.jl#38)

module MyPlayground

module Extras end

@doc "Extras docstring" Extras

end # module

fails to precompile with error

ERROR: LoadError: Evaluation into the closed module `Extras` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `Extras` with `eval` during precompilation - don't do this.

--- https://travis-ci.com/github/tkf/MyPlayground.jl/builds/186853140#L228

@tkf
Copy link
Member Author

tkf commented Sep 27, 2020

It looks like 3826279 (#37626) introduced the bug. See the brute-force search here: https://github.com/tkf/julia/actions/runs/274646833

cc @timholy

mergify bot pushed a commit to JuliaPreludes/Maybe.jl that referenced this issue Sep 27, 2020
This patch workarounds the change in Julia 1.6-DEV
JuliaLang/julia#37771
i.e., `@doc SubModule "..."` outside `SubModule` stopped working.

This patch avoids the precompilation error by simply inlining `Extras`
docstring.
@tkf
Copy link
Member Author

tkf commented Sep 27, 2020

I implemented a workaround in my package affected by this.

Depending on how hard it is to solve this, I think it might be reasonable to treat #37626 as a "minor change" and leave it as-is.

@vtjnash
Copy link
Member

vtjnash commented Sep 27, 2020

That eval is supposed to be permitted

@KristofferC KristofferC added this to the 1.6 features milestone Sep 27, 2020
vtjnash added a commit that referenced this issue Oct 13, 2020
This was never intended to be disallowed, but got mixed up in a refactor.

Fixes #37771
vtjnash added a commit that referenced this issue Oct 13, 2020
This was never intended to be disallowed, but got mixed up in a refactor.

Fixes #37771
vtjnash added a commit that referenced this issue Oct 15, 2020
This was never intended to be disallowed, but got mixed up in a refactor.

Fixes #37771
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 a pull request may close this issue.

3 participants