aurae-runtime / aurae

Distributed systems runtime daemon written in Rust.
https://aurae.io
Apache License 2.0
1.84k stars 89 forks source link

feat(auraescript) converts from deno_core::JsRuntime to deno_runtime::MainWorker #466

Closed seanwatters closed 1 year ago

seanwatters commented 1 year ago

This change enables usage of all the APIs that Deno CLI provides (web, fs, net, etc.) in AuraeScript.

Includes upgrades to deno_core and deno_ast, and fixes associated with the version bump.

Resolves #434

cla-bot[bot] commented 1 year ago

In order to contribute to a Nivenly Foundation project you must sign and agree to the CLA. Reply with @cla-bot check to check again.

seanwatters commented 1 year ago

@cla-bot check

cla-bot[bot] commented 1 year ago

The cla-bot has been summoned, and re-checked this pull request!

seanwatters commented 1 year ago

Looks like the license check is failing because of the deno_runtime dependency on the notify crate which has the CC0-1.0 OR Artistic-2.0 licenses that aren't green listed.

I don't know if I have access to approve additional licenses but also wouldn't want to make a change without owner involvement.

seanwatters commented 1 year ago

@krisnova , looks like there is actually a bug in this PR where attempting to call Deno.core.initializeAsyncOps is throwing an error, and it appears as though there may be a bug in deno_runtime::MainWorker that isn't actually making extensions / deno_core:ops available on the Deno global object.

Probably need to revert this PR until I can dig a little deeper.

seanwatters commented 1 year ago

After some trial and error, was able to figure out that deno_runtime::MainWorker requires usage of force_op_registration to get ops on the Deno[Deno.internal].core object, and that initializeAsyncOps has been deprecated and removed by Deno. Calling async host operations appears to only be possible with Deno[Deno.internal].core.opAsync now.

I've put up a draft PR to address these issues: https://github.com/aurae-runtime/aurae/pull/474. When testing locally I was able to get all of the Deno errors resolved, but then have a new error and it isn't clear to me whether it's related to Deno changes or something else but appears to be unrelated.

warning: failed to parse config at /home/parallels/.aurae/config: TOML parse error at line 39, column 10
   |
39 | socket = "/var/run/aurae/aurae.sock"
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
unknown variant `/var/run/aurae/aurae.sock`, expected `Path` or `IPv6`

warning: failed to parse config at /etc/aurae/config: No such file or directory (os error 2)
warning: failed to parse config at /var/lib/aurae/config: No such file or directory (os error 2)
Error: Uncaught (in promise) Error: unable to find valid config file
dmah42 commented 1 year ago

that seems unrelated.. but I'm not sure why you'd see it. have you run make pki and make config?

maybe we are parsing the config before the socket file has been created and someone changed the config parsing to be stricter.