Skip to content

Fix preserve target-triple build artifacts#356

Open
eitsupi wants to merge 2 commits into
Swatinem:masterfrom
eitsupi:fix-target-triple-cleanup
Open

Fix preserve target-triple build artifacts#356
eitsupi wants to merge 2 commits into
Swatinem:masterfrom
eitsupi:fix-target-triple-cleanup

Conversation

@eitsupi

@eitsupi eitsupi commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • detect Cargo profile directories by their artifact subdirectories
  • recurse into target-triple directories that do not contain Cargo target markers
  • add a three-platform save/restore regression workflow using an explicit --target
  • verify restored target-triple artifacts directly instead of relying only on an exact cache hit

Problem

Cargo places artifacts under target/<target-triple>/<profile> when --target is specified. The target-triple directory does not contain CACHEDIR.TAG or .rustc_info.json.

cleanTargetDir therefore treated the target triple as a profile directory. cleanProfileTarget then removed its release or debug child entirely, so those build artifacts never reached the cache.

This was observed in https://github.com/pola-rs/r-polars on Windows, where target/x86_64-pc-windows-gnu/release was deleted during the post-step cleanup.

Validation

  • clean TypeScript and Rollup build with Node 24.18.0
  • linefix dist
  • zizmor .github/workflows/target-triple.yml
  • git diff --check

The new workflow creates a unique cache on Ubuntu, macOS, and Windows, builds with the host triple passed explicitly to Cargo, restores the cache in a dependent job, and asserts that the target-triple artifact is present.

@eitsupi eitsupi changed the title fix: preserve target-triple build artifacts Fix preserve target-triple build artifacts Jul 4, 2026
@eitsupi eitsupi force-pushed the fix-target-triple-cleanup branch from 62c8a3f to 257d117 Compare July 4, 2026 08:05
@eitsupi eitsupi force-pushed the fix-target-triple-cleanup branch from 257d117 to 92bdd21 Compare July 4, 2026 08:14
@eitsupi eitsupi marked this pull request as ready for review July 4, 2026 08:29
eitsupi added a commit to pola-rs/r-polars that referenced this pull request Jul 4, 2026
## Summary

- pin Swatinem/rust-cache to the latest commit from Swatinem/rust-cache#356
- preserve Cargo artifacts under target-specific profile directories
- update every rust-cache use consistently

## Context

The previous cleanup logic treated target/<triple> as a Cargo profile directory and removed nested debug or release artifacts before saving the cache. Swatinem/rust-cache#356 fixes profile detection and adds cross-platform save/restore coverage.
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.

1 participant