mirror of
https://github.com/Swatinem/rust-cache
synced 2026-09-14 20:13:25 +00:00
bump rollup and rebuild
This commit is contained in:
+1
-1
@@ -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-BaSEYL-3.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-BWEbZ6YT.js';
|
||||
import * as path from 'path';
|
||||
import * as crypto from 'crypto';
|
||||
import * as fs from 'fs';
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-BaSEYL-3.js';
|
||||
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-BWEbZ6YT.js';
|
||||
import os__default from 'os';
|
||||
import crypto__default from 'crypto';
|
||||
import fs__default from 'fs';
|
||||
+38
-22
@@ -34434,10 +34434,10 @@ async function getCacheProvider() {
|
||||
let cache;
|
||||
switch (cacheProvider) {
|
||||
case "github":
|
||||
cache = await import('./cache-CxTjXol0.js');
|
||||
cache = await import('./cache-CTfQoCTL.js');
|
||||
break;
|
||||
case "warpbuild":
|
||||
cache = await import('./cache-DhiwylR9.js').then(function (n) { return n.c; });
|
||||
cache = await import('./cache-DC26rUaF.js').then(function (n) { return n.c; });
|
||||
break;
|
||||
default:
|
||||
throw new Error(`The \`cache-provider\` \`${cacheProvider}\` is not valid.`);
|
||||
@@ -34569,14 +34569,9 @@ class CacheConfig {
|
||||
// The env vars are sorted, matched by prefix and hashed into the
|
||||
// resulting environment hash.
|
||||
let hasher = crypto__default.createHash("sha1");
|
||||
const rustVersions = Array.from(await getRustVersions(cmdFormat));
|
||||
// Doesn't matter how they're sorted, just as long as it's deterministic.
|
||||
rustVersions.sort();
|
||||
const rustVersions = (self.keyRust = await getRustVersions(cmdFormat));
|
||||
for (const rustVersion of rustVersions) {
|
||||
const { release, host, "commit-hash": commitHash } = rustVersion;
|
||||
const keyRust = `${release} ${host} ${commitHash}`;
|
||||
hasher.update(keyRust);
|
||||
self.keyRust.push(keyRust);
|
||||
hasher.update(rustVersion);
|
||||
}
|
||||
// these prefixes should cover most of the compiler / rust / cargo keys
|
||||
const envPrefixes = ["CARGO", "CC", "CFLAGS", "CXX", "CMAKE", "RUST"];
|
||||
@@ -34835,7 +34830,10 @@ async function getRustVersions(cmdFormat) {
|
||||
versions.add(parseRustVersion(await getCmdOutput(cmdFormat, `rustup run ${toolchain} rustc -vV`)));
|
||||
}
|
||||
}
|
||||
return versions;
|
||||
const rustVersions = Array.from(versions);
|
||||
// Doesn't matter how they're sorted, just as long as it's deterministic.
|
||||
rustVersions.sort();
|
||||
return rustVersions;
|
||||
}
|
||||
function parseRustVersion(stdout) {
|
||||
const splits = stdout
|
||||
@@ -34843,7 +34841,8 @@ function parseRustVersion(stdout) {
|
||||
.filter(Boolean)
|
||||
.map((s) => s.split(":").map((s) => s.trim()))
|
||||
.filter((s) => s.length === 2);
|
||||
return Object.fromEntries(splits);
|
||||
const { release, host, "commit-hash": commitHash } = Object.fromEntries(splits);
|
||||
return `${release} ${host} ${commitHash}`;
|
||||
}
|
||||
async function globFiles(pattern) {
|
||||
const globber = await create(pattern, {
|
||||
@@ -34885,14 +34884,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 { }
|
||||
@@ -35102,6 +35105,12 @@ const ONE_WEEK = 7 * 24 * 3600 * 1000;
|
||||
* Otherwise, it will remove everything that does not match any string in the
|
||||
* `keepPrefix` set.
|
||||
* The matching strips and trailing `-$hash` suffix.
|
||||
*
|
||||
* Cargo's newer `build-dir` layout (rust-lang/cargo#17258) nests the hash as
|
||||
* a subdirectory instead of appending it, so entries there are bare package
|
||||
* names with no suffix to strip. Check for an exact match first so those
|
||||
* names (which may themselves contain hyphens) aren't mistaken for a
|
||||
* `<name>-<hash>` entry from the old layout and truncated incorrectly.
|
||||
*/
|
||||
async function rmExcept(dirName, keepPrefix, checkTimestamp = false) {
|
||||
const dir = await fs__default.promises.opendir(dirName);
|
||||
@@ -35116,13 +35125,20 @@ async function rmExcept(dirName, keepPrefix, checkTimestamp = false) {
|
||||
return;
|
||||
}
|
||||
let name = dirent.name;
|
||||
// strip the trailing hash
|
||||
const idx = name.lastIndexOf("-");
|
||||
if (idx !== -1) {
|
||||
name = name.slice(0, idx);
|
||||
}
|
||||
// in Cargo's V1 layout, all packages are suffixed by their hash.
|
||||
// in V2, all package hashes are subdirectories instead.
|
||||
// Check both possible naming standards for packages and accept either.
|
||||
// v2 package format
|
||||
if (!keepPrefix.has(name)) {
|
||||
await rm(dir.path, dirent);
|
||||
// now check for v1 package format
|
||||
// strip the trailing hash
|
||||
const idx = name.lastIndexOf("-");
|
||||
if (idx !== -1) {
|
||||
name = name.slice(0, idx);
|
||||
}
|
||||
if (!keepPrefix.has(name)) {
|
||||
await rm(dir.path, dirent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -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-BaSEYL-3.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-BWEbZ6YT.js';
|
||||
import 'os';
|
||||
import 'crypto';
|
||||
import 'fs';
|
||||
|
||||
Vendored
+1
-1
@@ -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-BaSEYL-3.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-BWEbZ6YT.js';
|
||||
import 'os';
|
||||
import 'crypto';
|
||||
import 'fs';
|
||||
|
||||
Reference in New Issue
Block a user