Skip to content
Merged
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: 6 additions & 2 deletions src/cosalib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def __init__(self, *args, **kwargs):

self._found_files = {}
self._workdir = kwargs.pop("workdir", os.getcwd())
self._tmpdir = tempfile.mkdtemp(prefix="build_tmpd")
tmpdir = os.path.join(self._workdir, "tmp")
os.environ['TMPDIR'] = tmpdir
Copy link
Member

Choose a reason for hiding this comment

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

This isn't new, but... rust-lang/rust#24741

AFAIK cosa isn't multi-threaded today, but it's just a time bomb to be mutating the environment. We can fix as a follow-up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we should probably just set it in the entrypoint instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I think it's trickier than that since the entrypoint has no notion of workdir. So yeah, let's do that as a follow-up!


# we need to make sure we allocate in tmp/ so we're on the same
# filesystem as builds/ and we can just `rename()` it there
self._tmpdir = tempfile.mkdtemp(dir=tmpdir)
self._image_name = None

# Setup the instance properties.
Expand All @@ -108,7 +113,6 @@ def __init__(self, *args, **kwargs):
}

os.environ['workdir'] = self._workdir
os.environ['TMPDIR'] = os.path.join(self._workdir, "tmp")

# Setup what is required for this Class.
# require_cosa means that the COSA information is need
Expand Down