Skip to content

Commit 488be22

Browse files
authored
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
1 parent 0cbe466 commit 488be22

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")
@@ -312,8 +312,8 @@ a_method_to_overwrite_in_test() = inferencebarrier(1)
312312
(this::IncludeInto)(mapexpr::Function, fname::AbstractString) = include(mapexpr, this.m, fname)
313313

314314
# Compatibility with when Compiler was in Core
315-
@eval Core const Compiler = Main.Base.Compiler
316-
@eval Compiler const fl_parse = Core.Main.Base.fl_parse
315+
@eval Core const Compiler = $Base.Compiler
316+
@eval Compiler const fl_parse = $Base.fl_parse
317317

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

352352
function start_profile_listener()
353-
cond = Base.AsyncCondition()
354-
Base.uv_unref(cond.handle)
353+
cond = AsyncCondition()
354+
uv_unref(cond.handle)
355355
t = errormonitor(Threads.@spawn(profile_printing_listener(cond)))
356356
atexit() do
357357
# destroy this callback when exiting
@@ -411,7 +411,6 @@ end
411411
const _compiler_require_dependencies = Any[]
412412
@Core.latestworld
413413
for i = 1:length(_included_files)
414-
isassigned(_included_files, i) || continue
415414
(mod, file) = _included_files[i]
416415
if mod === Compiler || parentmodule(mod) === Compiler || endswith(file, "/Compiler.jl")
417416
_include_dependency!(_compiler_require_dependencies, true, mod, file, true, false)
@@ -427,7 +426,3 @@ end
427426
@assert length(_compiler_require_dependencies) >= 15
428427

429428
end
430-
431-
# Ensure this file is also tracked
432-
@assert !isassigned(_included_files, 1)
433-
_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
@@ -389,5 +389,9 @@ Core._setlowerer!(fl_lower)
389389

390390
# Further definition of Base will happen in Base.jl if loaded.
391391

392+
# Ensure this file is also tracked
393+
@assert !isassigned(_included_files, 1)
394+
_included_files[1] = (@__MODULE__, ccall(:jl_prepend_cwd, Any, (Any,), "Base_compiler.jl"))
395+
392396
end # module Base
393397
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)