Skip to content

Commit

Permalink
fix(core): cache runtime hashes with the env as part of the key (#19426)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammisuli authored Oct 3, 2023
1 parent b58c59b commit d1b7b31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/nx/src/hasher/task-hasher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,17 @@ class TaskHasherImpl {
}

private async hashRuntime(runtime: string): Promise<PartialHash> {
const mapKey = `runtime:${runtime}`;
const env = getHashEnv();
const env_key = JSON.stringify(env);
const mapKey = `runtime:${runtime}-${env_key}`;
if (!this.runtimeHashes[mapKey]) {
this.runtimeHashes[mapKey] = new Promise((res, rej) => {
exec(
runtime,
{
windowsHide: true,
cwd: workspaceRoot,
env: getHashEnv(),
env,
},
(err, stdout, stderr) => {
if (err) {
Expand Down

0 comments on commit d1b7b31

Please sign in to comment.