3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2026-07-18 12:25:47 +00:00

fix: preserve target-triple build artifacts

This commit is contained in:
eitsupi 2026-07-04 07:57:26 +00:00
parent a31add9f17
commit 92bdd21660
7 changed files with 110 additions and 17 deletions

View file

@ -1,4 +1,4 @@
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-BnmJoqJp.js';
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-By9HBZSo.js';
import os__default from 'os';
import crypto__default from 'crypto';
import fs__default from 'fs';

View file

@ -1,4 +1,4 @@
import { f as debug, m as mkdirP, n as create, l as exec, w as which, o as warning, i as info, H as HttpCodes, p as HttpClientError, q as HttpClient, t as isDebug, u as setSecret, B as BearerCredentialHandler, e as error } from './cleanup-BnmJoqJp.js';
import { f as debug, m as mkdirP, n as create, l as exec, w as which, o as warning, i as info, H as HttpCodes, p as HttpClientError, q as HttpClient, t as isDebug, u as setSecret, B as BearerCredentialHandler, e as error } from './cleanup-By9HBZSo.js';
import * as path from 'path';
import * as crypto$1 from 'crypto';
import * as fs from 'fs';

View file

@ -34145,10 +34145,10 @@ async function getCacheProvider() {
let cache;
switch (cacheProvider) {
case "github":
cache = await import('./cache-oK5XC6-w.js');
cache = await import('./cache-XOpvQMVD.js');
break;
case "warpbuild":
cache = await import('./cache-COXGx-w3.js').then(function (n) { return n.c; });
cache = await import('./cache-BnuDdkC4.js').then(function (n) { return n.c; });
break;
default:
throw new Error(`The \`cache-provider\` \`${cacheProvider}\` is not valid.`);
@ -34596,14 +34596,18 @@ async function cleanTargetDir(targetDir, packages, checkTimestamp = false) {
for await (const dirent of dir) {
if (dirent.isDirectory()) {
let dirName = path__default.join(dir.path, dirent.name);
// is it a profile dir, or a nested target dir?
let isNestedTarget = (await exists(path__default.join(dirName, "CACHEDIR.TAG"))) || (await exists(path__default.join(dirName, ".rustc_info.json")));
// Target-triple directories do not contain Cargo's target directory
// markers, so identify profiles by their artifact directories as well.
const isProfile = dirent.name === "tests" ||
(await exists(path__default.join(dirName, "build"))) ||
(await exists(path__default.join(dirName, ".fingerprint"))) ||
(await exists(path__default.join(dirName, "deps")));
try {
if (isNestedTarget) {
await cleanTargetDir(dirName, packages, checkTimestamp);
if (isProfile) {
await cleanProfileTarget(dirName, packages, checkTimestamp);
}
else {
await cleanProfileTarget(dirName, packages, checkTimestamp);
await cleanTargetDir(dirName, packages, checkTimestamp);
}
}
catch { }

2
dist/restore.js vendored
View file

@ -1,4 +1,4 @@
import { e as error, g as getCacheProvider, a as getInput, b as exportVariable, C as CacheConfig, i as info, c as cleanTargetDir, r as reportError, s as setOutput } from './cleanup-BnmJoqJp.js';
import { e as error, g as getCacheProvider, a as getInput, b as exportVariable, C as CacheConfig, i as info, c as cleanTargetDir, r as reportError, s as setOutput } from './cleanup-By9HBZSo.js';
import 'os';
import 'crypto';
import 'fs';

2
dist/save.js vendored
View file

@ -1,4 +1,4 @@
import { e as error, g as getCacheProvider, a as getInput, d as isCacheUpToDate, i as info, C as CacheConfig, c as cleanTargetDir, f as debug, h as cleanRegistry, j as cleanBin, k as cleanGit, r as reportError, l as exec } from './cleanup-BnmJoqJp.js';
import { e as error, g as getCacheProvider, a as getInput, d as isCacheUpToDate, i as info, C as CacheConfig, c as cleanTargetDir, f as debug, h as cleanRegistry, j as cleanBin, k as cleanGit, r as reportError, l as exec } from './cleanup-By9HBZSo.js';
import 'os';
import 'crypto';
import 'fs';