filiph/linkcheck

Use GitHub Actions to generate native executables for Windows, Linux and macOS

ggrossetie opened this issue · 2 comments

We could use GitHub Actions to generate native executables.
Reference: https://blog.dantup.com/2019/11/easily-compiling-dart-to-native-executables-for-windows-linux-macos-with-github-actions/

Instead of DanTup/gh-actions/setup-dart@master, we should use the "official" dart-lang/setup-dart@v1.

When running dart2native on my local machine I get:

$ dart2native bin/linkcheck.dart -v -o build/linkcheck
Compiling /home/guillaume/workspace/opensource/linkcheck/bin/linkcheck.dart to /home/guillaume/workspace/opensource/linkcheck/build/linkcheck using format exe:
Generating AOT kernel dill.
Info: Compiling without sound null safety
Generating AOT snapshot.
Generating executable.
Marking binary executable.
$ ldd build/linkcheck                                 
	linux-vdso.so.1 (0x00007ffcc6b76000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1924d6a000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1924d47000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1924bf8000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1924a06000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f192541f000)

Is it possible to generate a statically linked binary?

I agree! And I know there's a library that should make this a lot easier, including publishing stuff to things like apt and homebrew: #59.

Unfortunately, I won't get to this anytime soon. If there's someone who's willing to dig into the problem, I would really appreciate this.

Oh sweet, I will try to put something together based on cli_pkg 👍🏻