This repository was archived by the owner on Oct 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 472
Prepare library to be used with wasm32-wasi #2907
Open
yurydelendik
wants to merge
3
commits into
sass:master
Choose a base branch
from
yurydelendik:wasi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Thank you for the effort. I was talking to some wasi folks in Berlin
recently about this. Happy to see it progressing.
…On Thu., 13 Jun. 2019, 5:25 pm Yury Delendik, ***@***.***> wrote:
There is ongoing efforts to support WASI <https://wasi.dev/> for
different runtimes/hosts such as node.js
<nodejs/node#27850>. Here is the changes I made
to make compilation work for clang with "wasm32-wasi" target and the
wasi-sdk. The "wasi_polyfill.*" code will be removed in final PR.
There is also minor change in the sassc:
https://github.com/yurydelendik/sassc/tree/wasi
Please provide any feedback and TODO items to make the patch landable.
Thanks.
------------------------------
You can view, comment on, or merge this pull request online at:
#2907
Commit Summary
- WebAssembly: node polyfill code and build script
- Add npm packaging
- WebAssembly: read cwd from environment vars
- Refactor wasi_polyfill
File Changes
- *M* Makefile <https://github.com/sass/libsass/pull/2907/files#diff-0>
(30)
- *M* src/file.cpp
<https://github.com/sass/libsass/pull/2907/files#diff-1> (14)
- *M* src/plugins.cpp
<https://github.com/sass/libsass/pull/2907/files#diff-2> (6)
- *A* wasm/.gitignore
<https://github.com/sass/libsass/pull/2907/files#diff-3> (4)
- *A* wasm/Makefile
<https://github.com/sass/libsass/pull/2907/files#diff-4> (29)
- *A* wasm/README.md
<https://github.com/sass/libsass/pull/2907/files#diff-5> (26)
- *A* wasm/cli.js
<https://github.com/sass/libsass/pull/2907/files#diff-6> (29)
- *A* wasm/libcxxabi_stubs.c
<https://github.com/sass/libsass/pull/2907/files#diff-7> (25)
- *A* wasm/package.json.in
<https://github.com/sass/libsass/pull/2907/files#diff-8> (19)
- *A* wasm/wasi_polyfill.js
<https://github.com/sass/libsass/pull/2907/files#diff-9> (444)
- *A* wasm/wasi_polyfill.wasm
<https://github.com/sass/libsass/pull/2907/files#diff-10> (0)
- *A* wasm/wasi_polyfill.wat
<https://github.com/sass/libsass/pull/2907/files#diff-11> (67)
Patch Links:
- https://github.com/sass/libsass/pull/2907.patch
- https://github.com/sass/libsass/pull/2907.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2907?email_source=notifications&email_token=AAENSWDMIJ7YVIYTOFNUGUTP2JRHHA5CNFSM4HX2X66KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZLB64Q>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAENSWASPDK3EXU4CSFYK3TP2JRHHANCNFSM4HX2X66A>
.
|
mgreter
reviewed
Jun 13, 2019
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.
Overall looks ok. There is also the autotools build. Any plans to
add wasm target also there? It would also be good to know
which files in the wasm directory were auto generated.
e365c52 to
2450903
Compare
nschonni
reviewed
Jun 13, 2019
I have near 0 experience with autotools. I had no plans to touch that portion. Let me know what needs to be done there. The example files were removed from this repo and placed at https://github.com/yurydelendik/sassc/tree/wasi/wasm |
devsnek
reviewed
Jun 17, 2019
|
I suggest rebasing on master because a large changeset was just merged |
It is the changes I made to make compilation work for clang with "wasm32-wasi" target and the wasi-sdk.
|
I'm on vacation until next week. I'll take a look when I'm back.
…On Wed., 19 Jun. 2019, 6:21 pm Yury Delendik, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/file.cpp
<#2907 (comment)>:
> @@ -49,6 +50,15 @@ inline static std::string wstring_to_string(const std::wstring &wstr)
# endif
#endif
+#ifdef _WASM
+inline static std::string get_cwd_from_env()
+{
+ char* value = getenv("PWD");
Added option to avoid removal "./" for the _WASM in the
make_canonical_path() -- "./" shall work now.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2907?email_source=notifications&email_token=AAENSWHMWUPIQOPCATLGIT3P3JMHNA5CNFSM4HX2X66KYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4BG5QQ#discussion_r295388956>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAENSWGJOC2JSL7GF5TLO4TP3JMHNANCNFSM4HX2X66A>
.
|
|
Is there anything needs to be done for acceptance of this PR? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is ongoing efforts to support WASI for different runtimes/hosts such as node.js. Here is the changes I made to make compilation work for clang with "wasm32-wasi" target and the wasi-sdk. The "wasi_polyfill.*" code will be removed in final PR.
There is also minor change in the sassc: https://github.com/yurydelendik/sassc/tree/wasi . The build version of sassc on node: https://www.npmjs.com/package/sassc-wasi .
Please provide any feedback and TODO items to make the patch landable. Thanks.