Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to skip building etcher-util binary #4256

Open
sukanka opened this issue Jun 13, 2024 · 0 comments
Open

How to skip building etcher-util binary #4256

sukanka opened this issue Jun 13, 2024 · 0 comments

Comments

@sukanka
Copy link

sukanka commented Jun 13, 2024

  • Etcher version: 1.19.21
  • Operating system and architecture: archlinux x86_64 with 6.9.4-zen1-1-zen
  • Image flashed: nixos-minimal-22.05.3065.178fea1414a-x86_64-linux.iso
  • What do you think should have happened:
  • What happened:
  • Do you see any meaningful error information in the DevTools?

Hello, I'm one of the maintainers of the AUR package balena-etcher, And I built etcher from source for archlinux utilizing systemwide electron and node.

The build scripts are in AUR repo, mainly in the PKGBUILD

Below are the details:

  1. run package command
npm install
npm run package
  1. the built artifacts are in out/, within it balenaEtcher-linux-* looks like the package structure for deb and rpm
  2. I find there is an etcher-util appears in both out/balenaEtcher-linux-*/resources/ and out/sidecar.
    There is also a src dir in out/sidecar. From the compiling process below

    etcher/forge.sidecar.ts

    Lines 79 to 98 in c748c2a

    commands.push([
    'pkg',
    [
    path.join(sourcesDir, 'util', 'api.js'),
    '-c',
    'pkg-sidecar.json',
    // `--no-bytecode` so that we can cross-compile for arm64 on x64
    '--no-bytecode',
    '--public',
    '--public-packages',
    '"*"',
    // always build for host platform and node version
    // https://github.com/vercel/pkg-fetch/releases
    '--target',
    `node20-${arch}`,
    '--output',
    binPath,
    ],
    ]);
    });

It is equivalent to node util/api.js. So I wrote a wrapper named etcher-util to replace the binary file and it works fine.

Here is my problem: even though I can get rid of etcher-util binary in the built package, I have to build it in the building procedure. Is there any way that I can build only js scripts in out/sidecar/src but not the final binary file?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant