Skip to content

Commit

Permalink
Merge branch 'master' into uaf-analysis-first-iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Jul 7, 2023
2 parents 9545618 + d65ed54 commit ed9c998
Show file tree
Hide file tree
Showing 449 changed files with 9,661 additions and 3,812 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ ec8611a3a72ae0d95ec82ffee16c5c4785111aa1

# Set up end-of-line normalization.
78fd79e7f4d15c4412221b155971fac2e0616b90

# fix indentation in baseInvariant
f3ffd5e45c034574020f56519ccdb021da2a1479
92 changes: 92 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: coverage

on:
pull_request:

workflow_dispatch:

schedule:
# nightly
- cron: '31 1 * * *' # 01:31 UTC, 02:31/03:31 Munich, 03:31/04:31 Tartu
# GitHub Actions load is high at minute 0, so avoid that

jobs:
coverage:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- ocaml-variants.4.14.0+options,ocaml-option-flambda # matches opam lock file
# don't add any other because they won't be used

runs-on: ${{ matrix.os }}

env:
OCAMLRUNPARAM: b

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

- name: Set up OCaml ${{ matrix.ocaml-compiler }}
env:
# otherwise setup-ocaml pins non-locked dependencies
# https://github.com/ocaml/setup-ocaml/issues/166
OPAMLOCKED: locked
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install dependencies
run: opam install . --deps-only --locked --with-test

- name: Install coverage dependencies
run: opam install bisect_ppx

- name: Build
run: ./make.sh coverage

- name: Test regression
run: ./make.sh headers testci

- name: Test apron regression # skipped by default but CI has apron, so explicitly test group (which ignores skipping -- it's now a feature!)
run: |
ruby scripts/update_suite.rb group apron -s
ruby scripts/update_suite.rb group apron2 -s
- name: Test apron octagon regression # skipped by default but CI has apron, so explicitly test group (which ignores skipping -- it's now a feature!)
run: ruby scripts/update_suite.rb group octagon -s

- name: Test apron affeq regression # skipped by default but CI has apron, so explicitly test group (which ignores skipping -- it's now a feature!)
run: ruby scripts/update_suite.rb group affeq -s

- name: Test apron regression (Mukherjee et. al SAS '17 paper') # skipped by default but CI has apron, so explicitly test group (which ignores skipping -- it's now a feature!)
run: ruby scripts/update_suite.rb group apron-mukherjee -s

- name: Test regression cram
run: opam exec -- dune runtest tests/regression

- name: Test incremental cram
run: opam exec -- dune runtest tests/incremental

- name: Test unit
run: opam exec -- dune runtest unittest

- name: Test incremental regression
run: ruby scripts/update_suite.rb -i

- name: Test incremental regression with cfg comparison
run: ruby scripts/update_suite.rb -c

- run: opam exec -- bisect-ppx-report send-to Coveralls --coverage-path=.
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}

- uses: actions/upload-artifact@v3
if: always()
with:
name: suite_result
path: tests/suite_result/
68 changes: 68 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: docs

on:
push:
branches:
- master

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

jobs:
api-build:
strategy:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- ocaml-variants.4.14.0+options,ocaml-option-flambda # matches opam lock file
# don't add any other because they won't be used

runs-on: ${{ matrix.os }}

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

- name: Set up OCaml ${{ matrix.ocaml-compiler }}
env:
# otherwise setup-ocaml pins non-locked dependencies
# https://github.com/ocaml/setup-ocaml/issues/166
OPAMLOCKED: locked
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

- name: Install dependencies
run: opam install . --deps-only --locked --with-doc

- name: Build API docs
run: opam exec -- dune build @doc

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: _build/default/_doc/_html/

api-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: api-build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
28 changes: 9 additions & 19 deletions .github/workflows/indentation.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
name: indentation

on: [ push, pull_request]
on:
push:
pull_request:
workflow_dispatch:

jobs:
indentation:
strategy: # remove?
strategy:
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- 4.14.0 # setup-ocaml@v1 does not support 4.14.x for ocaml-version
- 4.14.x

runs-on: ${{ matrix.os }}

if: ${{ github.event.before != '0000000000000000000000000000000000000000' }}
if: ${{ !github.event.forced && github.event.before != '0000000000000000000000000000000000000000' }}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

# reuse tests.yml or depend on it to not have to setup OCaml? https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-using-an-action-in-the-same-repository-as-the-workflow

# rely on cache for now
- name: Cache opam switch # https://github.com/marketplace/actions/cache
uses: actions/cache@v3
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: |
~/.opam
_opam
# Key for restoring and saving the cache
key: opam-ocp-indent-${{ runner.os }}-${{ matrix.ocaml-compiler }}

- name: Set up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v1 # intentionally use v1 instead of v2 because it's faster with manual caching: https://github.com/goblint/analyzer/pull/308#issuecomment-887805857
uses: ocaml/setup-ocaml@v2
with:
ocaml-version: ${{ matrix.ocaml-compiler }}
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install ocp-indent
run: opam install -y ocp-indent
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/locked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
- name: Test regression cram
run: opam exec -- dune runtest tests/regression

- name: Test incremental cram
run: opam exec -- dune runtest tests/incremental

