3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2026-07-30 10:03:52 +00:00

update dependencies, rebuild

This commit is contained in:
Arpad Borsos 2026-07-26 16:34:10 +02:00
parent 0e24e5dcec
commit 9f151aca7c
No known key found for this signature in database
GPG key ID: FC7BCA77824B3298
14 changed files with 5617 additions and 2892 deletions

View file

@ -3,9 +3,9 @@ import * as io from "@actions/io";
import fs from "fs";
import path from "path";
import { CARGO_HOME } from "./config";
import { exists } from "./utils";
import { Packages } from "./workspace";
import { CARGO_HOME } from "./config.js";
import { exists } from "./utils.js";
import { Packages } from "./workspace.js";
export async function cleanTargetDir(targetDir: string, packages: Packages, checkTimestamp = false) {
core.debug(`cleaning target directory "${targetDir}"`);

View file

@ -7,8 +7,8 @@ import os from "os";
import path from "path";
import * as toml from "smol-toml";
import { CacheProvider, exists, getCmdOutput } from "./utils";
import { Workspace } from "./workspace";
import { CacheProvider, exists, getCmdOutput } from "./utils.js";
import { Workspace } from "./workspace.js";
const HOME = os.homedir();
export const CARGO_HOME = process.env.CARGO_HOME || path.join(HOME, ".cargo");

View file

@ -1,8 +1,8 @@
import * as core from "@actions/core";
import { cleanTargetDir } from "./cleanup";
import { CacheConfig } from "./config";
import { getCacheProvider, reportError } from "./utils";
import { cleanTargetDir } from "./cleanup.js";
import { CacheConfig } from "./config.js";
import { getCacheProvider, reportError } from "./utils.js";
process.on("uncaughtException", (e) => {
core.error(e.message);

View file

@ -1,9 +1,9 @@
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import { cleanBin, cleanGit, cleanRegistry, cleanTargetDir } from "./cleanup";
import { CacheConfig, isCacheUpToDate } from "./config";
import { getCacheProvider, reportError } from "./utils";
import { cleanBin, cleanGit, cleanRegistry, cleanTargetDir } from "./cleanup.js";
import { CacheConfig, isCacheUpToDate } from "./config.js";
import { getCacheProvider, reportError } from "./utils.js";
process.on("uncaughtException", (e) => {
core.error(e.message);

View file

@ -1,14 +1,21 @@
import * as core from "@actions/core";
import path from "path";
import { getCmdOutput } from "./utils";
import { getCmdOutput } from "./utils.js";
const SAVE_TARGETS = new Set(["lib", "cdylib", "dylib", "rlib", "staticlib", "proc-macro"]);
export class Workspace {
constructor(public root: string, public target: string) {}
constructor(
public root: string,
public target: string,
) {}
async getPackages(cmdFormat: string, filter: (p: Meta["packages"][0]) => boolean, extraArgs?: string): Promise<Packages> {
async getPackages(
cmdFormat: string,
filter: (p: Meta["packages"][0]) => boolean,
extraArgs?: string,
): Promise<Packages> {
const cmd = "cargo metadata --all-features --format-version 1" + (extraArgs ? ` ${extraArgs}` : "");
let packages: Packages = [];
try {
@ -16,7 +23,7 @@ export class Workspace {
const meta: Meta = JSON.parse(
await getCmdOutput(cmdFormat, cmd, {
cwd: this.root,
env: { ...process.env, "CARGO_ENCODED_RUSTFLAGS": "" },
env: { ...process.env, CARGO_ENCODED_RUSTFLAGS: "" },
}),
);
core.debug(`workspace "${this.root}" has ${meta.packages.length} packages`);