Skip to content
Closed
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
2 changes: 1 addition & 1 deletion twoliter/src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl BuildVariant {
install_tools(&toolsdir).await?;
let makefile_path = toolsdir.join("Makefile.toml");
// A temporary directory in the `build` directory
let build_temp_dir = TempDir::new_in(project.project_dir())
let build_temp_dir = TempDir::new_in("/tmp")
Copy link
Contributor

Choose a reason for hiding this comment

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

/tmp can be a memory-backed tmpfs so it is unwise to leak files there - and can be pretty annoying to clean up.

Let's use a path like build/.tmp that we recursively delete and create fresh.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use a path like build/.tmp that we recursively delete and create fresh.

Note that an rm -rf "${BUILDSYS_BUILD_DR}/.tmp" needs to be added to Makefile.toml in the appropriate clean task if we do this here. Also, a create_dir_all is probably required here for the build directory because we are doing these things before we go into cargo make.

.context("Unable to create a tempdir for Twoliter's build")?;
let packages_dir = build_temp_dir.path().join("sdk_rpms");
fs::create_dir_all(&packages_dir).await?;
Expand Down