Skip to content
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 environments in test_persistent_tasks #240

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


## [0.8.1] - 2023-11-16

### Changed

- `test_persistent_tasks` now redirects stdout and stderr of the created subtask. Furthermore, the environment of the subtask gets cleared to allow default values for `JULIA_LOAD_PATH` to work. ([#240](https://github.com/JuliaTesting/Aqua.jl/pull/240))


## [0.8.0] - 2023-11-15

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Aqua"
uuid = "4c88cf16-eb10-579e-8560-4a9242c79595"
authors = ["Takafumi Arakaki <aka.tkf@gmail.com> and contributors"]
version = "0.8.0"
version = "0.8.1"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
3 changes: 2 additions & 1 deletion src/persistent_tasks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
end
# Precompile the wrapper package
cmd = `$(Base.julia_cmd()) --project=$wrapperdir -e 'using Pkg; Pkg.precompile()'`
proc = run(cmd; wait = false)
cmd = setenv(cmd, String[])
Copy link

@benlorenz benlorenz Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clears all environment variables for the subprocess, among other PATH and Polymake.jl for example relies on that being non-empty (which is imho a reasonable assumption). Also it might break running any other shell commands from the package initialization.

See for example here: https://github.com/oscar-system/Polymake.jl/actions/runs/6891113309/job/18747915661?pr=461#step:7:478

ERROR: LoadError: InitError: KeyError: key "PATH" not found
Stacktrace:
  [1] (::Base.var"#717#718")(k::String)
    @ Base ./env.jl:138
  [2] access_env
    @ Base ./env.jl:43 [inlined]
  [3] getindex
    @ Base ./env.jl:138 [inlined]
  [4] __init__()
    @ Polymake ~/work/Polymake.jl/Polymake.jl/src/Polymake.jl:187

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, what a bummer...
I'll test around with Polymake.jl then a try to get a 0.8.2 running that's fine with both Polymake.jl and AbstractAlgebra.jl.

proc = run(cmd, stdin, stdout, stderr; wait = false)

Check warning on line 156 in src/persistent_tasks.jl

View check run for this annotation

Codecov / codecov/patch

src/persistent_tasks.jl#L155-L156

Added lines #L155 - L156 were not covered by tests
while !isfile(statusfile) && process_running(proc)
sleep(0.5)
end
Expand Down
Loading