Skip to content

Commit 821c4d7

Browse files
committed
Add Docker file
1 parent 1296606 commit 821c4d7

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44

55
## Install dependencies
66

7-
- llvm-9
8-
- llvm-9-tools
7+
If you want to install Sys locally:
8+
9+
- llvm-9, llvm-9-tools
910
- [boolector](https://github.com/Boolector/boolector) configured with
1011
`--shared` option. See the `build()` and `package()` functions in [this
1112
file](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=boolector-git)
1213
as an example of how to install boolector after you clone it.
14+
On Arch Linux, you can just install `boolector-git` from AUR.
1315
- The Haskell tool [Stack](https://docs.haskellstack.org/en/stable/README/)
1416

17+
Alternatively, you can use the [Dockerfile](community/Dockerfile) from Ralf-Philipp Weinmann.
18+
1519
## Build project
1620

1721
Once you have all the dependencies installed you should be able to just build the tool:
@@ -93,6 +97,12 @@ path-to-file
9397

9498
If you inspect the [serial_read_mp_array()](./test/Bugs/Uninit/Firefox/serial.ll-O2_p#L1528) function, the buggy block path is `%4` (the first block) to `%71`,where we use [`%73`].
9599

100+
# Help
101+
102+
We haven't tested (and likely won't test) Sys on anything but Arch Linux. We're
103+
happy to integrate patches that add support for other OSes and build systems
104+
though!
105+
96106
# Directory structure
97107

98108
```
@@ -104,5 +114,6 @@ If you inspect the [serial_read_mp_array()](./test/Bugs/Uninit/Firefox/serial.ll
104114
│   ├── InternalIR -- Internal IR used to represent paths for both static and symex
105115
│   ├── Static -- Static checker DSL
106116
│   └── Symex -- Symbolic DSL and execution engine
117+
├── community -- Community files
107118
└── test -- Tests
108119
```

community/Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Debian 10 requires LLVM 9 to be installed from source (no package, no backport),
2+
# hence we use Debian 11 (testing) for now (to be released in 2021).
3+
FROM debian:bullseye
4+
MAINTAINER Ralf-Philipp Weinmann <ralf@comsecuris.com>
5+
6+
RUN apt-get update && apt-get upgrade -y && \
7+
apt-get install -y apt-utils build-essential sudo screen tmux
8+
9+
# Add user
10+
RUN useradd -c 'User' -G sudo -s /bin/bash -m -g users user
11+
12+
# Don't require password for sudo
13+
RUN perl -i -pe 's/(%sudo.*) ALL/\1 NOPASSWD: ALL/' /etc/sudoers
14+
15+
# Install packages required to build boolector and sys
16+
RUN apt-get install -y llvm-9 haskell-stack git cmake curl
17+
18+
USER user
19+
WORKDIR /home/user
20+
RUN mkdir src
21+
WORKDIR src
22+
RUN git clone https://github.com/Boolector/btor2tools.git
23+
RUN git clone https://github.com/Boolector/boolector.git
24+
RUN git clone https://github.com/PLSysSec/sys.git
25+
26+
WORKDIR btor2tools
27+
RUN ./configure.sh && (cd build; make)
28+
RUN sudo cp build/lib/libbtor2parser.so /usr/lib/ && \
29+
sudo mkdir /usr/include/btor2parser && \
30+
sudo cp src/btor2parser/btor2parser.h /usr/include/btor2parser/
31+
WORKDIR ../boolector
32+
RUN ./contrib/setup-lingeling.sh && ./configure.sh --shared --prefix /usr
33+
RUN cd build && make && sudo make install
34+
WORKDIR ../sys
35+
RUN stack build

community/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory hosts files and tools maintained by the community.

0 commit comments

Comments
 (0)