Log output rewriting causes issues when running conda-build in a python subprocess #5084
Closed
2 tasks done
Labels
backlog
issue has been triaged but has not been earmarked for any upcoming release
source::anaconda
created by members of Anaconda, Inc.
stale::closed
[bot] closed after being marked as stale
stale
[bot] marked as stale due to inactivity
type::bug
describes erroneous operation, use severity::* to classify the type
Checklist
What happened?
conda-build has a rather annoying (at least to me) feature where it rewrites all logs coming from builds to replace any known paths with their matching environment variable.
For example, during a cmake build, we can see things like
In this example, we can see that conda-build replaced some paths with
$PREFIX
and$BUILD_PREFIX
.This process happens in
conda-build/conda_build/utils.py
Lines 214 to 441 in aefdab6
The main issue is that
_setup_rewrite_pipe
creates a thread (conda-build/conda_build/utils.py
Line 257 in aefdab6
conda-build/conda_build/utils.py
Line 402 in aefdab6
This creates an issue where stdout and stderr are not synchronized anymore (if that's the right term).
When running conda-build from a python subprocess, the output from the build itself gets scrambled. Log lines are not outputted in the right order. This is pretty frustrating and it makes it super hard to debug anything. We are hitting that problem on a daily basis (read in all our builds) in our Anaconda build system.
Conda Info
Conda Config
Conda list
Additional Context
No response
The text was updated successfully, but these errors were encountered: