Skip to content

Commit

Permalink
Configure cache in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
nspin committed Dec 28, 2023
1 parent df744e3 commit c5ee3a5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ ifneq ($(CORES),)
endif

nix_args := $(keep_going_args) $(jobs_args) $(cores_args)
nix_build := nix-build $(nix_args)
nix_shell := nix-shell $(nix_args)
run_in_nix_shell := $(nix_shell) --run

append_to_nix_config := NIX_CONFIG="$$(printf "%s\n" "$$NIX_CONFIG" && cat hacking/binary-cache/fragment.nix.conf)"

nix_build := $(append_to_nix_config) nix-build $(nix_args)
nix_shell := $(append_to_nix_config) nix-shell $(nix_args)

ifeq ($(IN_NIX_SHELL_FOR_MAKEFILE),)
# TODO
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ the crates which use them:

### Quick start for running the tests in this repository

The only requirements for running the tests in this repository are Git, Make, and Docker.
The only requirements for building and running the tests in this repository are
Linux, Make, and [Nix](https://nix.dev/). This repository contains scripts for
setting up a Docker container with a suitable development environment in case
you aren't on Linux or don't want to install Nix.

First, clone this repository:

Expand All @@ -130,22 +133,22 @@ git clone https://github.com/seL4/rust-sel4
cd rust-sel4
```

Next, build, run, and enter a Docker container for development:
If you are using Docker, build, run, and enter a Docker container for
development. This container mounts this repository's top-level at `/work`.

```
cd hacking/docker && make run && make exec
```

Inside the container at the repository's top-level directory, build and simulate a simple seL4-based
system with a [root task](./crates/examples/root-task/example-root-task) written in Rust (this will
take a few minutes):
At this repository's top-level directory, build and simulate a simple seL4-based
system with a [root task](./crates/examples/root-task/example-root-task) written
in Rust (this will take a few minutes):

```
make example
```

Also inside the container at the repository's top-level directory, build and run all of this
repository's automated tests:
Build and run all of this repository's automated tests:

```
make run-tests
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions hacking/binary-cache/fragment.nix.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright 2023, Colias Group, LLC
#
# SPDX-License-Identifier: BSD-2-Clause
#

extra-substituters = https://coliasgroup.cachix.org
extra-trusted-public-keys = coliasgroup.cachix.org-1:vYRVaHS5FCjsGmVVXlzF5LaIWjeEK17W+MHxK886zIE=

0 comments on commit c5ee3a5

Please sign in to comment.