Skip to content

python 3.14: handle stdout/stderr redirection with forkerserver in tests#51663

Merged
alalazo merged 1 commit intodevelopfrom
hs/fix/path-to-url-3.14
Dec 9, 2025
Merged

python 3.14: handle stdout/stderr redirection with forkerserver in tests#51663
alalazo merged 1 commit intodevelopfrom
hs/fix/path-to-url-3.14

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Nov 29, 2025

When using forkserver, there is no guarantee that stdout/stderr in the subprocess spawned by multiprocessing corresponds to the same file as the one in the parent process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects stdout/stderr to a temporary file for each test.

So, pass stdout/stderr from the parent process to the child if forkserver is the start method.

@haampie haampie force-pushed the hs/fix/path-to-url-3.14 branch from 63d848b to 3d9059a Compare November 29, 2025 10:12
@haampie haampie changed the title fix path->url conversion for python 3.14 Fix Python 3.14 issues Nov 29, 2025
@haampie haampie added v1.0.3 PRs to backport for v1.0.3 v1.1.1 labels Nov 29, 2025
@haampie haampie force-pushed the hs/fix/path-to-url-3.14 branch 3 times, most recently from bf98839 to 4ea2d60 Compare December 2, 2025 16:01
alalazo
alalazo previously approved these changes Dec 2, 2025
Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge if we want to fix the forkserver issue elsewhere

@alalazo alalazo self-assigned this Dec 2, 2025
@haampie haampie force-pushed the hs/fix/path-to-url-3.14 branch from 4ea2d60 to 6608f6b Compare December 3, 2025 09:06
@haampie
Copy link
Copy Markdown
Member Author

haampie commented Dec 3, 2025

@alalazo I think it's better to make forkserver work on Python 3.14. Notice that we don't test it in CI here, but it's done in #51660.

@haampie haampie force-pushed the hs/fix/path-to-url-3.14 branch from 6608f6b to c01b02b Compare December 3, 2025 13:01
alalazo
alalazo previously approved these changes Dec 3, 2025
@haampie haampie marked this pull request as draft December 4, 2025 07:29
@haampie haampie removed v1.0.3 PRs to backport for v1.0.3 v1.1.1 labels Dec 4, 2025
@haampie haampie force-pushed the hs/fix/path-to-url-3.14 branch from c01b02b to 307ba77 Compare December 8, 2025 11:01
@haampie haampie force-pushed the hs/fix/path-to-url-3.14 branch from 307ba77 to c613fd9 Compare December 8, 2025 11:02
@haampie haampie changed the title Fix Python 3.14 issues python 3.14: handle stdout/stderr redirection with forkerserver in tests Dec 8, 2025
@haampie haampie marked this pull request as ready for review December 8, 2025 11:08
@haampie haampie added v1.0.3 PRs to backport for v1.0.3 v1.1.1 labels Dec 8, 2025
@alalazo alalazo merged commit e9b3220 into develop Dec 9, 2025
31 of 32 checks passed
@alalazo alalazo deleted the hs/fix/path-to-url-3.14 branch December 9, 2025 09:15
becker33 pushed a commit that referenced this pull request Jan 10, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess 
spawned by multiprocessing corresponds to the same file as the one in the parent 
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects 
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
@becker33 becker33 mentioned this pull request Jan 10, 2026
2 tasks
becker33 pushed a commit that referenced this pull request Jan 11, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Jan 15, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
vjranagit pushed a commit to vjranagit/spack that referenced this pull request Jan 18, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Jan 22, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Jan 26, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
@becker33 becker33 mentioned this pull request Feb 2, 2026
becker33 pushed a commit that referenced this pull request Feb 2, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess 
spawned by multiprocessing corresponds to the same file as the one in the parent 
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects 
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
becker33 pushed a commit that referenced this pull request Feb 2, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
becker33 pushed a commit that referenced this pull request Feb 19, 2026
When using forkserver, there is no guarantee that stdout/stderr in the subprocess
spawned by multiprocessing corresponds to the same file as the one in the parent
process, as we're forking a different Python process.

This is particularly the case when Spack is running under pytest, which redirects
stdout/stderr to a temporary file for each test. So, pass stdout/stderr from the parent
process to the child if forkserver is the start method.

Signed-off-by: Harmen Stoppels <[email protected]>
Signed-off-by: Gregory Becker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1.0.3 PRs to backport for v1.0.3 v1.1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants