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

doctest() fails when git is not installed #1870

Closed
glennmoy opened this issue Jul 12, 2022 · 2 comments · Fixed by #1871
Closed

doctest() fails when git is not installed #1870

glennmoy opened this issue Jul 12, 2022 · 2 comments · Fixed by #1871
Milestone

Comments

@glennmoy
Copy link

We are running CI jobs using a docker image that doesn't have git installed (stacktrace below) and the jobs have been failing since 0.27.20.

Looking at the changes in https://gitlab.invenia.ca/invenia/Metrics.jl/-/pipelines/202985, we can see there is an extra call to git that happens outside of a try catch block a few lines below, and this is where we fail in the stacktrace (see below).

Is this expected behaviour? Should Documenter work without needing git?
Would setting disable_git avoid this error?

Thanks in advance!

Error: Doctesting failed
│   exception =
│    Unable to find `git`
│    Stacktrace:
│      [1] error(s::String)
│        @ Base ./error.jl:33
│      [2] git(; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ Documenter.Utilities ~/.julia/packages/Documenter/lG4NP/src/Utilities/Utilities.jl:848
│      [3] git
│        @ ~/.julia/packages/Documenter/lG4NP/src/Utilities/Utilities.jl:847 [inlined]
│      [4] git_remote_head_branch(varname::String, root::String; remotename::String, fallback::String)
│        @ Documenter.Utilities ~/.julia/packages/Documenter/lG4NP/src/Utilities/Utilities.jl:797
│      [5] git_remote_head_branch
│        @ ~/.julia/packages/Documenter/lG4NP/src/Utilities/Utilities.jl:797 [inlined]
│      [6] Documenter.Writers.HTMLWriter.HTML()
│        @ Documenter.Writers.HTMLWriter ~/.julia/packages/Documenter/lG4NP/src/Writers/HTMLWriter.jl:443
│      [7] (::Documenter.var"#all_doctests#32"{Bool, Vector{Regex}, Vector{Module}})()
│        @ Documenter ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:941
│      [8] macro expansion
│        @ ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:962 [inlined]
│      [9] macro expansion
│        @ /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
│     [10] doctest(source::String, modules::Vector{Module}; fix::Bool, testset::String, doctestfilters::Vector{Regex})
│        @ Documenter ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:962
│     [11] doctest(package::Module; manual::Bool, testset::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
│        @ Documenter ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:897
│     [12] doctest(package::Module)
│        @ Documenter ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:884
│     [13] macro expansion
│        @ /builds/invenia/Metrics.jl/test/runtests.jl:29 [inlined]
│     [14] macro expansion
│        @ /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
│     [15] top-level scope
│        @ /builds/invenia/Metrics.jl/test/runtests.jl:29
│     [16] include(fname::String)
│        @ Base.MainInclude ./client.jl:444
│     [17] top-level scope
│        @ none:6
│     [18] eval
│        @ ./boot.jl:360 [inlined]
│     [19] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:261
│     [20] _start()
│        @ Base ./client.jl:[485](https://gitlab.invenia.ca/invenia/Metrics.jl/-/jobs/1725827#L485)
└ @ Documenter ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:951
Doctests: Metrics: Test Failed at /root/.julia/packages/Documenter/lG4NP/src/Documenter.jl:962
  Expression: all_doctests()
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:962 [inlined]
 [2] macro expansion
   @ /buildworker/worker/package_linuxaarch64/build/usr/share/julia/stdlib/v1.6/Test/src/Test.jl:1151 [inlined]
 [3] doctest(source::String, modules::Vector{Module}; fix::Bool, testset::String, doctestfilters::Vector{Regex})
   @ Documenter ~/.julia/packages/Documenter/lG4NP/src/Documenter.jl:962
@mortenpi mortenpi added this to the 0.27.21 milestone Jul 12, 2022
@mortenpi
Copy link
Member

This is an oversight from #1862 --- it should print a warning and return the fallback when we can't find git. I presume you were getting warnings before?

@glennmoy
Copy link
Author

Handle missing Git in git_remote_head_branch #1871

yes, that's correct. Thanks for taking a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants