Search code examples
githubjuliadocumentation

"expected package `<PACKAGE_NAME> [99a43ef4]` to be registered" in CI workflow


I want to have an exercise in deploying documentation of a tiny personal julia package using GitHub pages. You can check out the repo here. I have an empty branch named gh-pages to commit the doc-related content into it after each release or push. For this, I used a pre-written script for the CI workflow. However, still I cant deploy the docs successfully due to this error:

ERROR: expected package `MFF [99a43ef4]` to be registered

I don't intend to register the package and it's for my personal use. How can I deploy the documentation via GitHub pages?

Further information

Note that I tried to follow several tutorials:

  1. The one that has been provided in Documenter.jl
  2. "How to deploy the documentation of a project" from JuliaNotes.jl

Considering the proposed procedures and the outcome of my attempt, I don't find the topic straightforward. So a concise step-by-step procedure would be helpful.

Q1: What do you mean by "step-by-step"?
A: For example, in the "Use DocumenterTools to generate the keys" (or similarly, in Documenter.jl relevant doc) topic, they mentioned that one can use DocumenterTools.genkeys() to generate public and private keys, but they didn't mention that is it important to run the command in a specific Julia env (like the one in the /docs dir) or not.

The full error of CI workflow is as follows (originally can be found here as well)

Run julia --project=docs -e '
  Installing known registries into `~/.julia`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
ERROR: expected package `MFF [99a43ef4]` to be registered
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Types.jl:67
  [2] check_registered
    @ /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1190 [inlined]
  [3] targeted_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1252
  [4] tiered_resolve(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, julia_version::VersionNumber)
    @ Pkg.Operations /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1225
  [5] _resolve(io::Base.PipeEndpoint, env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}, preserve::Pkg.Types.PreserveLevel, julia_version::VersionNumber)
    @ Pkg.Operations /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1260
  [6] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/Operations.jl:1276
  [7] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.PipeEndpoint, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.PipeEndpoint}}})
    @ Pkg.API /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:275
  [8] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.PipeEndpoint, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:156
  [9] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:145
 [10] #add#27
    @ /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:144 [inlined]
 [11] add
    @ /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:144 [inlined]
 [12] #add#26
    @ /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:143 [inlined]
 [13] add(pkg::String)
    @ Pkg.API /opt/hostedtoolcache/julia/1.8.5/x64/share/julia/stdlib/v1.8/Pkg/src/API.jl:143
 [14] top-level scope
    @ none:2
Error: Process completed with exit code 1.

Solution

  • Hey I noticed two things. First you dont have a Documenter.yml file in your github workflows.

    But I am also thinking Julia can simply not find your package when it runs the

    using MFF
    

    line in your make.jl file (in the docs folder).

    Just comparing it to my own package where documentation works I would think maybe adding

    push!(LOAD_PATH,"../src/")
    using Documenter
    using MFF
    

    to your make.jl file in the docs folder would enable julia to find the MFF package that you are loading.

    Hope this solves your problem.

    Edit: Also just saw that you include the MFF package in the project.toml in the docs folder. I think you need to get rid of that one and just keep the Documenter entry in there.