- name: Test unit
run: opam exec -- dune runtest unittest

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/unlocked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ jobs:
- name: Test regression cram
run: opam exec -- dune runtest tests/regression

- name: Test incremental cram
run: opam exec -- dune runtest tests/incremental

- name: Test unit
run: opam exec -- dune runtest unittest

Expand Down Expand Up @@ -179,6 +182,9 @@ jobs:
- name: Test regression cram
run: opam exec -- dune runtest tests/regression

- name: Test incremental cram
run: opam exec -- dune runtest tests/incremental

- name: Test unit
run: opam exec -- dune runtest unittest

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,10 @@ transformed.c

# docs
site/

# coverage

# bisect_ppx
*.coverage
# bisect-ppx-report
_coverage/*
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Goblint
[![locked workflow status](https://github.com/goblint/analyzer/actions/workflows/locked.yml/badge.svg)](https://github.com/goblint/analyzer/actions/workflows/locked.yml)
[![unlocked workflow status](https://github.com/goblint/analyzer/actions/workflows/unlocked.yml/badge.svg)](https://github.com/goblint/analyzer/actions/workflows/unlocked.yml)
[![docker workflow status](https://github.com/goblint/analyzer/actions/workflows/docker.yml/badge.svg)](https://github.com/goblint/analyzer/actions/workflows/docker.yml)
[![Documentation Status](https://readthedocs.org/projects/goblint/badge/?version=latest)](https://goblint.readthedocs.io/en/latest/?badge=latest)
[![GitHub release status](https://img.shields.io/github/v/release/goblint/analyzer)](https://github.com/goblint/analyzer/releases)
[![opam package status](https://badgen.net/opam/v/goblint)](https://opam.ocaml.org/packages/goblint)
[![Zenodo DOI](https://zenodo.org/badge/2066905.svg)](https://zenodo.org/badge/latestdoi/2066905)

[![locked workflow status](https://github.com/goblint/analyzer/actions/workflows/locked.yml/badge.svg)](https://github.com/goblint/analyzer/actions/workflows/locked.yml)
[![unlocked workflow status](https://github.com/goblint/analyzer/actions/workflows/unlocked.yml/badge.svg)](https://github.com/goblint/analyzer/actions/workflows/unlocked.yml)
[![Coverage Status](https://coveralls.io/repos/github/goblint/analyzer/badge.svg?branch=master)](https://coveralls.io/github/goblint/analyzer?branch=master)
[![docker workflow status](https://github.com/goblint/analyzer/actions/workflows/docker.yml/badge.svg)](https://github.com/goblint/analyzer/actions/workflows/docker.yml)
[![Documentation Status](https://readthedocs.org/projects/goblint/badge/?version=latest)](https://goblint.readthedocs.io/en/latest/?badge=latest)

Documentation can be browsed on [Read the Docs](https://goblint.readthedocs.io/en/latest/) or [GitHub](./docs/).

## Installing
Expand All @@ -18,6 +20,7 @@ Both for using an up-to-date version of Goblint or developing it, the best way i
3. Run `make setup` to install OCaml and dependencies via opam.
4. Run `make` to build Goblint itself.
5. Run `make install` to install Goblint into the opam switch for usage via switch's `PATH`.
6. _Optional:_ See [`scripts/bash-completion.sh`](./scripts/bash-completion.sh) for setting up bash completion for Goblint arguments.

### MacOS
1. Install GCC with `brew install gcc` (first run `xcode-select --install` if you don't want to build it from source). Goblint requires GCC while macOS's default `cpp` is Clang, which will not work.
Expand Down
4 changes: 3 additions & 1 deletion conf/incremental.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
"trace": {
"context": true
},
"debug": true,
"timing": {
"enabled": true
}
},
"warn": {
"debug": true
},
"result": "none",
"solver": "td3",
"solvers": {
Expand Down
4 changes: 3 additions & 1 deletion conf/minimal_incremental.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
"trace": {
"context": true
},
"debug": true,
"timing": {
"enabled": true
}
},
"warn": {
"debug": true
},
"result": "none",
"solver": "td3",
"solvers": {
Expand Down
3 changes: 2 additions & 1 deletion docs/developer-guide/firstanalysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This program is in the Goblint repository: `tests/regression/99-tutorials/01-fir
But if you run Goblint out of the box on this example, it will not work:

```console
./goblint --enable dbg.debug tests/regression/99-tutorials/01-first.c
./goblint --enable warn.debug tests/regression/99-tutorials/01-first.c
```

This will claim that the assertion in unknown.
Expand Down Expand Up @@ -69,6 +69,7 @@ There is no need to implement the transfer functions for branching for this exam
The assignment relies on the function `eval`, which is almost there. It just needs you to fix the evaluation of constants! Unless you jumped straight to this line, it should not be too complicated to fix this.
With this in place, we should have sufficient information to tell Goblint that the assertion does hold.

For more information on the signature of the individual transfer functions, please check out `module type Spec` documentation in [`src/framework/analyses.ml`](https://github.com/goblint/analyzer/blob/master/src/framework/analyses.ml).

## Extending the domain

Expand Down
Loading

0 comments on commit ed9c998

Please sign in to comment.