@ai-ecoverse/wasix-ruby 3.4.11-11 → 3.4.11-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/PRESTAGE.md CHANGED
@@ -1,4 +1,4 @@
1
- # wasix-ruby 3.4.11-11
1
+ # wasix-ruby 3.4.11-12
2
2
 
3
3
  Built against wasix-sysroot **2025.9.30-27**. **No epoll**: SLICC returns ENOSYS (52)
4
4
  for `epoll_create`; MRI is compiled with `USE_MN_THREADS=0` and
package/README.md CHANGED
@@ -3,9 +3,32 @@
3
3
  MRI Ruby for slicc WASIX. No epoll (poll fallback). See PRESTAGE.md.
4
4
 
5
5
  Built on wasix-sysroot 2025.9.30-27 or later (the WASIX libc and headers; see
6
- PRESTAGE.md). `Gem.ruby` and `RbConfig.ruby` are the package's own
7
- `bin/ruby` (`/node_modules/@ai-ecoverse/wasix-ruby/bin/ruby` in a flat
8
- install), the same interpreter as the `ruby` command on PATH.
6
+ PRESTAGE.md).
7
+
8
+ ## The interpreter path (3.4.11-12)
9
+
10
+ `Gem.ruby` and `RbConfig.ruby` are the first `ruby` on PATH outside the
11
+ package, which is slicc-kernel's `/usr/bin/ruby` command. Run through it,
12
+ ruby gets the command's `RUBYLIB`, `GEM_HOME` and `GEM_PATH` defaults, so
13
+ `system(Gem.ruby, "-e", "exit 3")` exits 3 from any process, and RubyGems
14
+ writes `#!/usr/bin/ruby` into the gem executables it installs. Without a
15
+ `ruby` on PATH they fall back to the package's `bin/ruby`.
16
+
17
+ `bin/ruby` (`RbConfig::CONFIG["bindir"]`) is the wasm module itself, so the
18
+ kernel can exec it by path and use it in a shebang. It doesn't get the
19
+ command's environment: started from ruby (which passes its own `RUBYLIB` and
20
+ `GEM_*` on) it works fully, but started from a shell without them ruby can't
21
+ find RubyGems (`RubyGems were not loaded`). Use `ruby` or `/usr/bin/ruby` from a
22
+ shell. The package's `gem`, `bundle`, `rake`, `irb` and `erb` scripts start
23
+ with `#!/usr/bin/env ruby`, so they also run by path.
24
+
25
+ Up to 3.4.11-11 `bin/ruby` was a 7-byte `#!wasm` marker that the kernel
26
+ can't exec: `system(Gem.ruby, …)` gave 127, and the executables RubyGems
27
+ installed (shebang `#!…/wasix-ruby/bin/ruby`) gave "bad interpreter". Those
28
+ executables now run when started from ruby; to make them run from a shell
29
+ too, rewrite their shebangs with `gem pristine --only-executables <gem>…`
30
+ for the gems you installed (`--all` would also rewrite the package's own
31
+ gems).
9
32
 
10
33
  Since 3.4.11-8, single-fd waits (`IO#wait_readable`, blocking `TCPSocket.new`,
11
34
  `Net::HTTP`, blocking `SSLSocket#connect`/`#accept`) use poll(): WASIX's select()
@@ -34,7 +57,9 @@ Command env puts user gem bins ahead of the package:
34
57
  ${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}
35
58
  ```
36
59
 
37
- That covers Ruby child processes (`system`, `spawn`, `bundle exec`, …). To run those gems **by name from your shell**, add the same user gem bin directory to the host PATH, e.g. in `~/.bashrc`:
60
+ Those are defaults: a `PATH` the caller already has wins, as it does when you
61
+ start `ruby` from bash. To run gem executables **by name**, add the user gem
62
+ bin directory to your PATH, e.g. in `~/.bashrc`:
38
63
 
39
64
  ```bash
40
65
  export PATH="$HOME/.local/share/gem/ruby/3.4.0/bin:$PATH"
@@ -1,6 +1,6 @@
1
1
  # Third-party notices
2
2
 
3
- ruby.wasm statically links the following (ext/openssl, ext/zlib, ext/psych, and wasix-libc).
3
+ bin/ruby statically links the following (ext/openssl, ext/zlib, ext/psych, and wasix-libc).
4
4
 
5
5
  ## OpenSSL 3.5.9 (@ai-ecoverse/wasix-openssl 3.5.9-3), Apache-2.0
6
6
 
