Problem Description
The SDK tarball is kept forever after it has been extracted, so each tarball install costs the compressed archive plus the unpacked tree — roughly double, for no benefit.
install_tarball_runtime downloads to cache_dir/therock/<file_name> (apps/rocm/src/therock.rs:1029), extracts it (apps/rocm/src/therock.rs:1061-1062), writes the manifest, and returns. Nothing removes the archive on that path or anywhere else. Because the runtime key includes the version, every installed version leaves its own archive behind.
This looks like an oversight rather than an intentional cache: the same download-extract-install pattern in ensure_uv_binary does clean up after itself, at crates/rocm-core/src/uv.rs:179. The manifest even records tarball_file_name, but nothing consumes it for cleanup.
Steps to Reproduce
- Install the SDK with the tarball format.
- The extracted runtime appears under the data directory, and the full archive also remains under
cache_dir/therock/.
- Install another version. Both archives are still there.
Suggested Fix
Delete the archive once extraction succeeds, mirroring crates/rocm-core/src/uv.rs:179.
If keeping it is intentional — to make a reinstall of the same version cheap — then it should be bounded and documented, and the file needs an integrity check before reuse, since a truncated archive is currently indistinguishable from a complete one (see the companion issue on partial downloads).
Additional Information
Found while investigating unbounded disk growth.
Problem Description
The SDK tarball is kept forever after it has been extracted, so each tarball install costs the compressed archive plus the unpacked tree — roughly double, for no benefit.
install_tarball_runtimedownloads tocache_dir/therock/<file_name>(apps/rocm/src/therock.rs:1029), extracts it (apps/rocm/src/therock.rs:1061-1062), writes the manifest, and returns. Nothing removes the archive on that path or anywhere else. Because the runtime key includes the version, every installed version leaves its own archive behind.This looks like an oversight rather than an intentional cache: the same download-extract-install pattern in
ensure_uv_binarydoes clean up after itself, atcrates/rocm-core/src/uv.rs:179. The manifest even recordstarball_file_name, but nothing consumes it for cleanup.Steps to Reproduce
cache_dir/therock/.Suggested Fix
Delete the archive once extraction succeeds, mirroring
crates/rocm-core/src/uv.rs:179.If keeping it is intentional — to make a reinstall of the same version cheap — then it should be bounded and documented, and the file needs an integrity check before reuse, since a truncated archive is currently indistinguishable from a complete one (see the companion issue on partial downloads).
Additional Information
Found while investigating unbounded disk growth.