Skip to content

Commit ce2a7d6

Browse files
aviatesklgoettgens
andauthored
persistent_tasks: suppress logs from Pkg.jl (#256)
* persistent_tasks: suppress logs from Pkg.jl By using `io=devnull` option, which is only available in Julia 1.9 and above. * Add changelog, bump version * Make killing less noisy --------- Co-authored-by: Lars Göttgens <[email protected]>
1 parent e9a4230 commit ce2a7d6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.8.3] - 2023-11-29
11+
12+
## Changed
13+
14+
- `test_persistent_tasks` is now less noisy. ([#256](https://github.com/JuliaTesting/Aqua.jl/pull/256))
15+
1016

1117
## [0.8.2] - 2023-11-16
1218

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Aqua"
22
uuid = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
authors = ["Takafumi Arakaki <[email protected]> and contributors"]
4-
version = "0.8.2"
4+
version = "0.8.3"
55

66
[deps]
77
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"

src/persistent_tasks.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function find_persistent_tasks_deps(package::Module; kwargs...)
118118
end
119119

120120
function precompile_wrapper(project, tmax)
121-
if VERSION < v"1.10.0-"
121+
@static if VERSION < v"1.10.0-"
122122
return true
123123
end
124124
prev_project = Base.active_project()::String
@@ -131,9 +131,9 @@ function precompile_wrapper(project, tmax)
131131
return false
132132
end
133133
wrapperdir = tempname()
134-
wrappername, _ = only(Pkg.generate(wrapperdir))
135-
Pkg.activate(wrapperdir)
136-
Pkg.develop(PackageSpec(path = pkgdir))
134+
wrappername, _ = only(Pkg.generate(wrapperdir; io = devnull))
135+
Pkg.activate(wrapperdir; io = devnull)
136+
Pkg.develop(PackageSpec(path = pkgdir); io = devnull)
137137
statusfile = joinpath(wrapperdir, "done.log")
138138
open(joinpath(wrapperdir, "src", wrappername * ".jl"), "w") do io
139139
println(
@@ -151,7 +151,7 @@ end
151151
)
152152
end
153153
# Precompile the wrapper package
154-
cmd = `$(Base.julia_cmd()) --project=$wrapperdir -e 'push!(LOAD_PATH, "@stdlib"); using Pkg; Pkg.precompile()'`
154+
cmd = `$(Base.julia_cmd()) --project=$wrapperdir -e 'push!(LOAD_PATH, "@stdlib"); using Pkg; Pkg.precompile(; io = devnull)'`
155155
proc = run(cmd, stdin, stdout, stderr; wait = false)
156156
while !isfile(statusfile) && process_running(proc)
157157
sleep(0.5)
@@ -167,11 +167,11 @@ end
167167
end
168168
success = !process_running(proc)
169169
if !success
170-
kill(proc)
170+
kill(proc, Base.SIGKILL)
171171
end
172172
return success
173173
finally
174174
isdefined(Pkg, :respect_sysimage_versions) && Pkg.respect_sysimage_versions(true)
175-
Pkg.activate(prev_project)
175+
Pkg.activate(prev_project; io = devnull)
176176
end
177177
end

0 commit comments

Comments
 (0)