aspec: reintroduce spec document version information

Including version information in the spec document is tricky, because
Isabelle will rebuild the session whenever it sees that session inputs
(including document sources) have changed. Since ASpec is close to the
root of our session hierarchy, frequently changing version information
causes excessive rebuilds during development.

This commit avoids excessive rebuilding by building the document (with
version information) in a separate ASpecDoc session. The ASpecDoc
session is identical to the previous version of the ASpec session, but
is not the parent of any other sessions. The ASpec session is used as
the basis for other sessions, but has document-only inputs removed, and
also has document builds disabled.
This commit is contained in:
Matthew Brecknell 2018-02-19 14:49:17 +11:00
parent 6e74fa1ae3
commit 3abbdd74a3
9 changed files with 41 additions and 9 deletions

View File

@ -48,6 +48,8 @@ internal/*
**/licenses
**/CONTRIBUTORS
spec/abstract/document/*/ARCH.tex
spec/abstract/document/gitrev.tex
spec/haskell/cabal.sandbox.config
spec/haskell/.cabal-sandbox/*

View File

@ -27,7 +27,7 @@ report-regression:
#
# Spec heaps.
HEAPS += ASpec ExecSpec DSpec CKernel CSpec TakeGrant ASepSpec
HEAPS += ASpec ASpecDoc ExecSpec DSpec CKernel CSpec TakeGrant ASepSpec
# Additional dependencies
@ -35,13 +35,22 @@ CKernel CSpec: c-kernel design-spec
# NOTE: The abstract spec imports Events from Haskell hence the dependency
ExecSpec DSpec : design-spec
ASpec ExecSpec DSpec : design-spec
ASpec: design-spec abstract/document/VERSION
ASPEC_DOC_GITREV_FILE=abstract/document/gitrev.tex
ASPEC_DOC_VERSION_FILE=abstract/document/VERSION
abstract/document/VERSION: $(SEL4_VERSION)
ASpecDoc: design-spec $(ASPEC_DOC_VERSION_FILE) $(ASPEC_DOC_GITREV_FILE)
$(ASPEC_DOC_VERSION_FILE): $(SEL4_VERSION)
cp $< $@
$(ASPEC_DOC_GITREV_FILE): .FORCE
git rev-parse --short=15 HEAD > $@ || echo unknown > $@
git diff --no-ext-diff --quiet || echo "*" >> $@
git diff --no-ext-diff --quiet --cached || echo "+" >> $@
perl -p -i -e "s/\n//" $@
# NOTE: the install_C_file in Kernel_C.thy invocation generates a spurious
# umm_types.txt file in this folder. This file is never used nor
# depended on.

View File

@ -30,7 +30,16 @@ chapter "Specifications"
* Abstract Specification
*)
(* Session on which most other sessions build. *)
session ASpec in "abstract" = Word_Lib +
options [document=false]
theories
"Syscall_A"
(* We build the abstract specification document in a separate session,
to avoid rebuilding ASpec (and every session that depends on it)
whenever the git commit ID changes. *)
session ASpecDoc in "abstract" = Word_Lib +
options [document=pdf]
theories [document = false]
"../../lib/Lib"
@ -47,7 +56,8 @@ session ASpec in "abstract" = Word_Lib +
"Glossary_Doc"
(* "KernelInit_A" *)
document_files
"VERSION" (* generated by `make ASpec` *)
"VERSION" (* generated by `make ASpec` *)
"gitrev.tex" (* generated by `make ASpec` *)
"root.tex"
"root.bib"
"defs.bib"
@ -58,6 +68,8 @@ session ASpec in "abstract" = Word_Lib +
"imgs/sel4objects_01.pdf"
"imgs/sel4objects_05.pdf"
"imgs/sel4_internals_01.pdf"
document_files (in "document/$L4V_ARCH")
"ARCH.tex"
(*
* Executable/Design Specification

View File

@ -1 +1,2 @@
/VERSION
/gitrev.tex

View File

@ -0,0 +1 @@
ARM

View File

@ -0,0 +1 @@
ARM\_HYP

View File

@ -0,0 +1 @@
X64

View File

@ -58,11 +58,13 @@
\isabellestyle{tt}
\newcommand{\version}{\input{VERSION}\xspace}
\newcommand{\arch}{\input{ARCH}\xspace}
\newcommand{\gitrev}{\input{gitrev}\xspace}
\hypersetup
{
pdfauthor={Trustworthy Systems, Data61},
pdftitle={Abstract Formal Specification of the seL4 API}
pdftitle={Abstract Formal Specification of the seL4/\arch API}
}
\renewcommand{\isamarkupchapter}[1]{\chapter{#1}}
@ -91,7 +93,7 @@
\begin{document}
\title{Abstract Formal Specification of the seL4 API}
\title{Abstract Formal Specification of the seL4/\arch API}
\date{Version \version}
@ -130,7 +132,9 @@ Simon Winwood
\bigskip
Document build date: \today
Architecture: \arch\\
Document build date: \today\\
Produced from git change set: \gitrev
\clearpage
@ -138,7 +142,7 @@ Document build date: \today
This document is the text version of the abstract, formal
Isabelle/HOL specification of the seL4 microkernel. It is
intended to give a precise, operational definition of the
seL4 microkernel.
seL4 microkernel on the \arch architecture.
The document contains a short overview, followed by
text generated from the formal Isabelle/HOL definitions.

View File

@ -27,6 +27,7 @@
<set depends="isabelle">
<!-- Various seL4 specifications. -->
<test name="ASpec" depends="haskell-translator">make ASpec</test>
<test name="ASpecDoc" depends="ASpec">make ASpecDoc</test>
<test name="ExecSpec" depends="haskell-translator">make ExecSpec</test>
<test name="DSpec" depends="haskell-translator">make DSpec</test>
<test name="TakeGrant">make TakeGrant</test>