Skip to content

Add beginner-level documentation for installation and use#107

Merged
sunfishcode merged 1 commit into
WebAssembly:masterfrom
abrown:add-documentation
Apr 3, 2020
Merged

Add beginner-level documentation for installation and use#107
sunfishcode merged 1 commit into
WebAssembly:masterfrom
abrown:add-documentation

Conversation

@abrown

@abrown abrown commented Mar 24, 2020

Copy link
Copy Markdown
Collaborator

This may seem very obvious to users of this repo but I couldn't quite recall the steps to install the latest version of wasi-sdk from the release binaries.

Comment thread README.md Outdated
Comment thread README.md Outdated
@abrown abrown force-pushed the add-documentation branch from 8cf4a41 to 4a31348 Compare March 24, 2020 22:06
Comment thread README.md Outdated
Comment thread README.md Outdated
@abrown abrown force-pushed the add-documentation branch 3 times, most recently from 300792b to bd75d70 Compare March 24, 2020 22:20
Comment thread README.md Outdated
```shell script
wget https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-[VERSION]/wasi-sdk-[VERSION]-linux.tar.gz
tar xvf wasi-sdk-[VERSION]-linux.tar.gz
cp -r wasi-sdk-[VERSION] [WASI_SDK_PATH]

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 think I'm ok with this as is, but I wouldn't even include the cp command at all. Mostly because when I use the SDK I just untar it... I don't then copy it. This seems to imply that copying it is necessary.

I don't mean to be pedantic... do you think it helps to include a copy here?

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.

I don't care either way: I originally included it because I have been doing the copy to /opt/wasi-sdk... I removed it in the latest push.

@abrown abrown force-pushed the add-documentation branch from bd75d70 to e9560af Compare March 25, 2020 19:33
Comment thread README.md Outdated

A typical installation from the release binaries might look like the following:
```shell script
wget https://github.com/CraneStation/wasi-sdk/releases/download/wasi-sdk-[VERSION]/wasi-sdk-[VERSION]-linux.tar.gz

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.

Do you know what we need to do to update this URL to point to the WebAssembly org now, rather than CraneStation?

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.

Huh, looks I used an URL from somewhere; the new ones work too. I'll update.

Comment thread README.md Outdated
CC="[WASI_SDK_PATH]/bin/clang --sysroot=[WASI_SDK_PATH]/share/wasi-sysroot"
$CC foo.c -o foo.wasm
```
Note: `[WASK_SDK_PATH]/share/wasi-sysroot` contains the WASI-specific includes/libraries/etc.

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.

The one thing I'd add here is that the clang comes preconfigured, I think to look for the sysroot under /opt/wasi-sdk, so if you install the packages there then you don't need to pass --sysroot.

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.

Ha! I think @sbc100 was commenting about this above... but in the opposite direction (i.e. more explicit use of --sysroot). I'll add a note here about /opt/wasi-sdk.

@abrown abrown force-pushed the add-documentation branch from e9560af to cee6128 Compare March 30, 2020 22:46
@sbc100

sbc100 commented Mar 30, 2020

Copy link
Copy Markdown
Member

Great! This looks good to me now. We can remove the mentioning /opt as the default once we update to llvm 11 at which point we can rely instead on https://reviews.llvm.org/D76653.

@sbc100

sbc100 commented Apr 1, 2020

Copy link
Copy Markdown
Member

@sunfishcode OK to land this?

@sunfishcode

Copy link
Copy Markdown
Member

Ok!

@sunfishcode sunfishcode merged commit 4d08c33 into WebAssembly:master Apr 3, 2020
@abrown abrown deleted the add-documentation branch April 3, 2020 22: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.

3 participants