Discussion:
[dart-misc] binfmt_misc on Dart snapshots
d***@fablefactory.com.br
2018-03-06 23:27:26 UTC
Permalink
Does anyone know how to use binfmt_misc on Ubuntu in order to run dart
snapshots?

It would be really nice to run dart snapshots just as executable files on
console, just like it is possible to do with luaJIT or Java.

Thanks,

Daniel
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Faried Nawaz
2018-03-08 19:12:56 UTC
Permalink
[resending -- gmane seems to have dropped my earlier email]
Post by d***@fablefactory.com.br
It would be really nice to run dart snapshots just as executable files
on console, just like it is possible to do with luaJIT or Java.
These worked for me:

sudo update-binfmts --package dart \
--install dart-script /usr/bin/dart \
--magic '\xf5\xf5\xdc\xdc'
sudo update-binfmts --package dart \
--install dart-jit /usr/bin/dart \
--magic '\xdc\xdc\xf6\xf6'

This is for dart 2.0.0-dev.32.0 on a 64 bit Ubuntu 16.04 system. Make
the snapshots executable, and it should work.

I don't know if the magic numbers for the snapshots are correct, or will
change in the future. The numbers are the same for 1.24.3 on Mac
OS. The docs at https://github.com/dart-lang/sdk/wiki/Snapshots say

These snapshots are CPU architecture specific, so a snapshot created
by an x64 VM cannot run on an IA32 VM or vice versa. Also, because
different code is generated in production mode and checked mode, an
app snapshot created in production mode cannot be run in checked mode
or vice versa.


Faried.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Daniel Vieira
2018-03-13 02:23:05 UTC
Permalink
Thank you so much for your time replying this. This was exactly what I was
looking for.
Post by Faried Nawaz
[resending -- gmane seems to have dropped my earlier email]
Post by d***@fablefactory.com.br
It would be really nice to run dart snapshots just as executable files
on console, just like it is possible to do with luaJIT or Java.
sudo update-binfmts --package dart \
--install dart-script /usr/bin/dart \
--magic '\xf5\xf5\xdc\xdc'
sudo update-binfmts --package dart \
--install dart-jit /usr/bin/dart \
--magic '\xdc\xdc\xf6\xf6'
This is for dart 2.0.0-dev.32.0 on a 64 bit Ubuntu 16.04 system. Make
the snapshots executable, and it should work.
I don't know if the magic numbers for the snapshots are correct, or will
change in the future. The numbers are the same for 1.24.3 on Mac
OS. The docs at https://github.com/dart-lang/sdk/wiki/Snapshots say
These snapshots are CPU architecture specific, so a snapshot created
by an x64 VM cannot run on an IA32 VM or vice versa. Also, because
different code is generated in production mode and checked mode, an
app snapshot created in production mode cannot be run in checked mode
or vice versa.
Faried.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...