diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e4b2b616..b68caefda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). - The local cache strategy will now create copy-on-write files when supported. This can improve performance when copying output files either into the cache or restoring from out of it, as the files' underlying data doesn't need to be copied, only filesystem metadata. - Unhandled exceptions will now be handled more gracefully. +### Fixed + +- Handle missing file errors thrown while trying to fingerprint an input file. + ## [0.14.1] - 2023-10-20 ### Fixed diff --git a/src/event.ts b/src/event.ts index 8f7aafeef..9d4bc419d 100644 --- a/src/event.ts +++ b/src/event.ts @@ -100,7 +100,8 @@ export type Failure = | DependencyInvalid | ServiceExitedUnexpectedly | DependencyServiceExitedUnexpectedly - | Aborted; + | Aborted + | FilesDeletedDuringFingerprinting; interface ErrorBase extends EventBase { @@ -281,6 +282,15 @@ export interface Aborted extends ErrorBase { reason: 'aborted'; } +/** + * A file was deleting after globbing but before fingerprinting and + * was unable to be read. + */ +export interface FilesDeletedDuringFingerprinting extends ErrorBase { + reason: 'files-deleted-during-fingerprinting'; + filePaths: string[]; +} + /** * We reached the point of doing cyclic dependency checking, and one of our * transitive dependencies had not transitioned to being locally validated. diff --git a/src/execution/no-command.ts b/src/execution/no-command.ts index cc0fd728c..c80ec5dc9 100644 --- a/src/execution/no-command.ts +++ b/src/execution/no-command.ts @@ -23,11 +23,17 @@ export class NoCommandScriptExecution extends BaseExecution { - this.#onFingerprinted(result); + if (!result.ok) { + this.#onFingerprintingErr(result.error); + } else { + this.#onFingerprinted(result.value); + } }, ); return; @@ -474,6 +478,41 @@ export class ServiceScriptExecution extends BaseExecutionWithCommand, - ): Promise { + ): Promise> { let allDependenciesAreFullyTracked = true; const filteredDependencyFingerprints: Array< [ScriptReferenceString, FingerprintSha256HexDigest] @@ -172,16 +174,40 @@ export class Fingerprint { // read) as a heuristic to detect files that have likely changed, and // otherwise re-use cached hashes that we store in e.g. // ".wireit/