Reshuffle rust tutorial build

- install microkit and seL4 env for tutorial build from Makefile
- improve jekyll build time by moving rust tutorial out of jekyll tree

The tutorial build for Rust is too large to handle through Jekyll
(build time goes up by a factor of 8), even though Jekyll only needs to
copy those files. Ignore these files in the Jekyll build and copy/rsync
them manually instead.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Gerwin Klein 2025-07-09 11:11:57 +10:00
parent 5989759c95
commit 72f7f88dca
No known key found for this signature in database
GPG Key ID: 20A847CE6AB7F5F3
3 changed files with 32 additions and 3 deletions

2
.gitignore vendored
View File

@ -7,11 +7,11 @@ _preview/
.sass-cache/
_repos/
projects/virtualization/docs/api/
projects/rust/tutorial
.jekyll-cache/
.npm_deps
vendor/
node_modules/
_processed/microkit-tutorial/
_processed/tutes/
_processed/rust/
_data/microkit_tutorial.yml

View File

@ -71,6 +71,23 @@ $(REPOSITORIES):
.PHONY: repos
repos: $(REPOSITORIES)
MICROKIT_VERSION=1.4.1
VENDOR_SEL4 = vendor/seL4
VENDOR_MICROKIT = vendor/microkit/sdk
.PHONY: sdk
sdk: $(VENDOR_SEL4) $(VENDOR_MICROKIT)
# it is fine to use the Linux version on Mac, we're not going to run any binaries
$(VENDOR_MICROKIT):
mkdir -p $@
curl -L https://github.com/seL4/microkit/releases/download/$(MICROKIT_VERSION)/microkit-sdk-$(MICROKIT_VERSION)-linux-x86-64.tar.gz | tar -xzf - -C $@ --strip-components=1
MK_BOARD = board/qemu_virt_aarch64/debug
$(VENDOR_SEL4): $(VENDOR_MICROKIT)
mkdir -p $@
ln -s ../../$</$(MK_BOARD)/ $@/libsel4
# Tutorials
TUTES_DST = _processed/tutes
@ -120,11 +137,15 @@ microkit-tutorial: $(MICROKIT_TUT_DST_FILES) _data/microkit_tutorial.yml
RUST_TUT_REPO = _repos/coliasgroup/sel4-rust-tutorial
RUST_TUT_BUILD = $(RUST_TUT_REPO)/book/build
RUST_TUT_DST = projects/rust/tutorial
RUST_TUT_DST = _processed/rust/tutorial
RUST_TUT_FINAL_DST = projects/rust/tutorial
.PHONY: rust-tutorial
rust-tutorial: $(RUST_TUT_REPO)
cd $(RUST_TUT_REPO) && make for-docsite
cd $(RUST_TUT_REPO) && \
SEL4_PREFIX="${CURDIR}/$(VENDOR_SEL4)" \
SEL4_INCLUDE_DIRS="${CURDIR}/$(VENDOR_MICROKIT)/$(MK_BOARD)/include" \
make for-docsite
rm -rf $(RUST_TUT_DST)
mkdir -p $(dir $(RUST_TUT_DST))
cp -rL $(RUST_TUT_BUILD) $(RUST_TUT_DST)
@ -227,6 +248,7 @@ docker_build:
# the connection; also works locally
.PHONY: serve
serve: generate
rsync -a $(RUST_TUT_DST) _site/$(RUST_TUT_FINAL_DST)
JEKYLL_ENV=$(JEKYLL_ENV) bundle exec jekyll serve
.PHONY: generate
@ -235,13 +257,17 @@ ifeq ($(JEKYLL_ENV),production)
$(MAKE) generate_data_files
endif
JEKYLL_OUT = _site
.PHONY: build
build: generate
rsync -a $(RUST_TUT_DST) $(JEKYLL_OUT)/$(RUST_TUT_FINAL_DST)
JEKYLL_ENV=$(JEKYLL_ENV) bundle exec jekyll build $(BUILD_OPTS)
.PHONY: preview
preview: JEKYLL_ENV := production
preview: BUILD_OPTS := --config "_config.yml,_preview.yml" $(BUILD_OPTS)
preview: JEKYLL_OUT := _preview
preview: build
.PHONY: clean

View File

@ -116,3 +116,6 @@ exclude:
- "**/*.license"
- .github/
- .reuse/
keep_files:
- projects/rust/tutorial