-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(wasmer/cache): opt 'sys' into default feature #2821
Conversation
I thought about this further, and compiling To make this work when the default options are not present, the solution is simple: implement serialization/deserialization in
Also, we could make serialization a feature in wasmer/js as well, so we don't have an added overhead saving the bytes if the user doesn't need serialization present. We can do that as part of the PR and we should be good to merge! :) |
Thanks for the guide, I'll peek if I can spin some time to shape PR to correctly include those. |
I tried to add a few paths as much to follow suggestions, open to reflect fixes / suggestions. |
lib/cache/Cargo.toml
Outdated
default = ["sys"] | ||
sys = ["wasmer/sys-default"] | ||
js = ["wasmer/js-default", "wasmer/js-serializable-module"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should enforce sys or js by default. We can simplify this such as:
default = ["sys"] | |
sys = ["wasmer/sys-default"] | |
js = ["wasmer/js-default", "wasmer/js-serializable-module"] | |
default = ["wasmer/js-serializable-module"] |
This should work without adding any feature dependency on wasmer (that is, that the wasmer crate will not automatically use js
or sys
, it will just use the wasmer/js-serializable-module
feature when using js but do nothing on sys
, which is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was curious about this
wasmer crate will not automatically use js or sys
Wouldn't it make existing build as breaking, that upper deps having wasmer-cache or transitive deps need to manually opt in sys
if they're using default? Or it'll be fine since any pkg having wasmer
already may opt in js / sys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think I was not super clear. I think the filesystem
should be enabled by default as well (that way there are no breaking changes).
However, we should not enforce sys or js by default (wasmer-cache should remain agnostic).
In any case, I did applied a small suggestion and the PR looks good!
Thanks @kwonoj, I added some feedback! |
Thanks for the help, updated as suggested. |
bors r+ |
2821: build(wasmer/cache): opt 'sys' into default feature r=syrusakbary a=kwonoj <!-- Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test: https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests --> # Description Context: this is originated from #2817 (comment) , where SWC (https://github.com/swc-project/swc) trying to setup its package dependencies orthogonally requires two distinct features of wasmer (js / sys), encounters feature selection getting merged by cargo. We have workaround it by manual opt in into each features, but the common dependency we have imports wasmer-cache, which ends up to enabling `sys` mandatory. It is also possible to do some workaround by having a feature with make dep as optional, but I feel it'd be better if `cache` allows to opt out from feature. I am honestly not sure if this is acceptable or recommended approach to resolve issue. Please feel free to close if that's the case. # Review - [ ] Add a short description of the change to the CHANGELOG.md file Co-authored-by: OJ Kwon <[email protected]> Co-authored-by: Syrus Akbary <[email protected]>
Build failed: |
Linting is failing, but once is solved we should be good to merge. |
Thanks, applied fmt. |
bors r+ |
Description
Context: this is originated from #2817 (comment) , where SWC (https://github.com/swc-project/swc) trying to setup its package dependencies orthogonally requires two distinct features of wasmer (js / sys), encounters feature selection getting merged by cargo. We have workaround it by manual opt in into each features, but the common dependency we have imports wasmer-cache, which ends up to enabling
sys
mandatory. It is also possible to do some workaround by having a feature with make dep as optional, but I feel it'd be better ifcache
allows to opt out from feature.I am honestly not sure if this is acceptable or recommended approach to resolve issue. Please feel free to close if that's the case.
Review