JuliaPackaging / Requires.jl

Lazy code loading for Julia
Other
195 stars 28 forks source link

Differences between 1.8 and 1.7? #108

Closed cormullion closed 2 years ago

cormullion commented 2 years ago

I've been struggling to use Requires.jl to have a conditional dependency. I want MathTeXEngine to be "required" as needed by Luxor.jl rather than added as a dependency.

On Julia 1.7, running Luxor.jl tests shows this warning but the tests continue and pass:

┌ Warning: Package Luxor does not have MathTeXEngine in its dependencies:
│ - If you have Luxor checked out for development and have
│   added MathTeXEngine as a dependency but haven't updated your primary
│   environment's manifest file, try `Pkg.resolve()`.
│ - Otherwise you may need to report an issue with Luxor
└ Loading MathTeXEngine into Luxor from project dependency, future warnings for Luxor are suppressed.

But on Julia 1.8 (Version 1.8.0-beta1 (2022-02-23)), running the same tests, that last line ("Loading ...") doesn't appear, and the rest of the tests fail:

┌ Warning: Error requiring `LaTeXStrings` from `Luxor`
│   exception =
│    LoadError: ArgumentError: Package Luxor does not have MathTeXEngine in its dependencies:
│    - You may have a partially installed environment. Try `Pkg.instantiate()`
│      to ensure all packages in the environment are installed.
│    - Or, if you have Luxor checked out for development and have
│      added MathTeXEngine as a dependency but haven't updated your primary
│      environment's manifest file, try `Pkg.resolve()`.
│    - Otherwise you may need to report an issue with Luxor
│    Stacktrace:

How can I make the 1.8 behaviour the same as the 1.7?

KristofferC commented 2 years ago

https://github.com/JuliaGraphics/Luxor.jl/pull/207 should fix it

cormullion commented 2 years ago

It works! Thanks.