binfmt_misc on Dart snapshots

瀏覽次數:51 次
跳到第一則未讀訊息

dan...@fablefactory.com.br

未讀,
2018年3月6日 下午6:37:582018/3/6
收件者:Dart Misc
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

Faried Nawaz

未讀,
2018年3月12日 晚上7:50:542018/3/12
收件者:mi...@dartlang.org
[resending -- gmane seems to have dropped my earlier email]

dan...@fablefactory.com.br writes:

> 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.

Daniel Vieira

未讀,
2018年3月12日 晚上10:23:222018/3/12
收件者:mi...@dartlang.org
Thank you so much for your time replying this. This was exactly what I was looking for.
--
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+uns...@dartlang.org.

回覆所有人
回覆作者
轉寄
0 則新訊息