Skip to content

Conversation

@JP-Ellis
Copy link
Contributor

@JP-Ellis JP-Ellis commented Jul 1, 2025

Remove patterns of creating a tmpfile (typically in /tmp) to only move it when the operation complete. Instead, the operation is done directly on the target file, with a possible fallback to delete the file if a command fails.

The rationale is that mktemp creates files in ${TMPDIR:-/tmp}. On most systems, /tmp is a tmpfs filesystem with relatively limited space available (especially on lower powered CI machines). This can be an issue if dealing with large artefacts (for example, Rust build artefacts).

Fixes #84

Remove patterns of creating a tmpfile (typically in `/tmp`) to only move
it when the operation complete. Instead, the operation is done directly
on the target file, with a possible fallback to delete the file if a
command fails.

The rationale is that `mktemp` creates files in `${TMPDIR:-/tmp}`. On
most systems, `/tmp` is a `tmpfs` filesystem with relatively limited
space available (especially on lower powered CI machines). This can be
an issue if dealing with large artefacts (for example, Rust build artefacts).

Signed-off-by: JP-Ellis <[email protected]>
@gencer
Copy link
Collaborator

gencer commented Jul 2, 2025

Thanks for the PR 🚀.

As seen CI fails on tests. Should check on test results.

@JP-Ellis
Copy link
Contributor Author

JP-Ellis commented Jul 2, 2025

Yeah all good, seems to be mostly due to the few changes in logging. Should be straightforward to fix

This removes the stubs for `mktemp` and `mv` as the files are managed
in-place. Additionally, the `s3` commands no longer reference
`/tmp/tempfile` and instead reference the file directly.

Signed-off-by: JP-Ellis <[email protected]>
@JP-Ellis
Copy link
Contributor Author

Sorry it took a little while, but I've update the command.bats tests.

@gencer gencer merged commit fa99f74 into nienbo:master Jul 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid using /tmp

2 participants