patch: rebuild mountutils in forge.sidecar

This commit is contained in:
Edwin Joassart 2023-12-05 16:18:06 +01:00
parent f6160df454
commit 587701e9ab
2 changed files with 10 additions and 6 deletions

View File

@ -59,7 +59,7 @@ function build(
binDir: string,
binName: string,
) {
const commands: Array<[string, string[]]> = [
const commands: Array<[string, string[], object?]> = [
[
'tsc',
['--project', 'tsconfig.sidecar.json', '--outDir', `${sourcesDir}`],
@ -73,7 +73,10 @@ function build(
path.resolve(binDir, binName)
: // otherwise build in arch-specific directory within binDir
path.resolve(binDir, arch, binName);
// FIXME: rebuilding mountutils shouldn't be necessary, but it is. It's comming from etcher-sdk a fix has been upstreamed but to use the latest etcher-sdk we need to upgrade axios at the same time)
commands.push(['npm', ['run', 'rebuild'], { cwd: 'node_modules/mountutils' }])
commands.push([
'pkg',
[
@ -86,8 +89,8 @@ function build(
'--public-packages',
'"*"',
// always build for host platform and node version
'--target',
arch,
// https://github.com/vercel/pkg-fetch/releases
`--target node18-${arch}`,
'--output',
`${binPath}`,
],
@ -96,10 +99,10 @@ function build(
//commands.push(['ls', ['-alFR', `'${binDir}'`]]);
});
commands.forEach(([cmd, args]) => {
commands.forEach(([cmd, args, opt]) => {
debug('running command:', cmd, args.join(' '));
try {
execFileSync(cmd, args, { shell: true, stdio: 'inherit' });
execFileSync(cmd, args, { shell: true, stdio: 'inherit', ...opt });
} catch (error) {console.log(error)}
});
}

1
npm-shrinkwrap.json generated
View File

@ -7,6 +7,7 @@
"": {
"name": "balena-etcher",
"version": "1.18.13",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
"@balena/sudo-prompt": "9.2.1-workaround-windows-amperstand-in-username-0849e215b947987a643fe5763902aea201255534",