diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index ba4243ef08..359a6a6149 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -34,7 +34,7 @@ jobs: fail-fast: false matrix: # We test quite a lot of versions because we do some OS and version specific things unfortunately - julia-version: ["1.6", "1.8", "1.10"] #, "nightly"] # "~1.11.0-0"] + julia-version: ["1.6", "1.8", "1.10", "nightly"] # "~1.11.0-0"] os: [ubuntu-latest, macOS-latest, windows-latest] steps: diff --git a/.gitignore b/.gitignore index a2b07a1d8d..4f073338b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.jl.cov *.jl.*.cov *.jl.mem -precompile.jl build Manifest.toml diff --git a/frontend/editor.css b/frontend/editor.css index f97b297873..49998a2c8c 100644 --- a/frontend/editor.css +++ b/frontend/editor.css @@ -34,10 +34,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; - --system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; + --system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } @@ -2410,7 +2410,7 @@ pluto-helpbox.hidden > section { /* see https://github.com/JuliaDocs/Documenter.jl for author information */ .helpbox-docs { - font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif; + font-family: var(--lato-ui-font-stack); line-height: 1.5; font-size: 0.9rem; } diff --git a/frontend/error.css b/frontend/error.css index 26b5fee8c6..defc7c1282 100644 --- a/frontend/error.css +++ b/frontend/error.css @@ -3,8 +3,8 @@ } :root { - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; --system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; color-scheme: light dark; diff --git a/frontend/welcome.css b/frontend/welcome.css index c1e76db4f2..48de994018 100644 --- a/frontend/welcome.css +++ b/frontend/welcome.css @@ -7,10 +7,10 @@ --pluto-operator-ligatures: none; --julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace; --sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; - --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; - --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji", - "Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif; + --lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; + --inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji", + "Segoe UI Symbol", system-ui, sans-serif; color-scheme: light dark; } diff --git a/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl b/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl index bc0c9ddca1..25f3fd9f6e 100644 --- a/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl +++ b/src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl @@ -136,7 +136,12 @@ function maybe_macroexpand_pluto(ex::Expr; recursive::Bool=false, expand_bind::B funcname = ExpressionExplorer.split_funcname(ex.args[1]) if funcname.joined ∈ (expand_bind ? can_macroexpand : can_macroexpand_no_bind) - macroexpand(get_plutorunner(), ex; recursive=false)::Expr + try + macroexpand(get_plutorunner(), ex; recursive=false)::Expr + catch e + @debug "Could not macroexpand" ex exception=(e, catch_backtrace()) + ex + end else ex end diff --git a/src/precompile.jl b/src/precompile.jl index 69ad276bf9..d7bbb8bd6b 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -1,18 +1,6 @@ using PrecompileTools: PrecompileTools -const __TEST_NOTEBOOK_ID = uuid1() - PrecompileTools.@compile_workload begin - let - channel = Channel{Any}(10) - Pluto.PlutoRunner.setup_plutologger( - __TEST_NOTEBOOK_ID, - channel, - ) - end - expr = Expr(:toplevel, :(1 + 1)) - Pluto.PlutoRunner.run_expression(Module(), expr, __TEST_NOTEBOOK_ID, uuid1(), nothing); - nb = Pluto.Notebook([ Pluto.Cell("""md"Hello *world*" """) Pluto.Cell("""[f(x)]""") diff --git a/src/runner/PlutoRunner/Project.toml b/src/runner/PlutoRunner/Project.toml index 191b55efc1..58ac9e3d71 100644 --- a/src/runner/PlutoRunner/Project.toml +++ b/src/runner/PlutoRunner/Project.toml @@ -12,9 +12,11 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" [compat] FuzzyCompletions = "0.3,0.4,0.5" +PrecompileTools = "1" diff --git a/src/runner/PlutoRunner/src/PlutoRunner.jl b/src/runner/PlutoRunner/src/PlutoRunner.jl index 2a6bb6381f..466a7c2de1 100644 --- a/src/runner/PlutoRunner/src/PlutoRunner.jl +++ b/src/runner/PlutoRunner/src/PlutoRunner.jl @@ -2699,4 +2699,6 @@ function setup_plutologger(notebook_id::UUID, log_channel::Channel{Any}) pluto_log_channels[notebook_id] = log_channel end +include("./precompile.jl") + end diff --git a/src/runner/PlutoRunner/src/precompile.jl b/src/runner/PlutoRunner/src/precompile.jl new file mode 100644 index 0000000000..16bd57b9b1 --- /dev/null +++ b/src/runner/PlutoRunner/src/precompile.jl @@ -0,0 +1,20 @@ +using PrecompileTools: PrecompileTools +using UUIDs: uuid1 + +const __TEST_NOTEBOOK_ID = uuid1() + +PrecompileTools.@compile_workload begin + let + channel = Channel{Any}(10) + PlutoRunner.setup_plutologger( + __TEST_NOTEBOOK_ID, + channel, + ) + end + expr = Expr(:toplevel, :(1 + 1)) + cell_id = uuid1() + workspace = Module() + PlutoRunner.run_expression(workspace, expr, __TEST_NOTEBOOK_ID, cell_id, nothing); + PlutoRunner.formatted_result_of(__TEST_NOTEBOOK_ID, cell_id, + false, String[], nothing, workspace; capture_stdout=true) +end diff --git a/test/helpers.jl b/test/helpers.jl index ff7406b42d..a436f87fc7 100644 --- a/test/helpers.jl +++ b/test/helpers.jl @@ -48,9 +48,14 @@ end function expecterror(err, cell; strict=true) cell.errored || return false - io = IOBuffer() - showerror(io, err) - msg = String(take!(io)) + msg = sprint(showerror, err) + + # UndefVarError(:x, #undef) + if err isa UndefVarError && !isdefined(err, :scope) && VERSION > v"1.10" + strict = false + msg = first(split(msg, '\n'; limit=2)) + end + if strict return cell.output.body[:msg] == msg else