package/bin/bundle CHANGED
@@ -1,4 +1,4 @@
1
- #!/nonexistent-ruby-prefix/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #
3
3
  # This file was generated by RubyGems.
4
4
  #
package/bin/bundler CHANGED
@@ -1,4 +1,4 @@
1
- #!/nonexistent-ruby-prefix/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #
3
3
  # This file was generated by RubyGems.
4
4
  #
package/bin/erb CHANGED
@@ -1,4 +1,4 @@
1
- #!/nonexistent-ruby-prefix/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #
3
3
  # This file was generated by RubyGems.
4
4
  #
package/bin/gem CHANGED
@@ -1,4 +1,4 @@
1
- #!/nonexistent-ruby-prefix/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
4
  #--
package/bin/irb CHANGED
@@ -1,4 +1,4 @@
1
- #!/nonexistent-ruby-prefix/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #
3
3
  # This file was generated by RubyGems.
4
4
  #
package/bin/rake CHANGED
@@ -1,4 +1,4 @@
1
- #!/nonexistent-ruby-prefix/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
  #
3
3
  # This file was generated by RubyGems.
4
4
  #
package/bin/ruby CHANGED
Binary file
@@ -357,10 +357,14 @@ module RbConfig
357
357
  #
358
358
  # returns the absolute pathname of the ruby command.
359
359
  def RbConfig.ruby
360
- File.join(
361
- RbConfig::CONFIG["bindir"],
362
- RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
363
- )
360
+ name = RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"]
361
+ own = File.join(RbConfig::CONFIG["bindir"], name)
362
+ ENV.fetch("PATH", "").split(File::PATH_SEPARATOR).each do |dir|
363
+ next unless dir.start_with?("/")
364
+ path = File.join(dir, name)
365
+ return path if path != own && File.file?(path)
366
+ end
367
+ own
364
368
  end
365
369
  end
366
370
  CROSS_COMPILING = nil unless defined? CROSS_COMPILING
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/wasix-ruby",
3
- "version": "3.4.11-11",
3
+ "version": "3.4.11-12",
4
4
  "description": "MRI Ruby for slicc WASIX (no epoll; asyncify spill 65536; date_core; wasix-sysroot 2025.9.30-27: user ids, traps and times from slicc-kernel)",
5
5
  "engines": {
6
6
  "slicc-kernel": ">=1.44.0"
@@ -31,7 +31,7 @@
31
31
  "abi": "wasi",
32
32
  "commands": {
33
33
  "ruby": {
34
- "wasm": "bin/ruby.wasm",
34
+ "wasm": "bin/ruby",
35
35
  "env": {
36
36
  "PATH": "${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}",
37
37
  "RUBYLIB": "${package}/lib/ruby/site_ruby/3.4.0:${package}/lib/ruby/site_ruby/3.4.0/wasm32-wasi:${package}/lib/ruby/vendor_ruby/3.4.0:${package}/lib/ruby/vendor_ruby/3.4.0/wasm32-wasi:${package}/lib/ruby/3.4.0:${package}/lib/ruby/3.4.0/wasm32-wasi",
@@ -40,7 +40,7 @@
40
40
  }
41
41
  },
42
42
  "gem": {
43
- "wasm": "bin/ruby.wasm",
43
+ "wasm": "bin/ruby",
44
44
  "args": [
45
45
  "${package}/bin/gem"
46
46
  ],
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "bundle": {
55
- "wasm": "bin/ruby.wasm",
55
+ "wasm": "bin/ruby",
56
56
  "args": [
57
57
  "${package}/bin/bundle"
58
58
  ],
@@ -64,7 +64,7 @@
64
64
  }
65
65
  },
66
66
  "rake": {
67
- "wasm": "bin/ruby.wasm",
67
+ "wasm": "bin/ruby",
68
68
  "args": [
69
69
  "${package}/bin/rake"
70
70
  ],
@@ -76,7 +76,7 @@
76
76
  }
77
77
  },
78
78
  "irb": {
79
- "wasm": "bin/ruby.wasm",
79
+ "wasm": "bin/ruby",
80
80
  "args": [
81
81
  "${package}/bin/irb"
82
82
  ],
@@ -88,7 +88,7 @@
88
88
  }
89
89
  },
90
90
  "erb": {
91
- "wasm": "bin/ruby.wasm",
91
+ "wasm": "bin/ruby",
92
92
  "args": [
93
93
  "${package}/bin/erb"
94
94
  ],
package/bin/ruby.wasm DELETED
Binary file