Skip to content

Evaluation into the closed module Calculus breaks incremental compilation... #151

@omalled

Description

@omalled

I have a complex code that broke when I switched from Julia 1.4 to Julia 1.5. The breakage seems to be intertwined with the Calculus package. I have tried but failed to produce an MWE (sorry about that). The context is that my complex code is doing some code generation in a macro and then calling Calculus.simplify(ex) on some generated expressions. The error I get when running my complex code is

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

The stack trace leads me to this line. It seems like the eval is the source of the problem. Would there be any harm in evaling in Main rather than Calculus itself? Switching that line to

return (@static (VERSION < v"0.7.0-DEV.5149") ? eval : Core.eval)(Main, ex)

solves my problem and all the tests still pass. I'd be happy to submit a pull request, but not sure if that solution would be accepted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions