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

Build source distributions in the cache directory instead of the global temporary directory #1628

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Feb 18, 2024

Addresses report in #1444 where a temporary directory is created outside of the cache directory or current virtual environment.

There is one additional usage of bare tempdir outside of tests we may want to change:

let temp_dir = tempdir()?;

@zanieb
Copy link
Member Author

zanieb commented Feb 18, 2024

There's another case where we use the cache directory root to create temporary directories so this seems okay. I don't know if we want a dedicated bucket for these eventually?

@@ -283,7 +283,7 @@ impl SourceBuild {
setup_py: SetupPyStrategy,
build_kind: BuildKind,
) -> Result<SourceBuild, Error> {
let temp_dir = tempdir()?;
let temp_dir = tempdir_in(build_context.cache().root())?;
Copy link
Member

Choose a reason for hiding this comment

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

Should this maybe actually be wheel_dir, i.e., the directory we pass to build? Unfortunately that's not an argument to this. In practice wheel_dir is also always inside the cache so it's probably fine, but perhaps worth documenting.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, we can consider a slightly larger change next?

What's the meaning of "wheel_dir" anyway? Where we're going to place the built wheel?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I'm cool with this change.

Yeah the wheel_dir is the directory into which we build the wheel. So if it's foo, the wheel gets built and saved at foo/Jinja2.whl or whatever (IIRC).

@zanieb zanieb added the bug Something isn't working label Feb 18, 2024
@zanieb zanieb merged commit 63c3134 into main Feb 18, 2024
7 checks passed
@zanieb zanieb deleted the zb/tempdir branch February 18, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants