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

try_use_package fails due to environment conflicts #191

Open
mortenpi opened this issue Feb 22, 2023 · 1 comment
Open

try_use_package fails due to environment conflicts #191

mortenpi opened this issue Feb 22, 2023 · 1 comment

Comments

@mortenpi
Copy link
Member

try_use_package loads the package in the current environment. But this can cause problems if there are conflicts between the dependencies of the two.

This is the case for MarkdownAST, which fails to precompile. In this case, DocumentationGenerator restricts AbstractTrees to 0.3, but MarkdownAST needs 0.4, and will fail to precompile with 0.3.

┌ Error: `using MarkdownAST did not succeed.`
--
31 | │   exception =
32 | │    LoadError: UndefVarError: childtype not defined
33 | │    in expression starting at /juliateam/.julia/packages/MarkdownAST/CZtZT/src/abstracttrees.jl:4
34 | │    in expression starting at /juliateam/.julia/packages/MarkdownAST/CZtZT/src/MarkdownAST.jl:1
35 | └ @ DocumentationGenerator ~/.julia/packages/DocumentationGenerator/PsZDA/src/DocumentationGenerator.jl:39
Can be MWEd with this:
using DocumentationGenerator

installable_packages = DocumentationGenerator.installable_on_version(VERSION)

pkg = let pkgname = "MarkdownAST", pkgs = collect(installable_packages)
    i = findfirst(kv -> kv.second.name == pkgname, pkgs)
    pkgs[i].second
end

pkg = (; pkg..., server_type = "github", api_url="")

DocumentationGenerator.build_documentation([pkg], basepath=joinpath(@__DIR__))

While #180 would fix the immediate issue, I think DocumentationGenerator should never load the packages it builds into the main env. Instead, it could probably do this check with something like

run(`julia --project=$envdir -e'using $pkg'`)
@mortenpi
Copy link
Member Author

Ah, just noticed #161 and #162.

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

No branches or pull requests

1 participant