ruby-changes:74445
From: Jun <ko1@a...>
Date: Fri, 11 Nov 2022 07:57:40 +0900 (JST)
Subject: [ruby-changes:74445] 4c554096bf (master): wasm/README.md: Add a note about the Ruby built for wasm. [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=4c554096bf From 4c554096bfc08939e9eb1fb1773514b62b8b95b5 Mon Sep 17 00:00:00 2001 From: Jun Aruga <jaruga@r...> Date: Thu, 10 Nov 2022 13:24:27 +0100 Subject: wasm/README.md: Add a note about the Ruby built for wasm. [ci skip] The Ruby built for wasm cannot be execute without a WebAssembly runtime. ``` $ ruby-wasm32-wasi/usr/local/bin/ruby -e 'puts "a"' bash: ruby-wasm32-wasi/usr/local/bin/ruby: cannot execute binary file: Exec format error ``` Because the Ruby's file type is different from the one built normally, that is the `/usr/local/ruby-3.2.0-preview2/bin/ruby` below. ``` $ file ruby-wasm32-wasi/usr/local/bin/ruby ruby-wasm32-wasi/usr/local/bin/ruby: WebAssembly (wasm) binary module version 0x1 (MVP) $ file /usr/local/ruby-3.2.0-preview2/bin/ruby /usr/local/ruby-3.2.0-preview2/bin/ruby: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=a37822085e285c0971159982e7642dda88cea606, for GNU/Linux 3.2.0, with debug_info, not stripped ``` --- wasm/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wasm/README.md b/wasm/README.md index 050030e514..0f9ca1a3d5 100644 --- a/wasm/README.md +++ b/wasm/README.md @@ -54,6 +54,16 @@ $ wasmtime ruby-wasm32-wasi/usr/local/bin/ruby --mapdir /::./ruby-wasm32-wasi/ - https://github.com/ruby/ruby/blob/trunk/wasm/README.md#L54 wasm32-wasi ``` +Note: you cannot run the built ruby without a WebAssembly runtime, because of the difference of the binary file type. + +``` +$ ruby-wasm32-wasi/usr/local/bin/ruby -e 'puts "a"' +bash: ruby-wasm32-wasi/usr/local/bin/ruby: cannot execute binary file: Exec format error + +$ file ruby-wasm32-wasi/usr/local/bin/ruby +ruby-wasm32-wasi/usr/local/bin/ruby: WebAssembly (wasm) binary module version 0x1 (MVP) +``` + ## Current Limitation - No `Thread` support for now. -- cgit v1.2.3 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/