@ai-ecoverse/wasix-ruby 3.4.11-4 → 3.4.11-6

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-4
1
+ # wasix-ruby 3.4.11-6
2
2
 
3
3
  Built against wasix-sysroot **2025.9.30-14**. **No epoll**: SLICC returns ENOSYS (52)
4
4
  for `epoll_create`; MRI is compiled with `USE_MN_THREADS=0` and
@@ -22,6 +22,13 @@ linked against /tmp/wasix-openssl-prefix (OpenSSL 3.x; honours SSL_CERT_FILE). S
22
22
  - **Certify only** at `/shared/lib/node_modules/@ai-ecoverse/wasix-ruby` with
23
23
  manifest env. Never at `/ruby` (hides missing RUBYLIB — -3 false pass).
24
24
 
25
+ ## Gems / flock / uid (-5)
26
+ - `GEM_HOME=${HOME}/.local/share/gem/ruby/3.4.0` (writable under SLICC HOME).
27
+ - `GEM_PATH=${HOME}/.local/share/gem/ruby/3.4.0:${package}/lib/ruby/gems/3.4.0`.
28
+ - `File#flock` / `missing/flock.c` `__wasi__`: advisory **no-op success** (was EINVAL).
29
+ - `getuid`/`geteuid`/`getgid`/`getegid` → **1000** via wasix-sysroot `slicc_identity`
30
+ (injected into `wasm32-wasi` libc used by wasixcc, not only wasip1).
31
+
25
32
  ## Gems / PATH / SLICC #3735
26
33
  - `PATH=${package}/bin:${PATH}`.
27
34
  - `gem`/`bundle`/`rake` `args: ["${package}/bin/…"]` need **SLICC PR #3735**.
@@ -30,6 +37,7 @@ linked against /tmp/wasix-openssl-prefix (OpenSSL 3.x; honours SSL_CERT_FILE). S
30
37
  ## PRESTAGE (host)
31
38
  - no `epoll_create (errno:` in wasm; date_core linked; `nt_start_wasm_trampoline`
32
39
  - package.json `RUBYLIB` contains `wasm32-wasi` and `lib/ruby/3.4.0`
40
+ - package.json `GEM_HOME` is under `${HOME}/.local/share/gem`, not `${package}`
33
41
 
34
42
  ## PRESTAGE (SLICC — real install path)
35
43
  ```ruby
@@ -44,5 +52,15 @@ $stdout.sync = true
44
52
  t = Thread.new { puts "CHILD"; 42 }; puts t.value
45
53
  require "openssl"; OpenSSL::OPENSSL_VERSION
46
54
  require "socket"
55
+ Process.uid # => 1000
56
+ f = File.open("flock-test", "w"); f.flock(File::LOCK_EX); f.close # no Errno::EINVAL
47
57
  ```
48
58
  Plus Queue/CV/Mutex; `bundle exec rake` when #3735 is available.
59
+
60
+ ## Install acceptance (-5) — certify at real VFS path only
61
+ At `/shared/lib/node_modules/@ai-ecoverse/wasix-ruby` with manifest env:
62
+ 1. `gem env home` → `…/.local/share/gem/ruby/3.4.0` (not under package).
63
+ 2. `bundle install --local` creates lockfile without `Errno::EINVAL @ rb_file_flock`.
64
+ 3. `gem install --local --force` from packaged `rake-13.2.1.gem`; spec under
65
+ `HOME/.local/share/gem/ruby/3.4.0`.
66
+ Hold npm publish until those three pass.
package/README.md CHANGED
@@ -1,3 +1,17 @@
1
1
  # `@ai-ecoverse/wasix-ruby`
2
2
 
3
3
  MRI Ruby for slicc WASIX. No epoll (poll fallback). See PRESTAGE.md.
