mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Fix @electron/rebuild pnpm issue
This commit is contained in:
@@ -375,7 +375,8 @@
|
|||||||
"@types/websocket@1.0.0": "patches/@types+websocket+1.0.0.patch",
|
"@types/websocket@1.0.0": "patches/@types+websocket+1.0.0.patch",
|
||||||
"backbone@1.6.0": "patches/backbone+1.6.0.patch",
|
"backbone@1.6.0": "patches/backbone+1.6.0.patch",
|
||||||
"node-fetch@2.6.7": "patches/node-fetch+2.6.7.patch",
|
"node-fetch@2.6.7": "patches/node-fetch+2.6.7.patch",
|
||||||
"zod@3.23.8": "patches/zod+3.23.8.patch"
|
"zod@3.23.8": "patches/zod+3.23.8.patch",
|
||||||
|
"@electron/rebuild": "patches/@electron__rebuild.patch"
|
||||||
},
|
},
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@indutny/mac-screen-share",
|
"@indutny/mac-screen-share",
|
||||||
|
|||||||
30
patches/@electron__rebuild.patch
Normal file
30
patches/@electron__rebuild.patch
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
diff --git a/lib/module-walker.js b/lib/module-walker.js
|
||||||
|
index b36e35c968c85b625f2080466f6518b1d355e4ef..427e81b7ada4f01e8712c4c6c8353fe0ff4f7cab 100644
|
||||||
|
--- a/lib/module-walker.js
|
||||||
|
+++ b/lib/module-walker.js
|
||||||
|
@@ -89,11 +89,22 @@ class ModuleWalker {
|
||||||
|
// Ignore the magical .bin directory
|
||||||
|
if (modulePath === '.bin')
|
||||||
|
continue;
|
||||||
|
+ const subPath = path_1.default.resolve(nodeModulesPath, modulePath);
|
||||||
|
// Ensure that we don't mark modules as needing to be rebuilt more than once
|
||||||
|
// by ignoring / resolving symlinks
|
||||||
|
- const realPath = await fs_extra_1.default.realpath(path_1.default.resolve(nodeModulesPath, modulePath));
|
||||||
|
- if (this.realModulePaths.has(realPath)) {
|
||||||
|
- continue;
|
||||||
|
+ let realPath;
|
||||||
|
+ try {
|
||||||
|
+ realPath = await fs_extra_1.default.realpath(subPath);
|
||||||
|
+ }
|
||||||
|
+ catch (error) {
|
||||||
|
+ // pnpm leaves dangling symlinks when modules are removed
|
||||||
|
+ if (error.code === 'ENOENT') {
|
||||||
|
+ const stat = await fs_extra_1.default.lstat(subPath);
|
||||||
|
+ if (stat.isSymbolicLink()) {
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ throw error;
|
||||||
|
}
|
||||||
|
this.realModulePaths.add(realPath);
|
||||||
|
if (this.prodDeps[`${prefix}${modulePath}`] && (!this.onlyModules || this.onlyModules.includes(modulePath))) {
|
||||||
7
pnpm-lock.yaml
generated
7
pnpm-lock.yaml
generated
@@ -15,6 +15,9 @@ overrides:
|
|||||||
'@electron/rebuild@3.7.0>@electron/node-gyp': 10.2.0-electron.2
|
'@electron/rebuild@3.7.0>@electron/node-gyp': 10.2.0-electron.2
|
||||||
|
|
||||||
patchedDependencies:
|
patchedDependencies:
|
||||||
|
'@electron/rebuild':
|
||||||
|
hash: 31649378d7bedcb532b7f379773ffc7df45968de1ac73c6d1b9f06cc521071fa
|
||||||
|
path: patches/@electron__rebuild.patch
|
||||||
'@types/backbone@1.4.22':
|
'@types/backbone@1.4.22':
|
||||||
hash: 9dace206a9f53e0e3b0203051b26aec1e92ad49744b156ad8076946356c6c8e7
|
hash: 9dace206a9f53e0e3b0203051b26aec1e92ad49744b156ad8076946356c6c8e7
|
||||||
path: patches/@types+backbone+1.4.22.patch
|
path: patches/@types+backbone+1.4.22.patch
|
||||||
@@ -10124,7 +10127,7 @@ snapshots:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
'@electron/rebuild@3.7.0':
|
'@electron/rebuild@3.7.0(patch_hash=31649378d7bedcb532b7f379773ffc7df45968de1ac73c6d1b9f06cc521071fa)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@electron/node-gyp': 10.2.0-electron.2
|
'@electron/node-gyp': 10.2.0-electron.2
|
||||||
'@malept/cross-spawn-promise': 2.0.0
|
'@malept/cross-spawn-promise': 2.0.0
|
||||||
@@ -13420,7 +13423,7 @@ snapshots:
|
|||||||
'@electron/fuses': 1.8.0
|
'@electron/fuses': 1.8.0
|
||||||
'@electron/notarize': 2.5.0
|
'@electron/notarize': 2.5.0
|
||||||
'@electron/osx-sign': 1.3.1
|
'@electron/osx-sign': 1.3.1
|
||||||
'@electron/rebuild': 3.7.0
|
'@electron/rebuild': 3.7.0(patch_hash=31649378d7bedcb532b7f379773ffc7df45968de1ac73c6d1b9f06cc521071fa)
|
||||||
'@electron/universal': 2.0.1
|
'@electron/universal': 2.0.1
|
||||||
'@malept/flatpak-bundler': 0.4.0
|
'@malept/flatpak-bundler': 0.4.0
|
||||||
'@types/fs-extra': 9.0.13
|
'@types/fs-extra': 9.0.13
|
||||||
|
|||||||
Reference in New Issue
Block a user