Skip to content

Commit b16e8d7

Browse files
committed
bump rollup and rebuild
1 parent 3bf42ac commit b16e8d7

7 files changed

Lines changed: 168 additions & 131 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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';
1+
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';
22
import * as path from 'path';
33
import * as crypto from 'crypto';
44
import * as fs from 'fs';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-BaSEYL-3.js';
1+
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-BWEbZ6YT.js';
22
import os__default from 'os';
33
import crypto__default from 'crypto';
44
import fs__default from 'fs';
Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34434,10 +34434,10 @@ async function getCacheProvider() {
3443434434
let cache;
3443534435
switch (cacheProvider) {
3443634436
case "github":
34437-
cache = await import('./cache-CxTjXol0.js');
34437+
cache = await import('./cache-CTfQoCTL.js');
3443834438
break;
3443934439
case "warpbuild":
34440-
cache = await import('./cache-DhiwylR9.js').then(function (n) { return n.c; });
34440+
cache = await import('./cache-DC26rUaF.js').then(function (n) { return n.c; });
3444134441
break;
3444234442
default:
3444334443
throw new Error(`The \`cache-provider\` \`${cacheProvider}\` is not valid.`);
@@ -34569,14 +34569,9 @@ class CacheConfig {
3456934569
// The env vars are sorted, matched by prefix and hashed into the
3457034570
// resulting environment hash.
3457134571
let hasher = crypto__default.createHash("sha1");
34572-
const rustVersions = Array.from(await getRustVersions(cmdFormat));
34573-
// Doesn't matter how they're sorted, just as long as it's deterministic.
34574-
rustVersions.sort();
34572+
const rustVersions = (self.keyRust = await getRustVersions(cmdFormat));
3457534573
for (const rustVersion of rustVersions) {
34576-
const { release, host, "commit-hash": commitHash } = rustVersion;
34577-
const keyRust = `${release} ${host} ${commitHash}`;
34578-
hasher.update(keyRust);
34579-
self.keyRust.push(keyRust);
34574+
hasher.update(rustVersion);
3458034575
}
3458134576
// these prefixes should cover most of the compiler / rust / cargo keys
3458234577
const envPrefixes = ["CARGO", "CC", "CFLAGS", "CXX", "CMAKE", "RUST"];
@@ -34835,15 +34830,19 @@ async function getRustVersions(cmdFormat) {
3483534830
versions.add(parseRustVersion(await getCmdOutput(cmdFormat, `rustup run ${toolchain} rustc -vV`)));
3483634831
}
3483734832
}
34838-
return versions;
34833+
const rustVersions = Array.from(versions);
34834+
// Doesn't matter how they're sorted, just as long as it's deterministic.
34835+
rustVersions.sort();
34836+
return rustVersions;
3483934837
}
3484034838
function parseRustVersion(stdout) {
3484134839
const splits = stdout
3484234840
.split(/[\n\r]+/)
3484334841
.filter(Boolean)
3484434842
.map((s) => s.split(":").map((s) => s.trim()))
3484534843
.filter((s) => s.length === 2);
34846-
return Object.fromEntries(splits);
34844+
const { release, host, "commit-hash": commitHash } = Object.fromEntries(splits);
34845+
return `${release} ${host} ${commitHash}`;
3484734846
}
3484834847
async function globFiles(pattern) {
3484934848
const globber = await create(pattern, {
@@ -34885,14 +34884,18 @@ async function cleanTargetDir(targetDir, packages, checkTimestamp = false) {
3488534884
for await (const dirent of dir) {
3488634885
if (dirent.isDirectory()) {
3488734886
let dirName = path__default.join(dir.path, dirent.name);
34888-
// is it a profile dir, or a nested target dir?
34889-
let isNestedTarget = (await exists(path__default.join(dirName, "CACHEDIR.TAG"))) || (await exists(path__default.join(dirName, ".rustc_info.json")));
34887+
// Target-triple directories do not contain Cargo's target directory
34888+
// markers, so identify profiles by their artifact directories as well.
34889+
const isProfile = dirent.name === "tests" ||
34890+
(await exists(path__default.join(dirName, "build"))) ||
34891+
(await exists(path__default.join(dirName, ".fingerprint"))) ||
34892+
(await exists(path__default.join(dirName, "deps")));
3489034893
try {
34891-
if (isNestedTarget) {
34892-
await cleanTargetDir(dirName, packages, checkTimestamp);
34894+
if (isProfile) {
34895+
await cleanProfileTarget(dirName, packages, checkTimestamp);
3489334896
}
3489434897
else {
34895-
await cleanProfileTarget(dirName, packages, checkTimestamp);
34898+
await cleanTargetDir(dirName, packages, checkTimestamp);
3489634899
}
3489734900
}
3489834901
catch { }
@@ -35102,6 +35105,12 @@ const ONE_WEEK = 7 * 24 * 3600 * 1000;
3510235105
* Otherwise, it will remove everything that does not match any string in the
3510335106
* `keepPrefix` set.
3510435107
* The matching strips and trailing `-$hash` suffix.
35108+
*
35109+
* Cargo's newer `build-dir` layout (rust-lang/cargo#17258) nests the hash as
35110+
* a subdirectory instead of appending it, so entries there are bare package
35111+
* names with no suffix to strip. Check for an exact match first so those
35112+
* names (which may themselves contain hyphens) aren't mistaken for a
35113+
* `<name>-<hash>` entry from the old layout and truncated incorrectly.
3510535114
*/
3510635115
async function rmExcept(dirName, keepPrefix, checkTimestamp = false) {
3510735116
const dir = await fs__default.promises.opendir(dirName);
@@ -35116,13 +35125,20 @@ async function rmExcept(dirName, keepPrefix, checkTimestamp = false) {
3511635125
return;
3511735126
}
3511835127
let name = dirent.name;
35119-
// strip the trailing hash
35120-
const idx = name.lastIndexOf("-");
35121-
if (idx !== -1) {
35122-
name = name.slice(0, idx);
35123-
}
35128+
// in Cargo's V1 layout, all packages are suffixed by their hash.
35129+
// in V2, all package hashes are subdirectories instead.
35130+
// Check both possible naming standards for packages and accept either.
35131+
// v2 package format
3512435132
if (!keepPrefix.has(name)) {
35125-
await rm(dir.path, dirent);
35133+
// now check for v1 package format
35134+
// strip the trailing hash
35135+
const idx = name.lastIndexOf("-");
35136+
if (idx !== -1) {
35137+
name = name.slice(0, idx);
35138+
}
35139+
if (!keepPrefix.has(name)) {
35140+
await rm(dir.path, dirent);
35141+
}
3512635142
}
3512735143
}
3512835144
}

‎dist/restore.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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';
1+
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';
22
import 'os';
33
import 'crypto';
44
import 'fs';

‎dist/save.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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';
1+
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';
22
import 'os';
33
import 'crypto';
44
import 'fs';

0 commit comments

Comments
 (0)