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

Fix docs for Experimental.@force_compile #42760

Merged
merged 1 commit into from
Oct 23, 2021
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented Oct 22, 2021

Also adds a direct test (we didn't used to have one and I hadn't really yet worked out how to do this). Responding to #42379 (comment)

@timholy
Copy link
Member Author

timholy commented Oct 22, 2021

The doctest failure is surprising; does Documenter strip meta Exprs?

Since the same test is in test/ I am inclined to just strip the jldoctest, but I'll see if someone knows of an easy fix.

@JeffBezanson
Copy link
Member

When the doctest is running the code, there is extra stuff in the stack, so "interpreter" is probably sneaking in there.

@timholy timholy force-pushed the teh/force_compile_docs branch from 3dd29b5 to 5ff4660 Compare October 22, 2021 22:39
@timholy
Copy link
Member Author

timholy commented Oct 22, 2021

I just stripped the jldoctest. Should be good to go if tests pass.

@simeonschaub simeonschaub merged commit 030a0f9 into master Oct 23, 2021
@simeonschaub simeonschaub deleted the teh/force_compile_docs branch October 23, 2021 01:29
@IanButterworth
Copy link
Member

IanButterworth commented Oct 24, 2021

I think this caused a failure on MacOS here?
https://build.julialang.org/#/builders/26/builds/4880/steps/5/logs/stdio
https://build.julialang.org/#/builders/26/builds/4886

@DilumAluthge
Copy link
Member

Revert PR: #42784

@IanButterworth
Copy link
Member

For reference, the tests pass locally on my mac

julia> @test !occursin("interpreter", string(stacktrace(
           begin
               Base.Experimental.@force_compile
               backtrace()
           end, true)))
Test Passed
  Expression: !(occursin("interpreter", string(stacktrace(begin
                    #= REPL[56]:3 =# Base.Experimental.@force_compile
                    backtrace()
                end, true))))
   Evaluated: !(occursin("interpreter", "Base.StackTraces.StackFrame[top-level scope at Test.jl:460, jl_toplevel_eval_flex at toplevel.c:880, jl_toplevel_eval_flex at toplevel.c:833, jl_toplevel_eval_flex at toplevel.c:833, ijl_toplevel_eval at toplevel.c:898 [inlined], ijl_toplevel_eval_in at toplevel.c:948, eval at boot.jl:368 [inlined], eval_user_input(ast::Any, backend::REPL.REPLBackend) at REPL.jl:151, repl_backend_loop(backend::REPL.REPLBackend) at REPL.jl:245, start_repl_backend(backend::REPL.REPLBackend, consumer::Any) at REPL.jl:230, run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool) at REPL.jl:363, run_repl(repl::REPL.AbstractREPL, consumer::Any) at REPL.jl:350, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, (::Base.var\"#940#942\"{Bool, Bool, Bool})(REPL::Module) at client.jl:394, (::Base.var\"#940#942\"{Bool, Bool, Bool})(REPL::Module) at sys.dylib:?, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, jl_apply at julia.h:1773 [inlined], jl_f__call_latest at builtins.c:757, #invokelatest#2 at essentials.jl:718 [inlined], invokelatest at essentials.jl:716 [inlined], run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool) at client.jl:379, exec_options(opts::Base.JLOptions) at client.jl:309, _start() at client.jl:497, _start() at sys.dylib:?, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, jl_apply at julia.h:1773 [inlined], true_main at jlapi.c:562, jl_repl_entrypoint at jlapi.c:706]"))

julia> @test  occursin("interpreter", string(stacktrace(
           begin
               backtrace()
           end, true)))
Test Passed
  Expression: occursin("interpreter", string(stacktrace(begin
                backtrace()
            end, true)))
   Evaluated: occursin("interpreter", "Base.StackTraces.StackFrame[backtrace() at sys.dylib:?, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, jl_apply at julia.h:1773 [inlined], do_call at interpreter.c:126, eval_body at interpreter.c:0, eval_body at interpreter.c:522, jl_interpret_toplevel_thunk at interpreter.c:739, top-level scope at Test.jl:460, jl_toplevel_eval_flex at toplevel.c:889, jl_toplevel_eval_flex at toplevel.c:833, jl_toplevel_eval_flex at toplevel.c:833, ijl_toplevel_eval at toplevel.c:898 [inlined], ijl_toplevel_eval_in at toplevel.c:948, eval at boot.jl:368 [inlined], eval_user_input(ast::Any, backend::REPL.REPLBackend) at REPL.jl:151, repl_backend_loop(backend::REPL.REPLBackend) at REPL.jl:245, start_repl_backend(backend::REPL.REPLBackend, consumer::Any) at REPL.jl:230, run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool) at REPL.jl:363, run_repl(repl::REPL.AbstractREPL, consumer::Any) at REPL.jl:350, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, (::Base.var\"#940#942\"{Bool, Bool, Bool})(REPL::Module) at client.jl:394, (::Base.var\"#940#942\"{Bool, Bool, Bool})(REPL::Module) at sys.dylib:?, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, jl_apply at julia.h:1773 [inlined], jl_f__call_latest at builtins.c:757, #invokelatest#2 at essentials.jl:718 [inlined], invokelatest at essentials.jl:716 [inlined], run_main_repl(interactive::Bool, quiet::Bool, banner::Bool, history_file::Bool, color_set::Bool) at client.jl:379, exec_options(opts::Base.JLOptions) at client.jl:309, _start() at client.jl:497, _start() at sys.dylib:?, _jl_invoke at gf.c:0 [inlined], ijl_apply_generic at gf.c:2437, jl_apply at julia.h:1773 [inlined], true_main at jlapi.c:562, jl_repl_entrypoint at jlapi.c:706]")

julia> versioninfo()
Julia Version 1.8.0-DEV.806
Commit 471600eb0f* (2021-10-23 18:16 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin20.6.0)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 6

dkarrasch pushed a commit that referenced this pull request Oct 24, 2021
@timholy
Copy link
Member Author

timholy commented Oct 24, 2021

Thanks for checking @IanButterworth; since I don't have a mac, that will save me some head-scratching. I would be tempted to just skip that test on a mac, but I think it will pay to be more careful than that. I'll submit a sequence of debugging commits as a draft to see if I can understand the failure.

timholy added a commit that referenced this pull request Oct 24, 2021
DilumAluthge pushed a commit that referenced this pull request Oct 25, 2021
* Revert "Revert "Fix docs for `Experimental.@force_compile` (#42760)" (#42784)"

This reverts commit dad4071.

* Truncate test harness from stacktrace
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
* Revert "Revert "Fix docs for `Experimental.@force_compile` (JuliaLang#42760)" (JuliaLang#42784)"

This reverts commit dad4071.

* Truncate test harness from stacktrace
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
* Revert "Revert "Fix docs for `Experimental.@force_compile` (JuliaLang#42760)" (JuliaLang#42784)"

This reverts commit dad4071.

* Truncate test harness from stacktrace
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

Successfully merging this pull request may close these issues.

5 participants