| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Refs: nodejs#46254 - add version to options when creating WASI object - add convenience function to return importObject Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
Review requested:
|
Sorry, something went wrong.
|
why do we need to explicitly pass a version? each version already has its own import namespace, so they can just coexist right? |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for working on this @mhdawson. Looks good to me and the importObject seems useful, although I was hoping we could discuss some more API changes before removing the flag as well.
Sorry, something went wrong.
| import { argv, env } from 'node:process'; | ||
|
|
||
| const wasi = new WASI({ | ||
| version: 'wasi_snapshot_preview1', |
There was a problem hiding this comment.
It might be worth considering making this just preview1. The current expectation for WASI itself is that preview1 is effectively being moved to be considered stable at this point, even if that hasn't been properly announced yet.
Sorry, something went wrong.
There was a problem hiding this comment.
At the very least, snapshot-preview1 may be a bit briefer.
Apparently, the shapshot part isn't expected to change, so that preview1 may well be sufficient.
Sorry, something went wrong.
There was a problem hiding this comment.
@cjihrig I'd defer to you on how to best name the versions. I just used exactly what was documented as that makes it obvious what it maps to.
Sorry, something went wrong.
There was a problem hiding this comment.
@guybedford probably has better access to the folks that are determining the names of the versions. I'd be in favor of at least dropping the "wasi_" prefix though.
Sorry, something went wrong.
There was a problem hiding this comment.
Ok, will update to 'preview1'
Sorry, something went wrong.
There was a problem hiding this comment.
As I started doing that I realised that the other thing is it means that the mapping between the version requested and what goes into the import object is not as clear. In terms of the discussion about documenting { wasi_unstable: wasi.wasiImport } adding it as a version that could be requested would make less sense if we don't have a 1 to 1 mapping between the version requested and the name of the field in the import object.
I'll wait until next week to give a bit more time for you two to comment on that aspect. If we still think usigin preview1 is better I'll document the { wasi_unstable: wasi.wasiImport } some other way.
Sorry, something went wrong.
There was a problem hiding this comment.
Talked with @guybedford seems like for preview2 the binding between the version and the imports is not direct anyway so my reasoning for keeping them in line would no longer make sense. Updating to 'preview1'
Sorry, something went wrong.
| // Some WASI binaries require: | ||
| // const importObject = { wasi_unstable: wasi.wasiImport }; | ||
| const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; | ||
|
|
There was a problem hiding this comment.
We appear to be losing this information, which could be important to some users. I think we either need to keep this somewhere in the docs, or support passing in "wasi_unstable" as a version which would return the same API as wasi_snapshot_preview1, but with a different version string.
Sorry, something went wrong.
There was a problem hiding this comment.
I'm happy to either add it back to the doc or add to "wasi_unstable" to what can be passed in as a version depending on what people think is best.
Sorry, something went wrong.
There was a problem hiding this comment.
It seems like a pretty easy thing to support since it would be an alias for preview1, so I'd suggest supporting it and removing this note from the docs (but we would need to document that "wasi_unstable" is a valid version).
Sorry, something went wrong.
There was a problem hiding this comment.
will do
Sorry, something went wrong.
@guybedford what else did you have in mind? Maybe open another issue. I'd hate for us to remove the flag and have something slip through the cracks. |
Sorry, something went wrong.
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
Signed-off-by: Michael Dawson <mdawson@devrus.com>
Signed-off-by: Michael Dawson <mdawson@devrus.com>
Signed-off-by: Michael Dawson <mdawson@devrus.com>
Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
@cjihrig, @guybedford I think I've addressed all the comments so far. The one outstanding thing is that the tests are not run for 'unstable' since they were compiled against 'wasi_snapshot_preview1'. I think we would need a new set of the compiled wasm test files. Does that need to be handled in this PR or is it ok since there seems to have been no prior testing of unstable anyway? |
Sorry, something went wrong.
|
The unstable import interface is very old at this point so I think it is fine to treat that as a legacy path that we can support but that we don't need to explicitly test. |
Sorry, something went wrong.
Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
Pushed commit to remove disabled testing related to unstable version. Should be ready to go at this point. |
Sorry, something went wrong.
Failed to start CI- Validating Jenkins credentials ✖ Jenkins credentials invalidhttps://github.com/nodejs/node/actions/runs/4118977794 |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Thanks for doing this.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
Looks like status from CI did not post correct. CI is complete and passed, going to land. |
Sorry, something went wrong.
Refs: #46254 - add version to options when creating WASI object - add convenience function to return importObject Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #46469 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Would you mind backporting this to v18.x? |
Sorry, something went wrong.
Refs: #46254 - add version to options when creating WASI object - add convenience function to return importObject Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #46469 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Notable changes: buffer: * (SEMVER-MINOR) add Buffer.copyBytesFrom(...) (James M Snell) #46500 doc: * add marco-ippolito to collaborators (Marco Ippolito) #46816 events: * (SEMVER-MINOR) add listener argument to listenerCount (Paolo Insogna) #46523 lib: * (SEMVER-MINOR) add AsyncLocalStorage.bind() and .snapshot() (flakey5) #46387 src: * (SEMVER-MINOR) add `fs.openAsBlob` to support File-backed Blobs (James M Snell) #45258 tls: * (SEMVER-MINOR) support automatic DHE (Tobias Nießen) #46978 url: * (SEMVER-MINOR) implement URLSearchParams size getter (James M Snell) #46308 wasi: * (SEMVER-MINOR) add support for version when creating WASI (Michael Dawson) #46469 worker: * (SEMVER-MINOR) add support for worker name in inspector and trace_events (Debadree Chatterjee) #46832 PR-URL: #47087
Notable changes: buffer: * (SEMVER-MINOR) add Buffer.copyBytesFrom(...) (James M Snell) #46500 doc: * add marco-ippolito to collaborators (Marco Ippolito) #46816 events: * (SEMVER-MINOR) add listener argument to listenerCount (Paolo Insogna) #46523 lib: * (SEMVER-MINOR) add AsyncLocalStorage.bind() and .snapshot() (flakey5) #46387 src: * (SEMVER-MINOR) add `fs.openAsBlob` to support File-backed Blobs (James M Snell) #45258 tls: * (SEMVER-MINOR) support automatic DHE (Tobias Nießen) #46978 url: * (SEMVER-MINOR) implement URLSearchParams size getter (James M Snell) #46308 wasi: * (SEMVER-MINOR) add support for version when creating WASI (Michael Dawson) #46469 worker: * (SEMVER-MINOR) add support for worker name in inspector and trace_events (Debadree Chatterjee) #46832 PR-URL: #47087
| Back | FazBrowse Home | New Git URL |
Refs: #46254
Signed-off-by: Michael Dawson mdawson@devrus.com