Skip to content

Commit

Permalink
uses dune as the main build system
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ivg committed Jan 9, 2023
1 parent 79fd1a2 commit 2e4839d
Show file tree
Hide file tree
Showing 544 changed files with 9,648 additions and 2,865 deletions.
88 changes: 0 additions & 88 deletions .github/workflows/build-and-test.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/build-dev-repo.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# tests all packages, including bap-extra
# it requires ghidra, so it works only on ubuntu-20.04
name: full
run-name: Testing everything in ${{ github.ref }}

on:
- pull_request

jobs:
build:
runs-on: ubuntu-20.04
env:
BAP_LOG_DIR: $HOME/log
OPAMRETRES: 8

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Ghidra and Dejagnu
run: |
sudo add-apt-repository ppa:ivg/ghidra -y
sudo apt-get update -y
sudo apt-get install libghidra-dev -y
sudo apt-get install libghidra-data -y
sudo apt-get install dejagnu -y
- name: Install OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
dune-cache: true
opam-disable-sandboxing: true

- name: Install BAP
run: opam install . --with-test

- name: Run Functional Tests
run: opam exec -- make check

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: bap-log
path: ~/.local/state/bap

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: fun-tests-log
path: |
testsuite/*.log
testsuite/logs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: check-the-style
name: lint
run-name: Linting ${{ github.ref }}

on:
- pull_request

jobs:
build:
check:
runs-on: ubuntu-latest

env:
Expand All @@ -18,7 +19,9 @@ jobs:
- name: Setup OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.08.x
ocaml-compiler: 4.14.x
opam-pin: false
opam-depext: false
dune-cache: true

- name: Check the Style
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: main
run-name: Testing main packages in ${{ github.ref }}
on:
- pull_request

jobs:
build:
strategy:
matrix:
os:
- ubuntu-20.04
- macos-11
ocaml-compiler:
- 4.08.x
- 4.14.x
exclude:
- os: macos-11
ocaml-compiler: 4.08.x


runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.os == 'macos-11'}}

env:
TMPDIR: /tmp
XDG_CACHE_HOME: /tmp/cache
BAP_LOG_DIR: /tmp/bap-log
OPAMJOBS: 2
OPAMRETRES: 8

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Prepare Ubuntu
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update -y
sudo apt-get install dejagnu -y
- name: Prepare macOS
if: matrix.os == 'macos-11'
run: |
echo 'LLVM_CONFIG=/usr/local/opt/llvm@9/bin/llvm-config' >> $GITHUB_ENV
brew install deja-gnu
- name: Install OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-11' }}
opam-disable-sandboxing: true
opam-local-packages: |
*.opam
!bap-extra.opam
!bap-radare2.opam
!bap-ghidra.opam
!bap-primus-symbolic-executor.opam
!bap-ida.opam
opam-repositories: |
default: git+https://github.com/ocaml/opam-repository.git
bap: git+https://github.com/BinaryAnalysisPlatform/opam-repository#testing
- name: Build BAP
run: opam install bap.dev --with-test

- name: Run MC Functional Tests
run: |
opam exec -- make TOOLS=mc check
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: bap-log
path: ~/.local/state/bap

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: unit-tests-log
path: _build/default/lib_test/*/oUnit-*.log

- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: fun-tests-log
path: |
testsuite/*.log
testsuite/logs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: nightly-regression-tests
name: nightly
run-name: Running nightly tests on ${{ github.sha }}

on:
schedule:
Expand All @@ -10,9 +11,9 @@ jobs:
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
ocaml-compiler:
- 4.11.x
- 4.14.x
- 4.08.x

runs-on: ${{ matrix.os }}
Expand All @@ -22,29 +23,22 @@ jobs:
OPAMRETRES: 8

steps:
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@master
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
cache-prefix: nightly

- name: Install Ghidra
- name: Install Extra System Dependencies
run: |
sudo add-apt-repository ppa:ivg/ghidra -y
sudo apt-get install libghidra-dev -y
sudo apt-get install libghidra-data -y
sudo apt-get install dejagnu -y
- name: Add the Testing Repository
run: opam repo add bap git+https://github.com/BinaryAnalysisPlatform/opam-repository#testing
- name: Install System Dependencies
run: opam depext -u bap-extra

- name: Install radare2 Dependencies
run: opam depext -u bap-radare2

- name: Cleanup the Caches
run: sudo apt clean --yes
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-11' }}
opam-disable-sandboxing: true
opam-repositories: |
default: git+https://github.com/ocaml/opam-repository.git
bap: git+https://github.com/BinaryAnalysisPlatform/opam-repository#testing
- name: Build and Install BAP
run: opam install bap-extra bap-radare2
Expand All @@ -54,11 +48,6 @@ jobs:
with:
repository: BinaryAnalysisPlatform/bap

- name: Install Extra System Dependencies
run: |
opam pin add bap . -n
opam depext -u bap
- name: Run Functional Tests
run: opam exec -- make check

Expand Down
Loading

0 comments on commit 2e4839d

Please sign in to comment.