Skip to content

[Issue]: SDK tarball is never deleted after extraction #162

Description

@rominf

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

  1. Install the SDK with the tarball format.
  2. The extracted runtime appears under the data directory, and the full archive also remains under cache_dir/therock/.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions