mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-30 22:56:34 +00:00
patch: fix ubuntu 24 build and flash issues
- bump electron-forge to 7.8.1 - bump electron to 37.2.4 - stop producing broken appimage
This commit is contained in:
parent
2a470f5e6c
commit
c824a60e5d
@ -4,7 +4,7 @@ import { MakerZIP } from '@electron-forge/maker-zip';
|
|||||||
import { MakerDeb } from '@electron-forge/maker-deb';
|
import { MakerDeb } from '@electron-forge/maker-deb';
|
||||||
import { MakerRpm } from '@electron-forge/maker-rpm';
|
import { MakerRpm } from '@electron-forge/maker-rpm';
|
||||||
import { MakerDMG } from '@electron-forge/maker-dmg';
|
import { MakerDMG } from '@electron-forge/maker-dmg';
|
||||||
import { MakerAppImage } from '@reforged/maker-appimage';
|
// import { MakerAppImage } from '@reforged/maker-appimage';
|
||||||
import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives';
|
import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives';
|
||||||
import { WebpackPlugin } from '@electron-forge/plugin-webpack';
|
import { WebpackPlugin } from '@electron-forge/plugin-webpack';
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
@ -86,12 +86,12 @@ const config: ForgeConfig = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
new MakerAppImage({
|
// new MakerAppImage({
|
||||||
options: {
|
// options: {
|
||||||
icon: './assets/icon.png',
|
// icon: './assets/icon.png',
|
||||||
categories: ['Utility'],
|
// categories: ['Utility'],
|
||||||
},
|
// },
|
||||||
}),
|
// }),
|
||||||
new MakerRpm({
|
new MakerRpm({
|
||||||
options: {
|
options: {
|
||||||
icon: './assets/icon.png',
|
icon: './assets/icon.png',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { PluginBase } from '@electron-forge/plugin-base';
|
import { PluginBase } from '@electron-forge/plugin-base';
|
||||||
import type {
|
import type {
|
||||||
ForgeHookMap,
|
ForgeMultiHookMap,
|
||||||
ResolvedForgeConfig,
|
ResolvedForgeConfig,
|
||||||
} from '@electron-forge/shared-types';
|
} from '@electron-forge/shared-types';
|
||||||
import { WebpackPlugin } from '@electron-forge/plugin-webpack';
|
import { WebpackPlugin } from '@electron-forge/plugin-webpack';
|
||||||
@ -10,9 +10,9 @@ import { execFileSync } from 'child_process';
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
import * as d from 'debug';
|
import debug from 'debug';
|
||||||
|
|
||||||
const debug = d('sidecar');
|
const log = debug('sidecar');
|
||||||
|
|
||||||
function isStartScrpt(): boolean {
|
function isStartScrpt(): boolean {
|
||||||
return process.env.npm_lifecycle_event === 'start';
|
return process.env.npm_lifecycle_event === 'start';
|
||||||
@ -40,7 +40,7 @@ function addWebpackDefine(
|
|||||||
: // otherwise point relative to the resources folder of the bundled app
|
: // otherwise point relative to the resources folder of the bundled app
|
||||||
binName;
|
binName;
|
||||||
|
|
||||||
debug(`define '${defineName}'='${value}'`);
|
log(`define '${defineName}'='${value}'`);
|
||||||
|
|
||||||
mainConfig.plugins.push(
|
mainConfig.plugins.push(
|
||||||
new DefinePlugin({
|
new DefinePlugin({
|
||||||
@ -98,7 +98,7 @@ function build(
|
|||||||
});
|
});
|
||||||
|
|
||||||
commands.forEach(([cmd, args, opt]) => {
|
commands.forEach(([cmd, args, opt]) => {
|
||||||
debug('running command:', cmd, args.join(' '));
|
log('running command:', cmd, args.join(' '));
|
||||||
execFileSync(cmd, args, { shell: true, stdio: 'inherit', ...opt });
|
execFileSync(cmd, args, { shell: true, stdio: 'inherit', ...opt });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ function copyArtifact(
|
|||||||
// buildPath points to appPath, which is inside resources dir which is the one we actually want
|
// buildPath points to appPath, which is inside resources dir which is the one we actually want
|
||||||
const resourcesPath = path.dirname(buildPath);
|
const resourcesPath = path.dirname(buildPath);
|
||||||
const dest = path.resolve(resourcesPath, path.basename(binPath));
|
const dest = path.resolve(resourcesPath, path.basename(binPath));
|
||||||
debug(`copying '${binPath}' to '${dest}'`);
|
log(`copying '${binPath}' to '${dest}'`);
|
||||||
fs.copyFileSync(binPath, dest);
|
fs.copyFileSync(binPath, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,10 +129,10 @@ export class SidecarPlugin extends PluginBase<void> {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
this.getHooks = this.getHooks.bind(this);
|
this.getHooks = this.getHooks.bind(this);
|
||||||
debug('isStartScript:', isStartScrpt());
|
log('isStartScript:', isStartScrpt());
|
||||||
}
|
}
|
||||||
|
|
||||||
getHooks(): ForgeHookMap {
|
getHooks(): ForgeMultiHookMap {
|
||||||
const DEFINE_NAME = 'ETCHER_UTIL_BIN_PATH';
|
const DEFINE_NAME = 'ETCHER_UTIL_BIN_PATH';
|
||||||
const BASE_DIR = path.join('out', 'sidecar');
|
const BASE_DIR = path.join('out', 'sidecar');
|
||||||
const SRC_DIR = path.join(BASE_DIR, 'src');
|
const SRC_DIR = path.join(BASE_DIR, 'src');
|
||||||
@ -141,11 +141,11 @@ export class SidecarPlugin extends PluginBase<void> {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
resolveForgeConfig: async (currentConfig) => {
|
resolveForgeConfig: async (currentConfig) => {
|
||||||
debug('resolveForgeConfig');
|
log('resolveForgeConfig');
|
||||||
return addWebpackDefine(currentConfig, DEFINE_NAME, BIN_DIR, BIN_NAME);
|
return addWebpackDefine(currentConfig, DEFINE_NAME, BIN_DIR, BIN_NAME);
|
||||||
},
|
},
|
||||||
generateAssets: async (_config, platform, arch) => {
|
generateAssets: async (_config, platform, arch) => {
|
||||||
debug('generateAssets', { platform, arch });
|
log('generateAssets', { platform, arch });
|
||||||
build(SRC_DIR, arch, BIN_DIR, BIN_NAME);
|
build(SRC_DIR, arch, BIN_DIR, BIN_NAME);
|
||||||
},
|
},
|
||||||
packageAfterCopy: async (
|
packageAfterCopy: async (
|
||||||
@ -155,7 +155,7 @@ export class SidecarPlugin extends PluginBase<void> {
|
|||||||
platform,
|
platform,
|
||||||
arch,
|
arch,
|
||||||
) => {
|
) => {
|
||||||
debug('packageAfterCopy', {
|
log('packageAfterCopy', {
|
||||||
buildPath,
|
buildPath,
|
||||||
electronVersion,
|
electronVersion,
|
||||||
platform,
|
platform,
|
||||||
|
@ -123,7 +123,6 @@ const initSentryMain = once(() => {
|
|||||||
beforeSend: anonymizeSentryData,
|
beforeSend: anonymizeSentryData,
|
||||||
debug: process.env.ETCHER_SENTRY_DEBUG === 'true',
|
debug: process.env.ETCHER_SENTRY_DEBUG === 'true',
|
||||||
});
|
});
|
||||||
console.log(SentryMain.getCurrentScope());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const sourceSelectorReady = new Promise((resolve) => {
|
const sourceSelectorReady = new Promise((resolve) => {
|
||||||
|
1728
npm-shrinkwrap.json
generated
1728
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -59,14 +59,14 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@balena/lint": "8.0.2",
|
"@balena/lint": "8.0.2",
|
||||||
"@electron-forge/cli": "7.4.0",
|
"@electron-forge/cli": "7.8.1",
|
||||||
"@electron-forge/maker-deb": "7.4.0",
|
"@electron-forge/maker-deb": "7.8.1",
|
||||||
"@electron-forge/maker-dmg": "7.4.0",
|
"@electron-forge/maker-dmg": "7.8.1",
|
||||||
"@electron-forge/maker-rpm": "7.4.0",
|
"@electron-forge/maker-rpm": "7.8.1",
|
||||||
"@electron-forge/maker-squirrel": "7.4.0",
|
"@electron-forge/maker-squirrel": "7.8.1",
|
||||||
"@electron-forge/maker-zip": "7.4.0",
|
"@electron-forge/maker-zip": "7.8.1",
|
||||||
"@electron-forge/plugin-auto-unpack-natives": "7.4.0",
|
"@electron-forge/plugin-auto-unpack-natives": "7.8.1",
|
||||||
"@electron-forge/plugin-webpack": "7.4.0",
|
"@electron-forge/plugin-webpack": "7.8.1",
|
||||||
"@reforged/maker-appimage": "3.3.2",
|
"@reforged/maker-appimage": "3.3.2",
|
||||||
"@svgr/webpack": "8.1.0",
|
"@svgr/webpack": "8.1.0",
|
||||||
"@types/chai": "4.3.14",
|
"@types/chai": "4.3.14",
|
||||||
@ -87,7 +87,7 @@
|
|||||||
"catch-uncommitted": "^2.0.0",
|
"catch-uncommitted": "^2.0.0",
|
||||||
"chai": "4.3.10",
|
"chai": "4.3.10",
|
||||||
"css-loader": "5.2.7",
|
"css-loader": "5.2.7",
|
||||||
"electron": "30.0.1",
|
"electron": "37.2.4",
|
||||||
"file-loader": "6.2.0",
|
"file-loader": "6.2.0",
|
||||||
"husky": "8.0.3",
|
"husky": "8.0.3",
|
||||||
"native-addon-loader": "2.0.1",
|
"native-addon-loader": "2.0.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user