Skip to content

Commit

Permalink
fix: Manually reseting GYP_MSVS_VERSION for multi-arch builds befor…
Browse files Browse the repository at this point in the history
…e `beforePack` (#7387)
  • Loading branch information
mmaietta authored Jan 23, 2023
1 parent 9700c75 commit aeffe08
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-phones-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: reset `GYP_MSVS_VERSION` for multi-arch builds before `beforePack`
1 change: 0 additions & 1 deletion .github/issue_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ issue_labeler_regex_version=0
* **Target**:

<!-- Enter your issue details below this comment. -->
<!-- If you want, you can donate to increase issue priority (https://www.electron.build/donate) -->
2 changes: 1 addition & 1 deletion docs/configuration/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Env file `electron-builder.env` in the current dir ([example](https://github.com
<hr>
<ul>
<li><code id="Configuration-linux">linux</code> <a href="linux">LinuxConfiguration</a> - Options related to how build Linux targets.</li>
<li><code id="Configuration-deb">deb</code> <a href="/configuration/linux#de">DebOptions</a> - Debian package options.</li>
<li><code id="Configuration-deb">deb</code> <a href="/configuration/linux#deb">DebOptions</a> - Debian package options.</li>
<li><code id="Configuration-snap">snap</code> <a href="snap">SnapOptions</a> - Snap options.</li>
<li><code id="Configuration-appImage">appImage</code> <a href="/configuration/linux#appimageoptions">AppImageOptions</a> - AppImage options.</li>
<li><code id="Configuration-flatpak">flatpak</code> <a href="flatpak">FlatpakOptions</a> - Flatpak options.</li>
Expand Down
1 change: 1 addition & 0 deletions docs/generated/PlatformSpecificBuildOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<li><code id="ReleaseInfo-releaseNotes">releaseNotes</code> String | “undefined” - The release notes.</li>
<li><code id="ReleaseInfo-releaseNotesFile">releaseNotesFile</code> String | “undefined” - The path to release notes file. Defaults to <code>release-notes-${platform}.md</code> (where <code>platform</code> it is current platform — <code>mac</code>, <code>linux</code> or <code>windows</code>) or <code>release-notes.md</code> in the <a href="#MetadataDirectories-buildResources">build resources</a>.</li>
<li><code id="ReleaseInfo-releaseDate">releaseDate</code> String - The release date.</li>
<li><code id="ReleaseInfo-vendor">vendor</code> Object&lt;String, any&gt; | “undefined” - Vendor specific information.</li>
</ul>
</li>
<li>
Expand Down
13 changes: 10 additions & 3 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -4876,8 +4876,15 @@
]
},
"vendor": {
"description": "Vendor-specific informaton",
"type": "object"
"anyOf": [
{
"typeof": "function"
},
{
"type": "null"
}
],
"description": "Vendor specific information."
}
},
"type": "object"
Expand Down Expand Up @@ -7078,4 +7085,4 @@
}
},
"type": "object"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export interface ReleaseInfo {
/**
* Vendor specific information.
*/
vendor?: Record<string, unknown> | null
vendor?: { [key: string]: any } | null
}

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/app-builder-lib/src/platformPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
return
}

// Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256
delete process.env.GYP_MSVS_VERSION

const beforePack = resolveFunction(this.config.beforePack, "beforePack")
if (beforePack != null) {
await beforePack({
Expand Down
2 changes: 1 addition & 1 deletion scripts/jsdoc2md2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ async function render2(files, jsdoc2MdOptions) {
return "[AppImageOptions](/configuration/linux#appimageoptions)"
}
if (types.some(it => it.endsWith("DebOptions"))) {
return "[DebOptions](/configuration/linux#de)"
return "[DebOptions](/configuration/linux#deb)"
}
if (types.some(it => it.endsWith("LinuxTargetSpecificOptions"))) {
return "[LinuxTargetSpecificOptions](/configuration/linux#LinuxTargetSpecificOptions)"
Expand Down

0 comments on commit aeffe08

Please sign in to comment.