MatrixAI / js-exec

Execute child process while replacing process-memory for TypeScript & JavaScript

Home Page:https://polykey.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting initial exec implementation released

tegefaulkes opened this issue · comments

Specification

I'm making this issue to track the work needed to get the first release of js-exec out.

Additional context

Tasks

  1. Finish polishing code.
  2. FInish ci config and get that working
  3. make sure execvpe works on macos. It may not be supported properly so we'll need to replicate the behaviour some other way. Although uapi mentions support for darwin so maybe they already handle this? I can test via CI first.
  4. Fill ci passes and releases.

There may be a sliding scale of what we support for now.

  1. linux should be supported.
  2. macos needs to be supported but may need extra work.
  3. win needs an alternative method since process replacement isn't available. Need to decide where to implement that. here or whatever uses js-exec can use child_process to run a sub-process.

Later on if needed we can implement all of the exec functions that are available in the uapi.

Yep, the mac version isn't building.

error[E0425]: cannot find function `execvpe` in crate `uapi`
  --> src/napi/lib.rs:53:9
   |
53 |     uapi::execvpe(
   |           ^^^^^^^ help: a function with a similar name exists: `execve`
   |
  ::: /Users/gitlab/.cargo/registry/src/github.com-1ecc6299db9ec823/uapi-0.2.10/src/process/mod.rs:85:1
   |
85 | / pub fn execve<'a>(
86 | |     pathname: impl IntoUstr<'a>,
87 | |     argv: &UstrPtr,
88 | |     envp: &UstrPtr,
89 | | ) -> Result<()> {
   | |_______________- similarly named function `execve` defined here
For more information about this error, try `rustc --explain E0425`.
error: could not compile `exec` due to previous error

So execvpe isn't supported for darwin.

See my notes regarding that in #129.

I'm considering this done with the release of version 0.1.2.