Skip to content

[WIP] Node tests using Edgejs WASIX QuickJS#91

Draft
sadhbh-c0d3 wants to merge 19 commits into
mainfrom
test-wasix-quickjs-only
Draft

[WIP] Node tests using Edgejs WASIX QuickJS#91
sadhbh-c0d3 wants to merge 19 commits into
mainfrom
test-wasix-quickjs-only

Conversation

@sadhbh-c0d3

@sadhbh-c0d3 sadhbh-c0d3 commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator
  • added make target
  • added runner script
  • added test step into gh workflow action

NOTE This is work in progress. Some W/A are introduced to check tests passing - they will need to be addressed separately in wasix-libc and wasmer.

@sadhbh-c0d3 sadhbh-c0d3 changed the title Node tests using Edgejs WASIX QuickJS [WIP] Node tests using Edgejs WASIX QuickJS Jun 4, 2026
Comment thread src/edge_process_wrap.cc Outdated
Comment on lines +80 to +86
#ifdef __wasi__
if (args == nullptr || args->size() < 3) return;
if (!IsEvalOrPrintFlag((*args)[1])) return;
std::string& script = (*args)[2];
if (script.find('\n') == std::string::npos && script.find('\r') == std::string::npos) return;
script = "eval(Buffer.from('" + Base64Encode(script) + "', 'base64').toString())";
#else

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a major hack, I strongly feel we should not have this. Why this was needed on the first place?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this should be removed at the end, when we improve proc_spawn() to take multiple arguments.

Comment thread src/edge_cares_wrap.cc Outdated
Comment on lines +1631 to +1642
if (req->hostname == "127.0.0.1" || req->hostname == "::1") {
channel->active_reqs.insert(req);
char localhost[] = "localhost";
char* aliases[] = {localhost, nullptr};
hostent host{};
host.h_name = localhost;
host.h_aliases = aliases;
host.h_addrtype = family;
host.h_length = length;
CompleteQuery(req, ARES_SUCCESS, nullptr, 0, &host, true);
return 0;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me this should be fixed on wasix-libc or the wasmer side

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check this

Comment thread src/edge_cares_wrap.cc Outdated
Comment on lines +2002 to +2014
if (host == "127.0.0.1" || host == "::1") {
const std::string service = std::to_string(port);
napi_value cb_argv[3] = {
MakeInt32(env, 0),
MakeStringUtf8(env, "localhost"),
MakeStringUtf8(env, service.c_str()),
};
InvokeOnComplete(env, req, 3, cb_argv);
UntrackPendingReq(req);
MarkReqComplete(req);
CleanupReqAfterAsync(req);
return MakeInt32(env, 0);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should live here? (very related to my other comment)

@sadhbh-c0d3 sadhbh-c0d3 marked this pull request as draft June 8, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants