ruby / ruby/ruby.wasm

Using gems with Node WASI

Offen
#604 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Ruby
Sterne
875
Forks
68
Ø Merge
9 T. 5 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Verwendung von DefaultRubyVM im cheatsheet und in der README zu lesen, vergleiche sie anschließend mit dem verlinkten wasi.ts-Wrapper und seiner Behandlung von preopens. Bestätige, ob das beabsichtigte Ergebnis eine flexiblere DefaultRubyVM-API oder ein dokumentiertes Node WASI-Beispiel ist, und validiere, dass gems in das virtuelle WASI-Dateisystem eingebunden werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
node.js, ruby, wasm
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.