mirror of
https://github.com/Swatinem/rust-cache
synced 2026-09-14 20:13:25 +00:00
Merge branch 'master' of https://github.com/Swatinem/rust-cache
This commit is contained in:
Vendored
+6
-6
@@ -332343,7 +332343,7 @@ async function exists(path) {
|
||||
}
|
||||
}
|
||||
|
||||
const SAVE_TARGETS = new Set(["lib", "proc-macro"]);
|
||||
const SAVE_TARGETS = new Set(["lib", "cdylib", "dylib", "rlib", "staticlib", "proc-macro"]);
|
||||
class Workspace {
|
||||
root;
|
||||
target;
|
||||
@@ -332682,10 +332682,10 @@ function digest(hasher) {
|
||||
async function getCargoBins() {
|
||||
const bins = new Set();
|
||||
try {
|
||||
const { installs } = JSON.parse(await fs$2.readFile(path__default.join(CARGO_HOME, ".crates2.json"), "utf8"));
|
||||
for (const pkg of Object.values(installs)) {
|
||||
for (const bin of pkg.bins) {
|
||||
bins.add(bin);
|
||||
const dir = await fs$2.opendir(path__default.join(CARGO_HOME, "bin"));
|
||||
for await (const dirent of dir) {
|
||||
if (dirent.isFile()) {
|
||||
bins.add(dirent.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332803,7 +332803,7 @@ async function cleanProfileTarget(profileDir, packages, checkTimestamp = false)
|
||||
}
|
||||
let keepProfile = new Set(["build", ".fingerprint", "deps"]);
|
||||
await rmExcept(profileDir, keepProfile);
|
||||
const keepPkg = new Set(packages.map((p) => p.name));
|
||||
const keepPkg = new Set(packages.flatMap((p) => [p.name, ...p.targets.map((t) => t.replace(/-/g, "_"))]));
|
||||
await rmExcept(path__default.join(profileDir, "build"), keepPkg, checkTimestamp);
|
||||
await rmExcept(path__default.join(profileDir, ".fingerprint"), keepPkg, checkTimestamp);
|
||||
const keepDeps = new Set(packages.flatMap((p) => {
|
||||
|
||||
Vendored
+8
-11
@@ -332310,7 +332310,7 @@ async function exists(path) {
|
||||
}
|
||||
}
|
||||
|
||||
const SAVE_TARGETS = new Set(["lib", "proc-macro"]);
|
||||
const SAVE_TARGETS = new Set(["lib", "cdylib", "dylib", "rlib", "staticlib", "proc-macro"]);
|
||||
class Workspace {
|
||||
root;
|
||||
target;
|
||||
@@ -332657,10 +332657,10 @@ function digest(hasher) {
|
||||
async function getCargoBins() {
|
||||
const bins = new Set();
|
||||
try {
|
||||
const { installs } = JSON.parse(await fs$2.readFile(path__default.join(CARGO_HOME, ".crates2.json"), "utf8"));
|
||||
for (const pkg of Object.values(installs)) {
|
||||
for (const bin of pkg.bins) {
|
||||
bins.add(bin);
|
||||
const dir = await fs$2.opendir(path__default.join(CARGO_HOME, "bin"));
|
||||
for await (const dirent of dir) {
|
||||
if (dirent.isFile()) {
|
||||
bins.add(dirent.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332778,7 +332778,7 @@ async function cleanProfileTarget(profileDir, packages, checkTimestamp = false)
|
||||
}
|
||||
let keepProfile = new Set(["build", ".fingerprint", "deps"]);
|
||||
await rmExcept(profileDir, keepProfile);
|
||||
const keepPkg = new Set(packages.map((p) => p.name));
|
||||
const keepPkg = new Set(packages.flatMap((p) => [p.name, ...p.targets.map((t) => t.replace(/-/g, "_"))]));
|
||||
await rmExcept(path__default.join(profileDir, "build"), keepPkg, checkTimestamp);
|
||||
await rmExcept(path__default.join(profileDir, ".fingerprint"), keepPkg, checkTimestamp);
|
||||
const keepDeps = new Set(packages.flatMap((p) => {
|
||||
@@ -332798,13 +332798,10 @@ async function cleanProfileTarget(profileDir, packages, checkTimestamp = false)
|
||||
* @param oldBins The binaries that existed when the action started.
|
||||
*/
|
||||
async function cleanBin(oldBins) {
|
||||
const bins = await getCargoBins();
|
||||
for (const bin of oldBins) {
|
||||
bins.delete(bin);
|
||||
}
|
||||
const binsToRemove = new Set(oldBins);
|
||||
const dir = await fs__default.promises.opendir(path__default.join(CARGO_HOME, "bin"));
|
||||
for await (const dirent of dir) {
|
||||
if (dirent.isFile() && !bins.has(dirent.name)) {
|
||||
if (dirent.isFile() && binsToRemove.has(dirent.name)) {
|
||||
await rm(dir.path, dirent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user