Skip to content

Commit 25c1dda

Browse files
Fix parallel nuget build (#10342)
1 parent 471ca7e commit 25c1dda

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
3+
changeKind: internal
4+
packages:
5+
- typespec-vs
6+
---
7+
8+
Fix parallel nuget build

packages/typespec-vs/scripts/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ import {
66
run,
77
runDotnet,
88
} from "@typespec/internal-build-utils";
9+
import { mkdtempSync } from "fs";
910
import { readFile } from "fs/promises";
11+
import { tmpdir } from "os";
1012
import { dirname, join, resolve } from "path";
1113
import { fileURLToPath } from "url";
1214

15+
// Use a unique NuGet scratch directory to avoid lock contention during parallel builds
16+
process.env.NUGET_SCRATCH = mkdtempSync(join(tmpdir(), "nuget-scratch-"));
17+
1318
main().catch((e) => {
1419
console.error(e);
1520
process.exit(1);

0 commit comments

Comments
 (0)