-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 build_sysimg on windows #18393
Fix build_sysimg on windows #18393
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ function build_sysimg(sysimg_path=nothing, cpu_target="native", userimg_path=not | |
userimg_path = abspath(userimg_path) | ||
end | ||
|
||
# Enter base/ and setup some useful paths | ||
# Enter base and setup some useful paths | ||
base_dir = dirname(Base.find_source_file("sysimg.jl")) | ||
cd(base_dir) do | ||
julia = joinpath(JULIA_HOME, debug ? "julia-debug" : "julia") | ||
|
@@ -71,18 +71,18 @@ function build_sysimg(sysimg_path=nothing, cpu_target="native", userimg_path=not | |
try | ||
# Start by building inference0.{ji,o} | ||
inference0_path = joinpath(dirname(sysimg_path), "inference0") | ||
info("Building inference0.o...") | ||
info("Building inference0.o") | ||
println("$julia -C $cpu_target --output-ji $inference0_path.ji --output-o $inference0_path.o coreimg.jl") | ||
run(`$julia -C $cpu_target --output-ji $inference0_path.ji --output-o $inference0_path.o coreimg.jl`) | ||
|
||
# Bootstrap off off that to create inference.{ji,o} | ||
inference_path = joinpath(dirname(sysimg_path), "inference") | ||
info("Building inference.o...") | ||
info("Building inference.o") | ||
println("$julia -C $cpu_target --output-ji $inference_path.ji --output-o $inference_path.o coreimg.jl") | ||
run(`$julia -C $cpu_target --output-ji $inference_path.ji --output-o $inference_path.o coreimg.jl`) | ||
|
||
# Bootstrap off off that to create sys.{ji,o} | ||
info("Building sys.o...") | ||
info("Building sys.o") | ||
println("$julia -C $cpu_target --output-ji $sysimg_path.ji --output-o $sysimg_path.o -J $inference_path.ji --startup-file=no sysimg.jl") | ||
run(`$julia -C $cpu_target --output-ji $sysimg_path.ji --output-o $sysimg_path.o -J $inference_path.ji --startup-file=no sysimg.jl`) | ||
|
||
|
@@ -161,9 +161,15 @@ function link_sysimg(sysimg_path=nothing, cc=find_system_compiler(), debug=false | |
push!(FLAGS, "-lssp") | ||
end | ||
|
||
sysimg_file = "$sysimg_path.$(Libdl.dlext)" | ||
info("Linking sys.$(Libdl.dlext)") | ||
run(`$cc $FLAGS -o $sysimg_path.$(Libdl.dlext) $sysimg_path.o`) | ||
|
||
if is_windows() && isfile(sysimg_file) | ||
mv(sysimg_file, "$sysimg_file.old"; remove_destination=true) | ||
run(`$cc $FLAGS -o $sysimg_file $sysimg_path.o`) | ||
run(`rm "$sysimg_path.$(Libdl.dlext).old"`) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little surprised this doesn't error, even after the file has been moved it's still loaded by the running executable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe. I have seen many times in windows that a stubborn file that refuses to be deleted just needs a rename, before you can delete it, strange but it work. |
||
else | ||
run(`$cc $FLAGS -o $sysimg_file $sysimg_path.o`) | ||
end | ||
info("System image successfully built at $sysimg_path.$(Libdl.dlext)") | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this inference0 step is completely unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, i'll remove it. The only reference I have explaining inference0 is here https://github.com/JuliaLang/julia/blob/6b5a05eb1a029aef93f77b60bb1d745c7d6e1d8d/doc/devdocs/functions.rst
(scroll all the way down)
It doesn't show up in any other search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vtjnash hasn't updated the devdocs since he removed the inference0 step