Skip to content

Commit

Permalink
Use the revised README.rx with simplified dependencies section
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackPierce committed May 30, 2018
1 parent 3ffbf6b commit 6caf2cb
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 48 deletions.
104 changes: 62 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,20 @@ to be installed. The few Rust dependencies are managed by Cargo.toml,
so Cargo is necessary, as well as Xargo for cross-compilation. Rustup
is the recommended Rust toolchain manager.

* [Rust Nightly](https://github.com/rust-lang-nursery/rustup.rs)
* [rust](https://github.com/rust-lang-nursery/rustup.rs) (nightly)
* [xargo](https://github.com/japaric/xargo) (for cross-compiling)
* [gcc/g++ cross compilers](https://gcc.gnu.org/) (for ARM targets)
* [cmake](https://cmake.org/download/) (for seL4's build)
* [ninja-build](https://ninja-build.org/) (for seL4's build)
* [python](https://python.org/) (for seL4's build)
* [xmlint](http://xmlsoft.org/xmllint.html) (for seL4's build)

### Building

This project is intended to be built in the context of the `cargo fel4` command, which manages
the piping of key environment variables relevant to the downstream project.

* Install [Rust Nightly](https://github.com/rust-lang-nursery/rustup.rs)
```bash
# Download the rustup install script
wget https://static.rust-lang.org/rustup/rustup-init.sh
Expand All @@ -33,29 +46,42 @@ is the recommended Rust toolchain manager.

rustup install nightly
```
* [xargo](https://github.com/japaric/xargo)
* Install [xargo](https://github.com/japaric/xargo)
```bash
# Xargo requires rust-src component
rustup component add rust-src
rustup component add --toolchain nightly rust-src

# Install Xargo
cargo install xargo
cargo +nightly install xargo
```
* [Cross Compiler Toolchains](https://gcc.gnu.org/)
* Install the [gnu cross compilers](https://gcc.gnu.org/)
```bash
# Used by the armv7-sel4-fel4 target
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

# Used by the aarch64-sel4-fel4 target
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
* [cmake](https://cmake.org/download/)
```
* Install Python, pip, and a sel4-specific pip package.
```bash
# Install python and pip, if you don't have them already
sudo apt-get install python-pip

pip install sel4-deps
```
* Install [cmake](https://cmake.org/download/)

CMake version `3.7.2` or greater is required.
Binary releases are available from [cmake.org](https://cmake.org/download/).

An example workflow for a recent binary installation on Ubuntu
[can be found on StackExchange's askUbuntu](https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line/865294#865294).
* [ninja-build](https://ninja-build.org/)

Alternately, you can use Python's `pip` tool to install the latest cmake.
```bash
sudo pip install --upgrade cmake
```
* Install [ninja-build](https://ninja-build.org/)
Ninja version `1.7.1` or greater is required or greater is required due to the seL4 build system.
Binary releases are available from [github](https://github.com/ninja-build/ninja/releases).

Expand All @@ -64,52 +90,46 @@ is the recommended Rust toolchain manager.
```bash
sudo apt-get install ninja-build
```
* [Python Tooling](https://python.org/)
The underlying seL4 build system also makes use of some Python tools.
```bash
# Install python and pip, if you don't have them already
sudo apt-get install python-pip

pip install sel4-deps
```
* [xmlint](http://xmlsoft.org/xmllint.html)

The underlying seL4 build system requires `xmlint`.

```bash
sudo apt-get install libxml2-utils
```
### Building
This project is intended to be built in the context of the `cargo fel4` command, which manages
the piping of key environment variables relevant to the downstream project.
See the [cargo-fel4 repository](https://github.com/PolySync/cargo-fel4) for more direction, but the general idea is to create
a Rust project with `libsel4-sys` as a dependency, add a fel4.toml file, and to run `cargo fel4 build`.
While not recommended for general use, manual builds are possible. If environment variable `FEL4_ARTIFACT_PATH` is set, the kernel and simulation script
will be copied into the directory specified by the variable.
```bash
# Pull in seL4 related dependencies to the local filesystem
git submodule update --init

# Builds require that the `FEL4_MANIFEST_PATH` environment variable is set and
# includes a path pointing to a fel4.toml file, as specified by the `fel4-config` crate
# Additionally, the `RUST_TARGET_PATH` must be supplied, pointing to the directory that
# contains the Rust target specification JSON files relevant for the desired build target.
RUST_TARGET_PATH=$PWD/test_configs FEL4_MANIFEST_PATH=$PWD/test_configs/fel4.toml xargo rustc --target x86_64-sel4-fel4 -vv
```
* Install [cargo-fel4](https://github.com/PolySync/cargo-fel4) using the directions from that repository.
* Use `cargo-fel4` to create a new feL4 project, which will automatically include `libsel4-sys` as a dependency to build
```bash
cargo fel4 new demo_project
cd demo_project
cargo fel4 build
```
* Manual builds are available as an alternative to using `cargo-fel4`, though are not recommended for general use.
* Clone the libsel4-sys repository
```bash
git clone [email protected]:PolySync/libsel4-sys.git
cd libsel4-sys
```
* Pull in seL4 related dependencies to the local filesystem
```bash
git submodule update --init
```
* Manual builds require that the `FEL4_MANIFEST_PATH` environment variable is set and
includes a path pointing to a fel4.toml file, as specified by the `fel4-config` crate.
Additionally, the `RUST_TARGET_PATH` must be supplied, pointing to the directory that
contains the Rust target specification JSON files relevant for the desired build target.
```bash
RUST_TARGET_PATH=$PWD/test_configs FEL4_MANIFEST_PATH=$PWD/test_configs/fel4.toml xargo rustc --target x86_64-sel4-fel4 -vv
```

### Installation

libsel4-sys may be included in your Rust project by adding the following
to your Cargo.toml dependencies.
libsel4-sys may be included in your Rust project by including it in your Cargo.toml.

```toml
libsel4-sys = { git = "https://github.com/PolySync/libsel4-sys.git", branch = "master" }
```
* In the relevant `[dependencies]` section:
```toml
libsel4-sys = { git = "https://github.com/PolySync/libsel4-sys.git", branch = "master" }
```

## Usage

Expand Down
15 changes: 9 additions & 6 deletions README.rx
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@
-??-

* -??-
* [-!!-](-!!-)
* -??-
* [-!!-](-!!-) -??-
* -""-

### Building

-!!-<!-- Short Explanation -->

```-??-
```
* -!!-<!-- Build Step Explanation -->
```-??-
```
* -""-

### Installation

-!!-<!-- Short Explanation -->

```-??-
```
* -!!-<!-- Installation Step Explanation -->
```-??-
```
* -""-

## Usage

Expand Down

0 comments on commit 6caf2cb

Please sign in to comment.