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

Pkg.test can't access docstring values via @doc on recent Julia nightly / 1.11 #3650

Closed
ztangent opened this issue Oct 11, 2023 · 1 comment

Comments

@ztangent
Copy link

Discovered this issue when our CI workflow runs for Gen.jl started failing on Julia nightly.

The following code works fine if you run it in the REPL:

using Test

"my function"
function foo()
    return 0
end

io = IOBuffer()
print(io, @doc foo)
@test String(take!(io)) == "my function\n"

However, once you put it in a runtests.jl file of a package, then run Pkg.test on that package, you get the following error:]

     Testing Running tests...
Test Failed at [...]\TestDocstring.jl\test\runtests.jl:10
  Expression: String(take!(io)) == "my function\n"
   Evaluated: "nothing" == "my function\n"

It looks like for some reason @__doc__ foo is returning "nothing" instead of the docstring, and that this only happens within Pkg.test.

Not sure if this is an issue with something in Julia or something in Pkg.jl, but figured I'd file the issue here.

Here's the version info (but the failure also occurs on 1.11.0-DEV.637 and 1.11.0-DEV.636, i.e. the previous two commits):

Julia Version 1.11.0-DEV.638
Commit 3711749292 (2023-10-11 14:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-8665U CPU @ 1.90GHz
  WORD_SIZE: 64
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores
@KristofferC
Copy link
Sponsor Member

Dup of JuliaLang/julia#52986

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

2 participants