Skip to content

Commit cbdf732

Browse files
authored
uses dune as the main build system (#1565)
Switches to dune as the main build system but keeps support for OASIS with ocamlbuild and omake backends. The implementation utilizes the dune sites and plugins system, but it still supports plugins that are built with bapbuild. To ease the transition, the OASIS-built BAP is also able to load dune plugins. Later the OASIS build system will be removed from BAP but the support for bundled with bapbuild plugins will remain. Since dune sites impose their own restrictions we had to introduce a new bap-common package that manages all the sites, starting from plugins and ending with semantic files.
1 parent f995d28 commit cbdf732

File tree

546 files changed

+9697
-2880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

546 files changed

+9697
-2880
lines changed

.github/workflows/build-and-test.yml

-88
This file was deleted.

.github/workflows/build-dev-repo.yml

-66
This file was deleted.

.github/workflows/full.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# tests all packages, including bap-extra
2+
# it requires ghidra, so it works only on ubuntu-20.04
3+
name: full
4+
run-name: Testing everything in ${{ github.ref }}
5+
6+
on:
7+
- pull_request
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
env:
13+
BAP_LOG_DIR: $HOME/log
14+
OPAMRETRES: 8
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Install Ghidra and Dejagnu
21+
run: |
22+
sudo add-apt-repository ppa:ivg/ghidra -y
23+
sudo apt-get update -y
24+
sudo apt-get install libghidra-dev -y
25+
sudo apt-get install libghidra-data -y
26+
sudo apt-get install dejagnu -y
27+
28+
- name: Install OCaml
29+
uses: ocaml/setup-ocaml@v2
30+
with:
31+
ocaml-compiler: 4.14.x
32+
dune-cache: true
33+
opam-disable-sandboxing: true
34+
35+
- name: Install BAP
36+
run: opam install . --with-test
37+
38+
- name: Run Functional Tests
39+
run: opam exec -- make check
40+
41+
- uses: actions/upload-artifact@v2
42+
if: ${{ always() }}
43+
with:
44+
name: bap-log
45+
path: ~/.local/state/bap
46+
47+
- uses: actions/upload-artifact@v2
48+
if: ${{ always() }}
49+
with:
50+
name: fun-tests-log
51+
path: |
52+
testsuite/*.log
53+
testsuite/logs

.github/workflows/check-the-style.yml renamed to .github/workflows/lint.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: check-the-style
1+
name: lint
2+
run-name: Linting ${{ github.ref }}
23

34
on:
45
- pull_request
56

67
jobs:
7-
build:
8+
check:
89
runs-on: ubuntu-latest
910

1011
env:
@@ -18,7 +19,9 @@ jobs:
1819
- name: Setup OCaml
1920
uses: ocaml/setup-ocaml@v2
2021
with:
21-
ocaml-compiler: 4.08.x
22+
ocaml-compiler: 4.14.x
23+
opam-pin: false
24+
opam-depext: false
2225
dune-cache: true
2326

2427
- name: Check the Style

.github/workflows/main.yml

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: main
2+
run-name: Testing main packages in ${{ github.ref }}
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
build:
8+
strategy:
9+
matrix:
10+
os:
11+
- ubuntu-20.04
12+
- macos-11
13+
ocaml-compiler:
14+
- 4.08.x
15+
- 4.14.x
16+
exclude:
17+
- os: macos-11
18+
ocaml-compiler: 4.08.x
19+
20+
21+
runs-on: ${{ matrix.os }}
22+
continue-on-error: ${{ matrix.os == 'macos-11'}}
23+
24+
env:
25+
TMPDIR: /tmp
26+
XDG_CACHE_HOME: /tmp/cache
27+
BAP_LOG_DIR: /tmp/bap-log
28+
OPAMJOBS: 2
29+
OPAMRETRES: 8
30+
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v2
34+
35+
- name: Prepare Ubuntu
36+
if: matrix.os == 'ubuntu-20.04'
37+
run: |
38+
sudo apt-get update -y
39+
sudo apt-get install dejagnu -y
40+
41+
- name: Prepare macOS
42+
if: matrix.os == 'macos-11'
43+
run: |
44+
echo 'LLVM_CONFIG=/usr/local/opt/llvm@9/bin/llvm-config' >> $GITHUB_ENV
45+
brew install deja-gnu
46+
47+
- name: Install OCaml
48+
uses: ocaml/setup-ocaml@v2
49+
with:
50+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
51+
dune-cache: ${{ matrix.os != 'macos-11' }}
52+
opam-disable-sandboxing: true
53+
opam-local-packages: |
54+
*.opam
55+
!bap-extra.opam
56+
!bap-radare2.opam
57+
!bap-ghidra.opam
58+
!bap-primus-symbolic-executor.opam
59+
!bap-ida.opam
60+
opam-repositories: |
61+
default: git+https://github.com/ocaml/opam-repository.git
62+
bap: git+https://github.com/BinaryAnalysisPlatform/opam-repository#testing
63+
64+
- name: Build BAP
65+
run: opam install bap.dev --with-test
66+
67+
- name: Run MC Functional Tests
68+
run: |
69+
opam exec -- make TOOLS=mc check
70+
71+
- uses: actions/upload-artifact@v2
72+
if: ${{ always() }}
73+
with:
74+
name: bap-log
75+
path: ~/.local/state/bap
76+
77+
- uses: actions/upload-artifact@v2
78+
if: ${{ always() }}
79+
with:
80+
name: unit-tests-log
81+
path: _build/default/lib_test/*/oUnit-*.log
82+
83+
- uses: actions/upload-artifact@v2
84+
if: ${{ always() }}
85+
with:
86+
name: fun-tests-log
87+
path: |
88+
testsuite/*.log
89+
testsuite/logs

.github/workflows/nightly-testing.yml renamed to .github/workflows/nightly.yml

+15-26
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: nightly-regression-tests
1+
name: nightly
2+
run-name: Running nightly tests on ${{ github.sha }}
23

34
on:
45
schedule:
@@ -10,9 +11,9 @@ jobs:
1011
strategy:
1112
matrix:
1213
os:
13-
- ubuntu-18.04
14+
- ubuntu-20.04
1415
ocaml-compiler:
15-
- 4.11.x
16+
- 4.14.x
1617
- 4.08.x
1718

1819
runs-on: ${{ matrix.os }}
@@ -22,29 +23,22 @@ jobs:
2223
OPAMRETRES: 8
2324

2425
steps:
25-
- name: Use OCaml ${{ matrix.ocaml-compiler }}
26-
uses: ocaml/setup-ocaml@master
27-
with:
28-
ocaml-compiler: ${{ matrix.ocaml-compiler }}
29-
dune-cache: true
30-
cache-prefix: nightly
31-
32-
- name: Install Ghidra
26+
- name: Install Extra System Dependencies
3327
run: |
3428
sudo add-apt-repository ppa:ivg/ghidra -y
3529
sudo apt-get install libghidra-dev -y
3630
sudo apt-get install libghidra-data -y
31+
sudo apt-get install dejagnu -y
3732
38-
- name: Add the Testing Repository
39-
run: opam repo add bap git+https://github.com/BinaryAnalysisPlatform/opam-repository#testing
40-
- name: Install System Dependencies
41-
run: opam depext -u bap-extra
42-
43-
- name: Install radare2 Dependencies
44-
run: opam depext -u bap-radare2
45-
46-
- name: Cleanup the Caches
47-
run: sudo apt clean --yes
33+
- name: Use OCaml ${{ matrix.ocaml-compiler }}
34+
uses: ocaml/setup-ocaml@v2
35+
with:
36+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
37+
dune-cache: ${{ matrix.os != 'macos-11' }}
38+
opam-disable-sandboxing: true
39+
opam-repositories: |
40+
default: git+https://github.com/ocaml/opam-repository.git
41+
bap: git+https://github.com/BinaryAnalysisPlatform/opam-repository#testing
4842
4943
- name: Build and Install BAP
5044
run: opam install bap-extra bap-radare2
@@ -54,11 +48,6 @@ jobs:
5448
with:
5549
repository: BinaryAnalysisPlatform/bap
5650

57-
- name: Install Extra System Dependencies
58-
run: |
59-
opam pin add bap . -n
60-
opam depext -u bap
61-
6251
- name: Run Functional Tests
6352
run: opam exec -- make check
6453

0 commit comments

Comments
 (0)