Skip to content

Commit fa5d9ee

Browse files
authored
Readme cleanup + install script cleanup (#24)
* chore: Use latest commit for wasmception branch * chore: Validate root of git repo * chore: Ignore case when checking repo * chore: Modify use of LLVM install script * chore: assorted install script fixes * chore: script and README fixes
1 parent 4618797 commit fa5d9ee

File tree

3 files changed

+40
-30
lines changed

3 files changed

+40
-30
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ aWsm - An Awesome Wasm Compiler and Runtime
33

44
# What is aWsm?
55

6-
aWsm is a compiler and runtime for compiling Web Assembly (Wasm) code into llvm bytecode, then into sandboxed binaries you can run on various platforms.
7-
It focuses on generating very fast code (best of breed for Web Assembly), having a simple and extensible code-base, and on portability.
6+
aWsm is a compiler and runtime for compiling WebAssembly (Wasm) code into llvm bytecode, then into sandboxed binaries you can run on various platforms.
7+
It focuses on generating very fast code (best of breed for WebAssembly), having a simple and extensible code-base, and on portability.
88

9-
**What is Web Assembly?**
9+
**What is WebAssembly?**
1010
Wasm is a standard binary format that is *platform agnostic*, *debuggable*, *fast*, and *safe*.
1111
Please see the [official webpage](https://webassembly.org/), and its [specification](https://webassembly.org/specs/).
1212
Many languages (including C/C++, Rust, C#, Go, Kotlin, Swift, and more, see a more [complete list](https://webassembly.org/getting-started/developers-guide/)) compile to Wasm.
@@ -28,7 +28,7 @@ Wasm provides a number of benefits outside of the web including:
2828
**A note on naming.**
2929
aWsm started out as the `silverfish` compiler, the brainchild of Gregor Peach when he was a researcher in the group.
3030
There are still quite a few lingering `silverfish` references.
31-
Please have patience as we update those to `awsm`.
31+
Please have patience as we update those to `aWsm`.
3232

3333
## Why aWsm?
3434

@@ -173,8 +173,8 @@ ARGS:
173173
### Debian-based Systems
174174

175175
```sh
176-
git clone https://github.com/gwsystems/awsm.git
177-
cd awsm
176+
git clone https://github.com/gwsystems/aWsm.git
177+
cd aWsm
178178
./install_deb.sh
179179
```
180180

@@ -184,27 +184,27 @@ The compiler can now be run via `silverfish`
184184

185185
1. [Install Rust](https://www.rust-lang.org/tools/install)
186186
2. [Install LLVM](http://releases.llvm.org/download.html)
187-
3. Link Your Clang Installation so `clang-9` and `llvm-config-9` are in your path and invokable as `clang` and `llvm-config`. For example, the following commands accomplish this using `update-alternatives` after replacing LLVM_VERSION with the version returned you installed above (In *NIX systems, this can be confirmed with `ls /usr/bin/clang*`)
187+
3. Link Your Clang Installation so `clang-9` and `llvm-config-9` are in your path aliased to `clang` and `llvm-config`. For example, the following commands accomplish this using `update-alternatives` after replacing LLVM_VERSION with the version returned you installed above (In *NIX systems, this can be confirmed with `ls /usr/bin/clang*`)
188188
```sh
189189
LLVM_VERSION=9
190190
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
191191
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
192192
```
193193
4. [Install the C++ Standard Library for LLVM](https://libcxx.llvm.org/)
194-
5. Clone and build awsm
194+
5. Clone and build aWsm
195195
```sh
196-
git clone https://github.com/gwsystems/awsm.git
197-
cd awsm
196+
git clone https://github.com/gwsystems/aWsm.git
197+
cd aWsm
198198
cargo build --release
199199
```
200-
6. The awsm binary is built at `target/release/silverfish`. Copy this to the appropriaate place for your platform and add to your PATH if neccessary.
200+
6. The aWsm binary is built at `target/release/silverfish`. Copy this to the appropriate place for your platform and add to your PATH if necessary.
201201

202202
## Executing and Testing aWsm
203203

204204
The tests can run with
205205

206206
```sh
207-
cd code_benches; python run.py
207+
cd code_benches; ./run.py
208208
```
209209

210210
Please see the [design](doc/design.md) to understand the pipeline, and see `run.py` for an example of how to connect existing compilers (to generate Wasm, and generate machine code from LLVM IR) with aWsm.

install_deb.sh

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,49 @@
22
# Installs dependencies, builds Silverfish, and places it into your path
33
# Be sure to validate the Rust and LLVM install scripts we invoke below!
44

5-
# TODO: Error Checking. Bail if not executing script from project root because we use relative paths
5+
# Exit if not executing script from project root because we use relative paths
6+
# We want to match without case because the URL of the git repo is case insensitive, but the resulting
7+
# directory is case sensitive. Thus, we can end up with either "aWsm" or "awsm."
8+
shopt -s nocasematch
9+
if [[ $(git remote get-url origin) != *"/aWsm.git" || $(git rev-parse --show-toplevel) != $(pwd) ]]; then
10+
echo "Install script must be run from project root."
11+
exit 1
12+
fi
13+
shopt -u nocasematch
14+
15+
# Install Build Dependencies
16+
sudo apt install build-essential --yes
17+
sudo apt install cmake --yes
618

19+
# Initialize Wasmception submodule
720
# Check to see if ./wasmception directory exists and is not empty.
821
# If not assume user didn't initialize submodules
922
if [[ ! -d "./wasmception" ]] || [[ -z "$(ls -A wasmception)" ]]; then
1023
git submodule update --init --recursive
1124
fi
1225

13-
# Wasmception
14-
# Install Subversion
15-
sudo apt install subversion --yes
16-
17-
# Build
18-
# This is super slow. Does something need to get modified in the Makefile?
19-
cd wasmception
26+
# Build Wasmception from Source
27+
cd wasmception || exit
2028
make
21-
cd ..
22-
23-
## Silverfish
24-
sudo apt install build-essential --yes
29+
cd .. || exit
2530

31+
# Install Rust
2632
if [[ -x "$(command -v rustup)" ]]; then
2733
rustup update
28-
else
34+
else
2935
curl https://sh.rustup.rs -sSf | bash -s -- -y
3036
fi
31-
32-
source $HOME/.cargo/env
37+
source "$HOME/.cargo/env"
3338
export PATH="$HOME/.cargo/bin:$PATH"
34-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
39+
40+
# Install LLVM build dependencies
3541
LLVM_VERSION=9
42+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" bash $LLVM_VERSION
3643
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-$LLVM_VERSION 100
44+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-$LLVM_VERSION 100
3745
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-$LLVM_VERSION 100
3846
sudo apt install libc++-dev libc++abi-dev --yes
47+
48+
# Build and install Silverfish
3949
cargo build --release
40-
sudo cp -t /usr/bin ./target/release/silverfish
50+
sudo cp -t /usr/bin ./target/release/silverfish

wasmception

0 commit comments

Comments
 (0)