Merge pull request #210 from alistair23/alistair/artifacts
.github: Build artifacts as part of workflow
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a992373..6f0974e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,12 +1,3 @@
-# PR Workflow
-
-We use the bors-ng bot to merge PRs. In short, when someone replies `bors r+`,
-your PR has been scheduled for final tests and will be automatically merged. If
-a maintainer replies `bors delegate+`, then you have been granted the authority
-to merge your own PR (usually this will happen if there are some trivial
-changes required). For a full list of bors commands,
-[see the bors documentation](https://bors.tech/documentation/).
-
# Tests
Our aim is to provide a number of tests to be safe from regression. Currently,
@@ -52,3 +43,8 @@
[ OK ] GPIO read/write
[ OK ] Test suite finished with state SUCCESS
```
+
+# PR Review Workflow
+
+Our code review practices are documented in our [Code Review](doc/CodeReview.md)
+document.
diff --git a/Cargo.toml b/Cargo.toml
index f5cb932..cb8e160 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -62,6 +62,7 @@
members = [
"codegen",
"core",
+ "core/platform",
"test_runner",
"tools/print_sizes",
]
diff --git a/Makefile b/Makefile
index b7efed7..0227e3d 100644
--- a/Makefile
+++ b/Makefile
@@ -40,10 +40,12 @@
rustup target add thumbv7em-none-eabi
rustup target add riscv32imac-unknown-none-elf
rustup target add riscv32imc-unknown-none-elf
- rustup component add rustfmt
rustup component add clippy
+ rustup component add rustfmt
+ rustup component add miri
cargo install elf2tab --version 0.4.0
cargo install stack-sizes
+ cargo miri setup
# Sets up QEMU in the tock/ directory. We use Tock's QEMU which may contain
# patches to better support boards that Tock supports.
@@ -82,7 +84,7 @@
test: examples test-qemu-hifive
PLATFORM=nrf52 cargo fmt --all -- --check
PLATFORM=nrf52 cargo clippy --workspace --all-targets
- PLATFORM=nrf52 cargo test --workspace
+ PLATFORM=nrf52 cargo miri test --workspace
echo '[ SUCCESS ] libtock-rs tests pass'
.PHONY: analyse-stack-sizes
diff --git a/core/Cargo.toml b/core/Cargo.toml
index bfa9570..f19168c 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -13,3 +13,4 @@
[dependencies]
linked_list_allocator = { optional = true, version = "=0.8.1", default-features = false }
libtock_codegen = { path = "../codegen" }
+libtock_platform = { path = "platform" }
diff --git a/core/platform/Cargo.toml b/core/platform/Cargo.toml
new file mode 100644
index 0000000..79c4d19
--- /dev/null
+++ b/core/platform/Cargo.toml
@@ -0,0 +1,13 @@
+[package]
+authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
+categories = ["embedded", "no-std", "os"]
+description = """libtock-rs platform layer. Provides the Platform abstraction,
+ an abstraction that extends Tock's system calls to form the
+ basis for libtock-rs' asynchronous APIs. libtock_platform is
+ intended for use in both TBF binaries and unit tests that run
+ on Linux."""
+edition = "2018"
+license = "Apache-2.0 OR MIT"
+name = "libtock_platform"
+repository = "https://www.github.com/tock/libtock/rs"
+version = "0.1.0"
diff --git a/core/platform/src/lib.rs b/core/platform/src/lib.rs
new file mode 100644
index 0000000..64d520b
--- /dev/null
+++ b/core/platform/src/lib.rs
@@ -0,0 +1,9 @@
+#![no_std]
+
+// TODO: Implement this crate, which will be done piece-by-piece. Platform will
+// include:
+// 1. The Allowed and AllowedSlice abstractions for sharing memory with the
+// kernel
+// 2. The PlatformApi trait and Platform implementation.
+// 3. A system call trait so that Platform works in both real Tock apps and
+// unit test environments.
diff --git a/doc/CodeReview.md b/doc/CodeReview.md
new file mode 100644
index 0000000..5b0995d
--- /dev/null
+++ b/doc/CodeReview.md
@@ -0,0 +1,43 @@
+Code Review
+===========
+
+## Code Review Practices
+
+PR to `libtock-rs` can be divided into two categories:
+
+1. **Upkeep pull requests** are minor changes to existing functionality.
+ Examples include bug fixes (that do not significantly affect APIs) and
+ documentation that describes an existing implementation.
+1. **Significant pull requests** are pull requests that are too substantial to
+ be considered upkeep pull requests. Significant pull requests may include new
+ functionality, API changes, significant refactoring, new tooling, and other
+ changes.
+
+The owners of `libtock-rs` (listed [below](#owners)) determine whether a PR is
+an upkeep PR or a significant PR. PRs should be merged by the `libtock-rs`
+owners rather than the PR's author. PRs authored by `libtock-rs` owners should
+be merged by a reviewer rather than their author. In general, PRs should be
+merged using a `bors r+` command rather than the GitHub UI (see the [bors
+documentation](https://bors.tech/documentation/) for more information on bors).
+
+A PR may only be merged when all of the following are true:
+
+1. At least one `libtock-rs` owner (who is not the PR author) has approved the PR.
+1. All outstanding review discussions have been resolved.
+1. If the pull request is significant, a 7 day waiting period has passed since
+ the PR was opened.
+
+We recommend that authors of significant PRs comment on the PR when they believe
+the above criteria have been satisfied (including the waiting period). This is
+primarily to remind the owners to merge the PR. Secondarily, it should help
+identify confusion about a PR review's status.
+
+## Owners
+
+The owners of `libtock-rs` are:
+
+* The [Tock Core Working
+ Group](https://github.com/tock/tock/tree/master/doc/wg/core#members).
+* Alistair Francis, [alistair23](https://github.com/alistair23), Western Digital
+* [torfmaster](https://github.com/torfmaster)
+* [Woyten](https://github.com/Woyten)