4
+
5
+ ## Gem executables on PATH
6
+
7
+ Command env puts user gem bins ahead of the package:
8
+
9
+ ```text
10
+ ${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}
11
+ ```
12
+
13
+ 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`:
14
+
15
+ ```bash
16
+ export PATH="$HOME/.local/share/gem/ruby/3.4.0/bin:$PATH"
17
+ ```
package/bin/ruby.wasm CHANGED
Binary file
@@ -25,7 +25,7 @@ module RbConfig
25
25
  CONFIG["PATCHLEVEL"] = "137"
26
26
  CONFIG["INSTALL"] = '/opt/homebrew/bin/ginstall -c'
27
27
  CONFIG["EXEEXT"] = ""
28
- CONFIG["prefix"] = (TOPDIR || DESTDIR + "/usr")
28
+ CONFIG["prefix"] = (TOPDIR || DESTDIR + "/nonexistent-ruby-prefix")
29
29
  CONFIG["ruby_install_name"] = "$(RUBY_BASE_NAME)"
30
30
  CONFIG["RUBY_INSTALL_NAME"] = "$(RUBY_BASE_NAME)"
31
31
  CONFIG["RUBY_SO_NAME"] = "$(RUBY_BASE_NAME)"
@@ -45,7 +45,7 @@ module RbConfig
45
45
  CONFIG["RUBY_SEARCH_PATH"] = ""
46
46
  CONFIG["UNIVERSAL_INTS"] = ""
47
47
  CONFIG["UNIVERSAL_ARCHNAMES"] = ""
48
- CONFIG["configure_args"] = " '--prefix=/usr' '--host=wasm32-wasi' '--build=aarch64-apple-darwin27' '--with-gcc=wasixcc' '--with-baseruby=/opt/homebrew/opt/ruby/bin/ruby' '--disable-install-doc' '--disable-install-rdoc' '--disable-jit-support' '--disable-shared' '--enable-static' '--with-thread=pthread' '--with-static-linked-ext' '--without-gmp' '--without-valgrind' '--without-ext=+,dbm,gdbm,readline,curses,tk,win32ole,fiddle,socket' '--with-libyaml-dir=/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/yaml-prefix' '--with-openssl-dir=/tmp/wasix-openssl-prefix' '--with-openssl-include=/tmp/wasix-openssl-prefix/include' '--with-openssl-lib=/tmp/wasix-openssl-prefix/lib' '--with-zlib-dir=/tmp/wasix-zlib-prefix' '--with-zlib-include=/tmp/wasix-zlib-prefix/include' '--with-zlib-lib=/tmp/wasix-zlib-prefix/lib' 'CC=wasixcc' 'LD=wasixcc' 'AR=llvm-ar' 'RANLIB=llvm-ranlib' 'CFLAGS=-O2 -DUSE_MN_THREADS=0 -DWASM_SETJMP_STACK_BUFFER_SIZE=65536 -DWASM_FIBER_STACK_BUFFER_SIZE=65536 -DWASM_SCAN_STACK_BUFFER_SIZE=65536' 'CPPFLAGS=-I/tmp/wasix-openssl-prefix/include -I/tmp/wasix-zlib-prefix/include -I/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/yaml-prefix/include -DWASM_SETJMP_STACK_BUFFER_SIZE=65536 -DWASM_FIBER_STACK_BUFFER_SIZE=65536 -DWASM_SCAN_STACK_BUFFER_SIZE=65536' 'LDFLAGS=-L/tmp/wasix-openssl-prefix/lib -L/tmp/wasix-zlib-prefix/lib -L/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/yaml-prefix/lib' 'LIBS=/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/ruby-wasix-stubs.o' 'build_alias=aarch64-apple-darwin27' 'host_alias=wasm32-wasi'"
48
+ CONFIG["configure_args"] = " '--prefix=/nonexistent-ruby-prefix' '--host=wasm32-wasi' '--build=aarch64-apple-darwin27' '--with-gcc=wasixcc' '--with-baseruby=/opt/homebrew/opt/ruby/bin/ruby' '--disable-install-doc' '--disable-install-rdoc' '--disable-jit-support' '--disable-shared' '--enable-static' '--with-thread=pthread' '--with-static-linked-ext' '--without-gmp' '--without-valgrind' '--without-ext=+,dbm,gdbm,readline,curses,tk,win32ole,fiddle,pty' '--with-libyaml-dir=/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/yaml-prefix' '--with-openssl-dir=/tmp/wasix-openssl-prefix' '--with-openssl-include=/tmp/wasix-openssl-prefix/include' '--with-openssl-lib=/tmp/wasix-openssl-prefix/lib' '--with-zlib-dir=/tmp/wasix-zlib-prefix' '--with-zlib-include=/tmp/wasix-zlib-prefix/include' '--with-zlib-lib=/tmp/wasix-zlib-prefix/lib' 'CC=wasixcc' 'LD=wasixcc' 'AR=llvm-ar' 'RANLIB=llvm-ranlib' 'CFLAGS=-O2 -DUSE_MN_THREADS=0 -DWASM_SETJMP_STACK_BUFFER_SIZE=65536 -DWASM_FIBER_STACK_BUFFER_SIZE=65536 -DWASM_SCAN_STACK_BUFFER_SIZE=65536' 'CPPFLAGS=-I/tmp/wasix-openssl-prefix/include -I/tmp/wasix-zlib-prefix/include -I/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/yaml-prefix/include -DWASM_SETJMP_STACK_BUFFER_SIZE=65536 -DWASM_FIBER_STACK_BUFFER_SIZE=65536 -DWASM_SCAN_STACK_BUFFER_SIZE=65536' 'LDFLAGS=-L/tmp/wasix-openssl-prefix/lib -L/tmp/wasix-zlib-prefix/lib -L/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/yaml-prefix/lib' 'LIBS=/Users/trieloff/Developer/ai-ecoverse/homescoop/packages/wasix-ruby/work/ruby-wasix-stubs.o' 'build_alias=aarch64-apple-darwin27' 'host_alias=wasm32-wasi'"
49
49
  CONFIG["CONFIGURE"] = "configure"
50
50
  CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
51
51
  CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
@@ -63,7 +63,7 @@ module RbConfig
63
63
  CONFIG["sitearchlibdir"] = "$(libdir)/$(sitearch)"
64
64
  CONFIG["archlibdir"] = "$(libdir)/$(arch)"
65
65
  CONFIG["libdirname"] = "libdir"
66
- CONFIG["RUBY_EXEC_PREFIX"] = "/usr"
66
+ CONFIG["RUBY_EXEC_PREFIX"] = "/nonexistent-ruby-prefix"
67
67
  CONFIG["RUBY_LIB_VERSION"] = ""
68
68
  CONFIG["RUBY_LIB_VERSION_STYLE"] = "3\t/* full */"
69
69
  CONFIG["RI_BASE_NAME"] = "ri"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/wasix-ruby",
3
- "version": "3.4.11-4",
3
+ "version": "3.4.11-6",
4
4
  "description": "MRI Ruby for slicc WASIX (no epoll; asyncify spill 65536; date_core; sysroot 2025.9.30-14)",
5
5
  "license": "Ruby",
6
6
  "files": [
@@ -20,8 +20,8 @@
20
20
  "asyncify_buf": 65536,
21
21
  "asyncify_note": "POSTLINK: wasm-opt --asyncify only (no asyncify-ignore-imports, no restricted import list). Spill macros WASM_{SETJMP,FIBER,SCAN}_STACK_BUFFER_SIZE=65536 (upstream default 6144). No RB_WASM_ASYNCIFY symbol.",
22
22
  "threads_note": "pthread + Asyncify trampoline (WASIX_WASM_THREAD_RT); TLS Asyncify state. Certify Thread/Mutex/Queue at real ipk path for -4+.",
23
- "relocation_note": "configure --prefix=/nonexistent-ruby-prefix so baked-in load paths never match VFS. RUBYLIB lists site/vendor/api + arch (rbconfig). Certify at /shared/lib/node_modules/@ai-ecoverse/wasix-ruby with manifest env \u2014 never at /ruby.",
24
- "slicc_pr_3735": "gem/bundle/rake use args: [\"${package}/bin/\u2026\"]; needs SLICC PR #3735 (absolute args). Until merged, those commands need a harness with the PR."
23
+ "relocation_note": "configure --prefix=/nonexistent-ruby-prefix so baked-in load paths never match VFS. RUBYLIB lists site/vendor/api + arch (rbconfig). Certify at /shared/lib/node_modules/@ai-ecoverse/wasix-ruby with manifest env — never at /ruby.",
24
+ "slicc_pr_3735": "gem/bundle/rake use args: [\"${package}/bin/…\"]; needs SLICC PR #3735 (absolute args). Until merged, those commands need a harness with the PR."
25
25
  },
26
26
  "slicc": {
27
27
  "abi": "wasi",
@@ -29,10 +29,10 @@
29
29
  "ruby": {
30
30
  "wasm": "bin/ruby.wasm",
31
31
  "env": {
32
- "PATH": "${package}/bin:${PATH}",
32
+ "PATH": "${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}",
33
33
  "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",
34
- "GEM_HOME": "${package}/lib/ruby/gems/3.4.0",
35
- "GEM_PATH": "${package}/lib/ruby/gems/3.4.0"
34
+ "GEM_HOME": "${HOME}/.local/share/gem/ruby/3.4.0",
35
+ "GEM_PATH": "${HOME}/.local/share/gem/ruby/3.4.0:${package}/lib/ruby/gems/3.4.0"
36
36
  }
37
37
  },
38
38
  "gem": {
@@ -41,10 +41,10 @@
41
41
  "${package}/bin/gem"
42
42
  ],
43
43
  "env": {
44
- "PATH": "${package}/bin:${PATH}",
44
+ "PATH": "${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}",
45
45
  "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",
46
- "GEM_HOME": "${package}/lib/ruby/gems/3.4.0",
47
- "GEM_PATH": "${package}/lib/ruby/gems/3.4.0"
46
+ "GEM_HOME": "${HOME}/.local/share/gem/ruby/3.4.0",
47
+ "GEM_PATH": "${HOME}/.local/share/gem/ruby/3.4.0:${package}/lib/ruby/gems/3.4.0"
48
48
  }
49
49
  },
50
50
  "bundle": {
@@ -53,10 +53,10 @@
53
53
  "${package}/bin/bundle"
54
54
  ],
55
55
  "env": {
56
- "PATH": "${package}/bin:${PATH}",
56
+ "PATH": "${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}",
57
57
  "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",
58
- "GEM_HOME": "${package}/lib/ruby/gems/3.4.0",
59
- "GEM_PATH": "${package}/lib/ruby/gems/3.4.0"
58
+ "GEM_HOME": "${HOME}/.local/share/gem/ruby/3.4.0",
59
+ "GEM_PATH": "${HOME}/.local/share/gem/ruby/3.4.0:${package}/lib/ruby/gems/3.4.0"
60
60
  }
61
61
  },
62
62
  "rake": {
@@ -65,10 +65,10 @@
65
65
  "${package}/bin/rake"
66
66
  ],
67
67
  "env": {
68
- "PATH": "${package}/bin:${PATH}",
68
+ "PATH": "${HOME}/.local/share/gem/ruby/3.4.0/bin:${package}/bin:${PATH}",
69
69
  "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",
70
- "GEM_HOME": "${package}/lib/ruby/gems/3.4.0",
71
- "GEM_PATH": "${package}/lib/ruby/gems/3.4.0"
70
+ "GEM_HOME": "${HOME}/.local/share/gem/ruby/3.4.0",
71
+ "GEM_PATH": "${HOME}/.local/share/gem/ruby/3.4.0:${package}/lib/ruby/gems/3.4.0"
72
72
  }
73
73
  }
74
74
  }
@@ -1,71 +0,0 @@
1
- # frozen_string_literal: true
2
- $expect_verbose = false
3
-
4
- class IO
5
- # call-seq:
6
- # IO#expect(pattern,timeout=9999999) -> Array
7
- # IO#expect(pattern,timeout=9999999) { |result| ... } -> nil
8
- #
9
- # The +expect+ library adds instance method IO#expect,
10
- # which is similar to the
11
- # {TCL expect extension}[https://www.tcl.tk/man/expect5.31/expect.1.html].
12
- #
13
- # To use this method, you must require +expect+:
14
- #
15
- # require 'expect'
16
- #
17
- # Reads from the IO until the given +pattern+ matches or the +timeout+ is over.
18
- #
19
- # It returns an array with the read buffer, followed by the matches.
20
- # If a block is given, the result is yielded to the block and returns nil.
21
- #
22
- # When called without a block, it waits until the input that matches the
23
- # given +pattern+ is obtained from the IO or the time specified as the
24
- # timeout passes. An array is returned when the pattern is obtained from the
25
- # IO. The first element of the array is the entire string obtained from the
26
- # IO until the pattern matches, followed by elements indicating which the
27
- # pattern which matched to the anchor in the regular expression.
28
- #
29
- # The optional timeout parameter defines, in seconds, the total time to wait
30
- # for the pattern. If the timeout expires or eof is found, nil is returned
31
- # or yielded. However, the buffer in a timeout session is kept for the next
32
- # expect call. The default timeout is 9999999 seconds.
33
- def expect(pat,timeout=9999999)
34
- buf = ''.dup
35
- case pat
36
- when String
37
- e_pat = Regexp.new(Regexp.quote(pat))
38
- when Regexp
39
- e_pat = pat
40
- else
41
- raise TypeError, "unsupported pattern class: #{pat.class}"
42
- end
43
- @unusedBuf ||= ''
44
- while true
45
- if not @unusedBuf.empty?
46
- c = @unusedBuf.slice!(0)
47
- elsif !IO.select([self],nil,nil,timeout) or eof? then
48
- result = nil
49
- @unusedBuf = buf
50
- break
51
- else
52
- c = getc
53
- end
54
- buf << c
55
- if $expect_verbose
56
- STDOUT.print c
57
- STDOUT.flush
58
- end
59
- if mat=e_pat.match(buf) then
60
- result = [buf,*mat.captures]
61
- break
62
- end
63
- end
64
- if block_given? then
65
- yield result
66
- else
67
- return result
68
- end
69
- nil
70
- end
71
- end