Using gems with Node WASI

未关闭
#604 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
node.js, ruby, wasm
领域
backend

调研方向

先阅读 cheatsheet 和 README 中对 DefaultRubyVM 的使用,然后将其与链接的 wasi.ts 包装器及其对 preopens 的处理进行比较。确认预期结果是更灵活的 DefaultRubyVM API,还是一个有文档说明的 Node WASI 示例,并验证 gems 是否可以映射到 WASI 虚拟文件系统中。

由索引模型根据 Issue 内容生成。

描述

Hey, since I needed it myself, and based on https://gist.github.com/kateinoigakukun/5caf3b83b2732b1653e91b0e75ce3390, I wrote JS code that allows you to use gems with Node WASI.

Unfortunately, as you need preopens for that (to map the gems into the WASI vfs), it's currently not possible to use DefaultRubyVM for that, as its options are limited to env.

I wrote my own small wrapper to allow me access to the full breadth of WASI options: https://github.com/primate-run/primate/blob/master/packages/ruby/src/private/wasi.ts, but it took me a bit to understand how to get the RubyVM from the package to mimic the behaviour of DefaultRubyVM. The examples in the cheatsheet are all using DefaultRubyVM.

It is possible to perhaps make DefaultRubyVM a bit more flexible, so that it's possible to use preopens with it?

Alternatively, if you want to keep the defaults simple, perhaps add this example to the readme or cheatsheet? I don't mind sending a PR.

主要语言
Ruby
星标
875
派生
68
平均合并
9 天 5 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ruby/ruby.wasm 的其他 Issue

查看 ruby/ruby.wasm 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。