I was really looking forward to dart2native and so I experimented with it a little bit today. I use Linux and when I run dart2native, the resulting binary is an *.exe file. I know I can just change the name of the binary with the -o flag, but producing *.exe files on Linux is still a pretty weird standard behaviour.
Just wanted to report the same thing, looks like code attempts to name it correctly but fails somewhere:
I tried to strip the resultant binary on linux and running it now gives the dart usage info, and does not run the program at all.
me to on mac os x
~/D/t/dart 禄 dart2native hello.dart
Generated: /Users/hukendo/Documents/tmp/dart/hello.exe
------------------------------------------------------------
~/D/t/dart 禄 ll
total 6,7M
-rw-r--r-- 1 hukendo staff 38 薪芯褟 26 03:28 hello.dart
-rwxr-xr-x 1 hukendo staff 6,7M 薪芯褟 26 03:29 hello.exe
------------------------------------------------------------
~/D/t/dart 禄 ./hello.exe
Hello, World!
------------------------------------------------------------
~/D/t/dart 禄 file hello.exe
hello.exe: Mach-O 64-bit executable x86_64
------------------------------------------------------------
~/D/t/dart 禄 dart --version
Dart VM version: 2.6.1 (Mon Nov 11 13:12:24 2019 +0100) on "macos_x64"
@sedlund
Afaik, generated file already stripped:
$ file test.exe
test.exe: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped
@dkorzhevin
@sedlund
Afaik, generated file already stripped:
$ file test.exe test.exe: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped
Yes, it shows the same on mine. In all circumstances before this strip will refuse to run a file that already has been. On these dart binaries, it doesn't seem to recognize they are and will break them.
Most helpful comment
Just wanted to report the same thing, looks like code attempts to name it correctly but fails somewhere:
https://github.com/dart-lang/sdk/blob/6f5aee9f7fd6519cac17e2326a13df1b13499e02/pkg/dart2native/bin/dart2native.dart