From 97499d0b64cea08cb1db7586995118e409535b3a Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Sat, 11 Nov 2023 05:23:11 +0100 Subject: [PATCH 1/3] remove recompilation dependency check in Pkg.precompile (#3696) Co-authored-by: Ian Butterworth (cherry picked from commit debc38b9a2d800f035a17f42a01c14a3775fa859) --- src/API.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/API.jl b/src/API.jl index ba917eb241..d1e5c89798 100644 --- a/src/API.jl +++ b/src/API.jl @@ -1481,10 +1481,8 @@ function precompile(ctx::Context, pkgs::Vector{PackageSpec}; internal_call::Bool queued = precomp_queued(pkgspec) circular = pkg in circular_deps - # skip stale checking and force compilation if any dep was recompiled in this session - any_dep_recompiled = any(map(dep->was_recompiled[dep], deps)) is_stale = true - if !circular && (queued || any_dep_recompiled || (!suspended && (is_stale = !Base.isprecompiled(pkg; ignore_loaded=true, stale_cache, cachepaths, sourcepath)))) + if !circular && (queued || (!suspended && (is_stale = !Base.isprecompiled(pkg; ignore_loaded=true, stale_cache, cachepaths, sourcepath)))) Base.acquire(parallel_limiter) is_direct_dep = pkg in direct_deps From 196393738bef302fa42eee0279baf97cd261b734 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sat, 4 Nov 2023 00:08:37 -0400 Subject: [PATCH 2/3] Don't clean test temp files (#3683) (cherry picked from commit 04ea9a824fdddb7406250d51eba015e787432338) --- Project.toml | 4 ++-- test/runtests.jl | 7 ++++++- test/utils.jl | 40 +++++++++++++++++++++++----------------- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/Project.toml b/Project.toml index 941186c29d..7d03520d31 100644 --- a/Project.toml +++ b/Project.toml @@ -28,9 +28,9 @@ p7zip_jll = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" HistoricalStdlibVersions = "1.2" [extras] -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -Preferences = "21216c6a-2e73-6563-6e65-726566657250" HistoricalStdlibVersions = "6df8b67a-e8a0-4029-b4b7-ac196fe72102" +Preferences = "21216c6a-2e73-6563-6e65-726566657250" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test", "Preferences", "HistoricalStdlibVersions"] diff --git a/test/runtests.jl b/test/runtests.jl index a7aeee73d0..67231a7393 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -95,7 +95,12 @@ Logging.with_logger(hide_logs ? Logging.NullLogger() : Logging.current_logger()) end end -@showtime Base.Filesystem.temp_cleanup_purge(force=true) +if haskey(ENV, "CI") + # if CI don't clean up as it will be slower than the runner filesystem reset + empty!(Base.Filesystem.TEMP_CLEANUP) +else + @showtime Base.Filesystem.temp_cleanup_purge(force=true) +end end # module diff --git a/test/utils.jl b/test/utils.jl index 38c1ae684b..bdeaddad03 100644 --- a/test/utils.jl +++ b/test/utils.jl @@ -81,7 +81,7 @@ function isolate(fn::Function; loaded_depot=false, linked_reg=true) loaded_depot && push!(DEPOT_PATH, LOADED_DEPOT) fn() finally - if target_depot !== nothing && isdir(target_depot) + if !haskey(ENV, "CI") && target_depot !== nothing && isdir(target_depot) try Base.rm(target_depot; force=true, recursive=true) catch err @@ -148,12 +148,14 @@ function temp_pkg_dir(fn::Function;rm=true, linked_reg=true) push!(DEPOT_PATH, depot_dir) fn(env_dir) finally - try - rm && Base.rm(env_dir; force=true, recursive=true) - rm && Base.rm(depot_dir; force=true, recursive=true) - catch err - # Avoid raising an exception here as it will mask the original exception - println(stderr_f(), "Exception in finally: $(sprint(showerror, err))") + if rm && !haskey(ENV, "CI") + try + Base.rm(env_dir; force=true, recursive=true) + Base.rm(depot_dir; force=true, recursive=true) + catch err + # Avoid raising an exception here as it will mask the original exception + println(stderr_f(), "Exception in finally: $(sprint(showerror, err))") + end end end end @@ -175,11 +177,13 @@ function cd_tempdir(f; rm=true) cd(tmp) do f(tmp) end - try - rm && Base.rm(tmp; force = true, recursive = true) - catch err - # Avoid raising an exception here as it will mask the original exception - println(stderr_f(), "Exception in finally: $(sprint(showerror, err))") + if rm && !haskey(ENV, "CI") + try + Base.rm(tmp; force = true, recursive = true) + catch err + # Avoid raising an exception here as it will mask the original exception + println(stderr_f(), "Exception in finally: $(sprint(showerror, err))") + end end end @@ -212,11 +216,13 @@ function with_temp_env(f, env_name::AbstractString="Dummy"; rm=true) applicable(f, env_path) ? f(env_path) : f() finally Base.ACTIVE_PROJECT[] = prev_active - try - rm && Base.rm(env_path; force = true, recursive = true) - catch err - # Avoid raising an exception here as it will mask the original exception - println(stderr_f(), "Exception in finally: $(sprint(showerror, err))") + if rm && !haskey(ENV, "CI") + try + Base.rm(env_path; force = true, recursive = true) + catch err + # Avoid raising an exception here as it will mask the original exception + println(stderr_f(), "Exception in finally: $(sprint(showerror, err))") + end end end end From 5e5c6c449e016bf2e512689f44f123ae2d491592 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Thu, 23 Nov 2023 11:34:21 +0100 Subject: [PATCH 3/3] Use `startup=no` during `build` unless julia session explicitly set `startup=yes` (#3699) --------- Co-authored-by: Kristoffer Carlsson (cherry picked from commit 5610445a32f61b95abad64b2ab524096b991bb62) --- src/Operations.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Operations.jl b/src/Operations.jl index 193512f6f6..498f9f9ccc 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -1025,8 +1025,12 @@ function gen_build_code(build_file::String; inherit_project::Bool = false) cd($(repr(dirname(build_file)))) include($(repr(build_file))) """ + # This will make it so that running Pkg.build runs the build in a session with --startup=no + # *unless* the parent julia session is started with --startup=yes explicitly. + startup_flag = Base.JLOptions().startupfile == 1 ? "yes" : "no" return ``` $(Base.julia_cmd()) -O0 --color=no --history-file=no + --startup-file=$startup_flag $(inherit_project ? `--project=$(Base.active_project())` : ``) --eval $code ```