Skip to content

Commit

Permalink
fix: pass in platform to electron-rebuild (#8537)
Browse files Browse the repository at this point in the history
Updates to latest electron-rebuild that allows passing in `platform` for
prebuilt node modules (previous versions of electron-rebuild had
hardcoded `process.platform`)

Fixes: #8528
#8426
  • Loading branch information
mmaietta authored Oct 1, 2024
1 parent fc3a78e commit 2e84f01
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .changeset/dirty-clocks-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"app-builder-lib": patch
"dmg-builder": patch
---

fix: pass in platform to electron-rebuild
2 changes: 1 addition & 1 deletion packages/app-builder-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@develar/schema-utils": "~2.6.5",
"@electron/notarize": "2.5.0",
"@electron/osx-sign": "1.3.1",
"@electron/rebuild": "3.6.0",
"@electron/rebuild": "3.6.1",
"@electron/universal": "2.0.1",
"@malept/flatpak-bundler": "^0.4.0",
"@types/fs-extra": "9.0.13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class WindowsSignToolManager {
}
log.info(logInfo, "signing")
} else if (!customSign) {
log.error({ signHook: customSign, cscInfo }, "no signing info identified, signing is skipped")
log.warn({ signHook: !!customSign, cscInfo }, "no signing info identified, signing is skipped")
return false
}

Expand Down
8 changes: 5 additions & 3 deletions packages/app-builder-lib/src/util/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,16 @@ export async function rebuild(config: Configuration, appDir: string, options: Re
execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,
buildFromSource: options.buildFromSource === true,
}
const { arch, buildFromSource, platform } = configuration

if (config.nativeRebuilder === "legacy") {
const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true)
const env = getGypEnv(options.frameworkInfo, platform, arch, buildFromSource)
return executeAppBuilderAndWriteJson(["rebuild-node-modules"], configuration, { env, cwd: appDir })
}

const {
frameworkInfo: { version: electronVersion },
} = options
const { arch, buildFromSource } = configuration
const logInfo = {
electronVersion,
arch,
Expand All @@ -203,9 +204,10 @@ export async function rebuild(config: Configuration, appDir: string, options: Re
buildPath: appDir,
electronVersion,
arch,
platform,
buildFromSource,
projectRootPath: await getProjectRootPath(appDir),
mode: (config.nativeRebuilder as RebuildMode) || "sequential",
buildFromSource: buildFromSource,
disablePreGypCopy: true,
}
return remoteRebuild(rebuildOptions)
Expand Down
2 changes: 1 addition & 1 deletion packages/dmg-builder/src/hdiuil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export async function hdiUtil(args: string[]) {
return retry(
() => exec("hdiutil", args),
5,
1000,
5000,
2000,
0,
(error: any) => {
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2e84f01

Please sign in to comment.