Etcher: Etcher-cli builds a bunch of unnecessary electron deps

Created on 19 Aug 2018  路  7Comments  路  Source: balena-io/etcher

  • Etcher version: 1.4.4
  • Operating system and architecture: macOS 10.13.6
  • Image flashed: n/a
  • Do you see any meaningful error information in the DevTools? n/a

When building with make package-cli RELEASE_TYPE=production, it takes about 30 minutes on my laptop (13" 2012 rMBP), most of which is in electron dependencies.

By applying the patches described in https://github.com/chrmoritz/homebrew-core/blob/cf5e86e9d301d82df04dc6e1d137f69f8bc1d7c2/Formula/etcher-cli.rb , build time drops to about 2 minutes.

The relevant changes that speed up building:

  • removing '@fortawesome', '@types', 'angular', 'react', 'redux', 'electron' from dependencies
  • removing devDependencies
  • setting files to be bin, build, lib/cli, lib/sdk, lib/shared, and binding.gyp
  • getting rid of npm-shrinkwrap so these changes to get overridden

Of course this only works for etcher-cli. I'm not familiar with Makefiles or how this could be officially supported, but is there a way?

Most helpful comment

I guess to do this "officially" there'd need to be different package.json files for the GUI and CLI? I doubt that's something the Etcher developers are interested in though.

The GUI & CLI will eventually become two separate things with the new Etcher SDK (once that's finished), also to avoid having this interlinked mess of deps that aren't used by the other. So I'd argue it is something we're interested in :P

All 7 comments

I guess to do this "officially" there'd need to be different package.json files for the GUI and CLI? I doubt that's something the Etcher developers are interested in though.

Maybe it would be better to rename this issue or create a separate issue to split out etcher-cli and have etcher depend on etcher-cli?

:man_shrugging:
You might also want to take a look at #2403

I guess to do this "officially" there'd need to be different package.json files for the GUI and CLI? I doubt that's something the Etcher developers are interested in though.

The GUI & CLI will eventually become two separate things with the new Etcher SDK (once that's finished), also to avoid having this interlinked mess of deps that aren't used by the other. So I'd argue it is something we're interested in :P

I think I can close this issue and re-open if it is still an issue after the etcher-cli,gui on sdk migration happens

Looks like the etcher gui is based on etcher-sdk now, so re-opening the discussion. What's the best way to install & test etcher-cli?

Looks like etcher-cli was removed, anyone have other suggestions for a simple commandline image writer?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jviotti picture jviotti  路  5Comments

grash54 picture grash54  路  5Comments

TheEpicNoobZilla picture TheEpicNoobZilla  路  4Comments

Silver978 picture Silver978  路  3Comments

Deej0406 picture Deej0406  路  4Comments