Skip to content

Commit

Permalink
Revert "feat: allow riscv64 support via custom electron dist (#8143)…
Browse files Browse the repository at this point in the history
…" (#8427)

This reverts commit b306895.
  • Loading branch information
mmaietta authored Aug 20, 2024
1 parent b306895 commit de1ea75
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 30 deletions.
7 changes: 0 additions & 7 deletions .changeset/stupid-avocados-appear.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/api/electron-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Developer API only. See [Configuration](../configuration/configuration.md) for u
<li><strong><code id="Arch-armv7l">armv7l</code></strong></li>
<li><strong><code id="Arch-arm64">arm64</code></strong></li>
<li><strong><code id="Arch-universal">universal</code></strong></li>
<li><strong><code id="Arch-riscv64">riscv64</code></strong></li>
</ul>
<p><a name="module_electron-builder.build"></a></p>
<h2 id="electron-builder.build(rawoptions)-%E2%87%92-promise%3Carray%3Cstring%3E%3E"><code>electron-builder.build(rawOptions)</code> ⇒ <code>Promise&lt;Array&lt;String&gt;&gt;</code></h2>
Expand Down
2 changes: 0 additions & 2 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@
"arm64",
"armv7l",
"ia32",
"riscv64",
"universal",
"x64"
],
Expand Down Expand Up @@ -5942,7 +5941,6 @@
"arm64",
"armv7l",
"ia32",
"riscv64",
"universal",
"x64"
],
Expand Down
2 changes: 0 additions & 2 deletions packages/app-builder-lib/src/linuxPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ export function toAppImageOrSnapArch(arch: Arch): string {
return "arm"
case Arch.arm64:
return "arm_aarch64"
case Arch.riscv64:
return "riscv64"

default:
throw new Error(`Unsupported arch ${arch}`)
Expand Down
2 changes: 0 additions & 2 deletions packages/app-builder-lib/src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ function archNameToTriplet(arch: Arch): string {
return "arm-linux-gnueabihf"
case Arch.arm64:
return "aarch64-linux-gnu"
case Arch.riscv64:
return "riscv64-linux-gnu"

default:
throw new Error(`Unsupported arch ${arch}`)
Expand Down
10 changes: 3 additions & 7 deletions packages/builder-util/src/arch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ export enum Arch {
armv7l,
arm64,
universal,
riscv64,
}

export type ArchType = "x64" | "ia32" | "armv7l" | "arm64" | "universal" | "riscv64"
export type ArchType = "x64" | "ia32" | "armv7l" | "arm64" | "universal"

export function toLinuxArchString(arch: Arch, targetName: string): string {
switch (arch) {
Expand All @@ -19,15 +18,14 @@ export function toLinuxArchString(arch: Arch, targetName: string): string {
return targetName === "snap" || targetName === "deb" ? "armhf" : targetName === "flatpak" ? "arm" : "armv7l"
case Arch.arm64:
return targetName === "pacman" || targetName === "rpm" || targetName === "flatpak" ? "aarch64" : "arm64"
case Arch.riscv64:
return "riscv64"

default:
throw new Error(`Unsupported arch ${arch}`)
}
}

export function getArchCliNames(): Array<string> {
return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64], Arch[Arch.riscv64]]
return [Arch[Arch.ia32], Arch[Arch.x64], Arch[Arch.armv7l], Arch[Arch.arm64]]
}

export function getArchSuffix(arch: Arch, defaultArch?: string): string {
Expand All @@ -47,8 +45,6 @@ export function archFromString(name: string): Arch {
return Arch.armv7l
case "universal":
return Arch.universal
case "riscv64":
return Arch.riscv64
default:
throw new Error(`Unsupported arch ${name}`)
}
Expand Down
4 changes: 0 additions & 4 deletions packages/electron-builder/src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export interface CliOptions extends PackagerOptions, PublishOptions {
armv7l?: boolean
arm64?: boolean
universal?: boolean
riscv64?: boolean

dir?: boolean
}
Expand Down Expand Up @@ -49,9 +48,6 @@ export function normalizeOptions(args: CliOptions): BuildOptions {
if (args.universal) {
result.push(Arch.universal)
}
if (args.riscv64) {
result.push(Arch.riscv64)
}

return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result
}
Expand Down
6 changes: 1 addition & 5 deletions test/src/helpers/downloadElectron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,13 @@ export function downloadAllRequiredElectronVersions(): Promise<any> {

const versions: Array<any> = []
for (const platform of platforms) {
const archs =
const archs: string[] =
platform === "mas" || platform === "darwin"
? ["x64"]
: platform === "win32"
? ["ia32", "x64"]
: require(`${path.join(__dirname, "../../..")}/packages/builder-util/out/util`).getArchCliNames()
for (const arch of archs) {
if (arch === "riscv64") {
// No prebuilt electron for riscv64
continue
}
if (gte(ELECTRON_VERSION, "19.0.0") && platform === "linux" && arch === "ia32") {
// Chromium dropped support for ia32 linux binaries in 102.0.4999.0
// https://www.electronjs.org/docs/latest/breaking-changes#removed-ia32-linux-binaries
Expand Down

0 comments on commit de1ea75

Please sign in to comment.