mqtt-cli icon indicating copy to clipboard operation
mqtt-cli copied to clipboard

Native Image support

Open sbaier1 opened this issue 4 years ago • 2 comments

Problem or use case

By leveraging SubstrateVMs native image feature, we can package the MQTT CLI into a single binary, removing the immediate dependency on a local Java installation and greatly improve the startup time of the CLI, making scripted and non-shell usage more attractive.

The existing implementation of this feature (current state is at #140 ) is unstable and not ready for release.

Preferred solution or suggestions

  • Improve the configuration of the already included native image task
  • Fix known issues
  • Add tests to CI that verify that the native image is operational after build
    • build native image in travis build
    • execute tests (shell script based? simple unit test? unclear what technology to use here yet. needs to be able to test interactive shell mode!)
  • Update to the latest GraalVM version
  • Release native image for linux, darwin and windows with each release

Known Issues

  • [x] TLS does not work https://github.com/oracle/graal/issues/1336 -> fixed in GraalVM 19.3 and up
  • [x] hitting Ctrl+D in shell mode yields org.jline.reader.EndOfFileException -> fixed by handling exception properly
  • [x] Commands such as help pub in shell mode do not behave as expected: Unmatched argument at index 1: 'pub'
  • [x] CLI always starts in trace mode (might be due to a missing IncludeResources flag? unsure)

sbaier1 avatar Mar 20 '20 09:03 sbaier1

updated to GraalVM 20.1.0, remaining check points still valid unfortunately.

sbaier1 avatar Jun 18 '20 14:06 sbaier1

Support was added in PR: https://github.com/hivemq/mqtt-cli/pull/311 Tests and fixes were added in PR: https://github.com/hivemq/mqtt-cli/pull/308 For now we do not have a release process for the native-image yet

ghost avatar Dec 21 '22 14:12 ghost