forked from aws/code-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.diff
More file actions
141 lines (137 loc) · 5.69 KB
/
Copy pathbuild.diff
File metadata and controls
141 lines (137 loc) · 5.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Patch that is needed for producing internal builds.
Index: third-party-src/build/lib/extensions.ts
===================================================================
--- third-party-src.orig/build/lib/extensions.ts
+++ third-party-src/build/lib/extensions.ts
@@ -90,6 +90,21 @@ function fromLocal(extensionPath: string
return input;
}
+async function asyncRetry<T>(func: () => Promise<T>, maxRetries: number): Promise<T> {
+ let retryNum = 0;
+ for(;;) {
+ try {
+ return await func();
+ } catch(err: unknown) {
+ retryNum++;
+ if (retryNum == maxRetries) {
+ throw err;
+ } else {
+ console.warn(`retrying operation, attempt ${retryNum} out of ${maxRetries}`);
+ }
+ }
+ }
+}
function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string, disableMangle: boolean): Stream {
const vsce = require('@vscode/vsce') as typeof import('@vscode/vsce');
@@ -108,12 +123,15 @@ function fromLocalWebpack(extensionPath:
}
}
+ // During building, some of the parallel `npm list --prod --json` calls were failing intermittently
+ // A failure causes the whole build process to fail, but the operation seems to succeed on retry
+ // Added this retry to make the build process more stable
// TODO: add prune support based on packagedDependencies to vsce.PackageManager.Npm similar
// to vsce.PackageManager.Yarn.
// A static analysis showed there are no webpack externals that are dependencies of the current
// local extensions so we can use the vsce.PackageManager.None config to ignore dependencies list
// as a temporary workaround.
- vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.None, packagedDependencies }).then(fileNames => {
+ asyncRetry(() => vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.None, packagedDependencies }), 3).then(fileNames => {
const files = fileNames
.map(fileName => path.join(extensionPath, fileName))
.map(filePath => new File({
@@ -208,8 +226,10 @@ function fromLocalWebpack(extensionPath:
function fromLocalNormal(extensionPath: string): Stream {
const vsce = require('@vscode/vsce') as typeof import('@vscode/vsce');
const result = es.through();
-
- vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Npm })
+ // During building, some of the parallel `npm list --prod --json` calls were failing intermittently
+ // A failure causes the whole build process to fail, but the operation seems to succeed on retry
+ // Added this retry to make the build process more stable
+ asyncRetry(() => vsce.listFiles({ cwd: extensionPath, packageManager: vsce.PackageManager.Npm }), 3)
.then(fileNames => {
const files = fileNames
.map(fileName => path.join(extensionPath, fileName))
Index: third-party-src/build/package.json
===================================================================
--- third-party-src.orig/build/package.json
+++ third-party-src/build/package.json
@@ -42,8 +42,8 @@
"@types/workerpool": "^6.4.0",
"@types/xml2js": "0.0.33",
"@vscode/iconv-lite-umd": "0.7.1",
- "@vscode/ripgrep": "^1.15.13",
"@vscode/vsce": "3.6.1",
+ "@vscode/vsce-sign": "file:../../../../build-tools/vsce-sign",
"ansi-colors": "^3.2.3",
"byline": "^5.0.0",
"debug": "^4.3.2",
Index: third-party-src/remote/package.json
===================================================================
--- third-party-src.orig/remote/package.json
+++ third-party-src/remote/package.json
@@ -8,7 +8,6 @@
"@vscode/deviceid": "^0.1.1",
"@vscode/iconv-lite-umd": "0.7.1",
"@vscode/proxy-agent": "^0.37.0",
- "@vscode/ripgrep": "^1.15.13",
"@vscode/spdlog": "^0.15.2",
"@vscode/tree-sitter-wasm": "^0.3.0",
"@vscode/vscode-languagedetection": "1.0.21",
@@ -39,7 +38,8 @@
"vscode-regexpp": "^3.1.0",
"vscode-textmate": "^9.3.0",
"yauzl": "^3.0.0",
- "yazl": "^2.4.3"
+ "yazl": "^2.4.3",
+ "@vscode/vsce-sign": "file:../../../../build-tools/vsce-sign"
},
"overrides": {
"node-gyp-build": "4.8.1"
Index: third-party-src/package.json
===================================================================
--- third-party-src.orig/package.json
+++ third-party-src/package.json
@@ -34,7 +34,7 @@
"watch-extensionsd": "deemon npm run watch-extensions",
"kill-watch-extensionsd": "deemon --kill npm run watch-extensions",
"precommit": "node build/hygiene.ts",
- "gulp": "node --max-old-space-size=8192 ./node_modules/gulp/bin/gulp.js",
+ "gulp": "NODE_OPTIONS=\"${NODE_OPTIONS:---max-old-space-size=8192}\" node ./node_modules/gulp/bin/gulp.js",
"electron": "node build/lib/electron.ts",
"7z": "7z",
"update-grammars": "node build/npm/update-all-grammars.ts",
@@ -79,7 +79,6 @@
"@vscode/iconv-lite-umd": "0.7.1",
"@vscode/policy-watcher": "^1.3.2",
"@vscode/proxy-agent": "^0.37.0",
- "@vscode/ripgrep": "^1.15.13",
"@vscode/spdlog": "^0.15.2",
"@vscode/sqlite3": "5.1.12-vscode",
"@vscode/sudo-prompt": "9.3.1",
@@ -105,7 +104,6 @@
"katex": "^0.16.22",
"minimist": "^1.2.8",
"native-is-elevated": "0.8.0",
- "native-keymap": "^3.3.5",
"native-watchdog": "^1.4.1",
"node-pty": "^1.1.0-beta43",
"open": "^10.1.2",
@@ -144,7 +142,6 @@
"@typescript/native-preview": "^7.0.0-dev.20250812.1",
"@vscode/gulp-electron": "^1.38.2",
"@vscode/l10n-dev": "0.0.35",
- "@vscode/telemetry-extractor": "^1.10.2",
"@vscode/test-cli": "^0.0.6",
"@vscode/test-electron": "^2.4.0",
"@vscode/test-web": "^0.0.76",
@@ -236,7 +233,8 @@
"koa": "^3.0.3"
},
"postcss": "^8.4.31",
- "playwright": "^1.55.1"
+ "playwright": "^1.55.1",
+ "@vscode/vsce-sign": "file:../../../build-tools/vsce-sign"
},
"repository": {
"type": "git",