Skip to content

Commit 4fc2dea

Browse files
vtjnashKristofferC
authored andcommitted
fix Module for Base.jl for Revise.jl (#58549)
Just happened to notice in passing that `_included_files[1]` did not get fixed when Base_compiler.jl was split from Base.jl so it causes warnings sometimes in Revise.jl CI (cherry picked from commit 488be22)
1 parent 0f7d95e commit 4fc2dea

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

base/Base.jl

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ include(strcat(BUILDROOT, "version_git.jl")) # include($BUILDROOT/base/version_g
2323
# a slightly more verbose fashion than usual, because we're running so early.
2424
let os = ccall(:jl_get_UNAME, Any, ())
2525
if os === :Darwin || os === :Apple
26-
if Base.DARWIN_FRAMEWORK
26+
if DARWIN_FRAMEWORK
2727
push!(DL_LOAD_PATH, "@loader_path/Frameworks")
2828
end
2929
push!(DL_LOAD_PATH, "@loader_path")
@@ -306,8 +306,8 @@ a_method_to_overwrite_in_test() = inferencebarrier(1)
306306
(this::IncludeInto)(mapexpr::Function, fname::AbstractString) = include(mapexpr, this.m, fname)
307307

308308
# Compatibility with when Compiler was in Core
309-
@eval Core const Compiler = Main.Base.Compiler
310-
@eval Compiler const fl_parse = Core.Main.Base.fl_parse
309+
@eval Core const Compiler = $Base.Compiler
310+
@eval Compiler const fl_parse = $Base.fl_parse
311311

312312
# External libraries vendored into Base
313313
Core.println("JuliaSyntax/src/JuliaSyntax.jl")
@@ -323,13 +323,13 @@ if is_primary_base_module
323323
# Profiling helper
324324
# triggers printing the report and (optionally) saving a heap snapshot after a SIGINFO/SIGUSR1 profile request
325325
# Needs to be in Base because Profile is no longer loaded on boot
326-
function profile_printing_listener(cond::Base.AsyncCondition)
326+
function profile_printing_listener(cond::AsyncCondition)
327327
profile = nothing
328328
try
329329
while _trywait(cond)
330330
profile = @something(profile, require_stdlib(PkgId(UUID("9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"), "Profile")))::Module
331331
invokelatest(profile.peek_report[])
332-
if Base.get_bool_env("JULIA_PROFILE_PEEK_HEAP_SNAPSHOT", false) === true
332+
if get_bool_env("JULIA_PROFILE_PEEK_HEAP_SNAPSHOT", false) === true
333333
println(stderr, "Saving heap snapshot...")
334334
fname = invokelatest(profile.take_heap_snapshot)
335335
println(stderr, "Heap snapshot saved to `$(fname)`")
@@ -344,8 +344,8 @@ function profile_printing_listener(cond::Base.AsyncCondition)
344344
end
345345

346346
function start_profile_listener()
347-
cond = Base.AsyncCondition()
348-
Base.uv_unref(cond.handle)
347+
cond = AsyncCondition()
348+
uv_unref(cond.handle)
349349
t = errormonitor(Threads.@spawn(profile_printing_listener(cond)))
350350
atexit() do
351351
# destroy this callback when exiting
@@ -405,7 +405,6 @@ end
405405
const _compiler_require_dependencies = Any[]
406406
@Core.latestworld
407407
for i = 1:length(_included_files)
408-
isassigned(_included_files, i) || continue
409408
(mod, file) = _included_files[i]
410409
if mod === Compiler || parentmodule(mod) === Compiler || endswith(file, "/Compiler.jl")
411410
_include_dependency!(_compiler_require_dependencies, true, mod, file, true, false)
@@ -421,7 +420,3 @@ end
421420
@assert length(_compiler_require_dependencies) >= 15
422421

423422
end
424-
425-
# Ensure this file is also tracked
426-
@assert !isassigned(_included_files, 1)
427-
_included_files[1] = (parentmodule(Base), abspath(@__FILE__))

base/Base_compiler.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,5 +384,9 @@ Core._setparser!(fl_parse)
384384

385385
# Further definition of Base will happen in Base.jl if loaded.
386386

387+
# Ensure this file is also tracked
388+
@assert !isassigned(_included_files, 1)
389+
_included_files[1] = (@__MODULE__, ccall(:jl_prepend_cwd, Any, (Any,), "Base_compiler.jl"))
390+
387391
end # module Base
388392
using .Base

base/sysimg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

3-
Base.Core.include(Base, "Base.jl") # finish populating Base (currently just has the Compiler)
3+
Base.include("Base.jl") # finish populating Base (currently just has the Compiler)
44

55
# Set up Main module by importing from Base
66
using .Base

0 commit comments

Comments
 (0)