Skip to content

Commit 3b602fa

Browse files
committed
Merge branch 'master' into compilation-database
2 parents 039f72d + 77048c0 commit 3b602fa

File tree

26 files changed

+247
-52
lines changed

26 files changed

+247
-52
lines changed

.devcontainer/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ RUN rm ~/.gitconfig
1111

1212
# otherwise perl (not ruby!) complains during regression testing
1313
ENV LC_ALL=C.UTF-8
14+
15+
# update local opam repository because base image may be outdated
16+
RUN cd /home/opam/opam-repository \
17+
&& git pull origin master \
18+
&& opam update

.github/workflows/docker.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
name: docker
22

33
on:
4-
# not on push or pull_request
5-
workflow_dispatch:
6-
74
schedule:
85
# nightly
96
- cron: '31 1 * * *' # 01:31 UTC, 02:31/03:31 Munich, 03:31/04:31 Tartu
107
# GitHub Actions load is high at minute 0, so avoid that
118

9+
push:
10+
# not on push branch
11+
tags:
12+
- '**'
13+
14+
workflow_dispatch:
15+
inputs:
16+
tag:
17+
description: Docker tag
18+
required: true
19+
default: latest
20+
1221
env:
1322
REGISTRY: ghcr.io
1423
IMAGE_NAME: ${{ github.repository }}
@@ -28,6 +37,9 @@ jobs:
2837
- name: Checkout code
2938
uses: actions/checkout@v2
3039

40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v1 # needed for GitHub Actions Cache in build-push-action
42+
3143
- name: Log in to the Container registry
3244
uses: docker/login-action@v1
3345
with:
@@ -41,18 +53,23 @@ jobs:
4153
with:
4254
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4355
tags: |
44-
type=raw,value=latest
56+
type=schedule
57+
type=ref,event=tag
58+
type=raw,enable=${{ github.event_name == 'workflow_dispatch' }},value=${{ github.event.inputs.tag }}
4559
4660
- name: Build Docker image
61+
id: build
4762
uses: docker/build-push-action@v2
4863
with:
4964
context: .
5065
load: true # load into docker instead of immediately pushing
5166
tags: ${{ steps.meta.outputs.tags }}
5267
labels: ${{ steps.meta.outputs.labels }}
68+
cache-from: type=gha
69+
cache-to: type=gha,mode=max # max mode caches all layers for multi-stage image
5370

5471
- name: Check Docker image
55-
run: docker run --rm -v $(pwd):/data ${{ steps.meta.outputs.tags }} /data/tests/regression/04-mutex/01-simple_rc.c # TODO: breaks if multiple tags?
72+
run: docker run --rm -v $(pwd):/data ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }} /data/tests/regression/04-mutex/01-simple_rc.c # run image by version in case multiple tags
5673

5774
- name: Push Docker image
5875
uses: docker/build-push-action@v2

.github/workflows/semgrep.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
semgrep:
1212
runs-on: ubuntu-latest
1313

14+
continue-on-error: true # TODO: remove when semgrep fixed: https://github.com/returntocorp/semgrep-action/issues/429
15+
1416
steps:
1517
- name: Checkout code
1618
uses: actions/checkout@v2
@@ -21,6 +23,8 @@ jobs:
2123
config: >-
2224
.semgrep/
2325
generateSarif: "1"
26+
env:
27+
SEMGREP_AGENT_DEBUG: 1 # https://github.com/returntocorp/semgrep-action/issues/429
2428

2529
- name: Upload SARIF file to GitHub Advanced Security Dashboard
2630
uses: github/codeql-action/upload-sarif@v1

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ WORKDIR /home/opam/analyzer/
99
# TODO: use opam depext
1010
RUN sudo apt-get update \
1111
&& sudo apt-get install -y libgmp-dev libmpfr-dev
12+
# update local opam repository because base image may be outdated
13+
RUN cd /home/opam/opam-repository \
14+
&& git pull origin master \
15+
&& opam update
1216
RUN make setup
1317
# copy the rest
1418
COPY --chown=opam . /home/opam/analyzer

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _The [goblint package on opam](https://opam.ocaml.org/packages/goblint/) is very
2828

2929
### Other
3030
* **[devcontainer](./.devcontainer/).** Select "Reopen in Container" in VS Code and continue with `make` using Linux instructions in devcontainer.
31-
* **[Docker (GitHub Container Registry)](https://github.com/goblint/analyzer/pkgs/container/analyzer)**. Run `docker pull ghcr.io/goblint/analyzer:latest`.
31+
* **[Docker (GitHub Container Registry)](https://github.com/goblint/analyzer/pkgs/container/analyzer)**. Run `docker pull ghcr.io/goblint/analyzer:latest` (or `:nightly`).
3232
* **Docker (repository).** Clone and run `docker build -t goblint .`.
3333
* **Vagrant.** Clone and run `vagrant up && vagrant ssh`.
3434
* **[opam](https://opam.ocaml.org/packages/goblint/)** (very outdated). Run `opam install goblint`.
@@ -47,6 +47,6 @@ To confirm that the Docker container worked, you can try running Goblint as foll
4747
```
4848
docker run -it --rm -v $(pwd):/data goblint /data/tests/regression/04-mutex/01-simple_rc.c
4949
```
50-
If pulled from GitHub Container Registry, use the container name `ghcr.io/goblint/analyzer:latest` instead.
50+
If pulled from GitHub Container Registry, use the container name `ghcr.io/goblint/analyzer:latest` (or `:nightly`) instead.
5151

5252
For further information, see [documentation](https://goblint.readthedocs.io/en/latest/user-guide/running/).

bench/deriving/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(executable
22
(name benchEq)
3-
(optional) ; TODO: for some reason this doesn't work: `dune build` still tries to compile if benchmark missing
3+
(optional) ; TODO: for some reason this doesn't work: `dune build` still tries to compile if benchmark missing (https://github.com/ocaml/dune/issues/4065)
44
(libraries benchmark batteries.unthreaded)
55
(preprocess (staged_pps ppx_deriving.std)))

dune-project

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
(depends
2525
(ocaml (>= 4.09))
2626
dune
27-
zarith_stubs_js ; only needed for js_of_ocaml
28-
goblint-cil ; TODO no way to define as pin-depends? Used goblint.opam.template to add it for now. https://github.com/ocaml/dune/issues/3231. Alternatively, removing this line and adding cil as a git submodule and `(vendored_dirs cil)` as ./dune also works. This way, no more need to reinstall the pinned cil opam package on changes. However, then cil is cleaned and has to be rebuild together with goblint.
27+
(goblint-cil (>= 1.8.2)) ; TODO no way to define as pin-depends? Used goblint.opam.template to add it for now. https://github.com/ocaml/dune/issues/3231. Alternatively, removing this line and adding cil as a git submodule and `(vendored_dirs cil)` as ./dune also works. This way, no more need to reinstall the pinned cil opam package on changes. However, then cil is cleaned and has to be rebuild together with goblint.
2928
(batteries (>= 3.2.0))
3029
qcheck-core
3130
(ppx_distr_guards (>= 0.2))
@@ -36,7 +35,7 @@
3635
(odoc :with-doc)
3736
dune-site
3837
sha
39-
benchmark ; TODO: make this optional somehow, (optional) on bench executable doesn't work
38+
(benchmark :with-test) ; TODO: make this optional somehow, (optional) on bench executable doesn't work
4039
; TODO still need the following after switch to dune?
4140
ocamlbuild
4241
ocamlfind

goblint.opam

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ bug-reports: "https://github.com/goblint/analyzer/issues"
2121
depends: [
2222
"ocaml" {>= "4.09"}
2323
"dune" {>= "2.8"}
24-
"zarith_stubs_js"
25-
"goblint-cil"
24+
"goblint-cil" {>= "1.8.2"}
2625
"batteries" {>= "3.2.0"}
2726
"qcheck-core"
2827
"ppx_distr_guards" {>= "0.2"}
@@ -33,7 +32,7 @@ depends: [
3332
"odoc" {with-doc}
3433
"dune-site"
3534
"sha"
36-
"benchmark"
35+
"benchmark" {with-test}
3736
"ocamlbuild"
3837
"ocamlfind"
3938
]
@@ -56,7 +55,8 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
5655
# on `dune build` goblint.opam will be generated from goblint.opam.template and dune-project
5756
# also remember to generate/adjust goblint.opam.locked!
5857
pin-depends: [
59-
[ "goblint-cil.1.8.1" "git+https://github.com/goblint/cil.git#c16dddf74f6053a8b3fac07ca2feff18d4d56964" ]
58+
# the published goblint-cil 1.8.2 is currently up-to-date, so no pin needed
59+
# [ "goblint-cil.1.8.1" "git+https://github.com/goblint/cil.git#c16dddf74f6053a8b3fac07ca2feff18d4d56964" ]
6060
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
6161
[ "ppx_deriving_yojson.3.6.1" "git+https://github.com/ocaml-ppx/ppx_deriving_yojson.git#e030f13a3450e9cf7d2c43fa04e709ef608486cd" ]
6262
[ "zarith.1.12-gob0" "git+https://github.com/goblint/Zarith.git#goblint-release-1.12" ]

goblint.opam.locked

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ depends: [
2424
"base-threads" {= "base"}
2525
"base-unix" {= "base"}
2626
"batteries" {= "3.3.0"}
27-
"benchmark" {= "1.6"}
27+
"benchmark" {= "1.6" & with-test}
2828
"biniou" {= "1.2.1"}
2929
"camlidl" {= "1.09"}
3030
"conf-gmp" {= "3"}
@@ -35,7 +35,7 @@ depends: [
3535
"dune-private-libs" {= "2.9.1"}
3636
"dune-site" {= "2.9.1"}
3737
"easy-format" {= "1.3.2"}
38-
"goblint-cil" {= "1.8.1"}
38+
"goblint-cil" {= "1.8.2"}
3939
"mlgmpidl" {= "1.2.13"}
4040
"num" {= "1.4"}
4141
"ocaml" {= "4.12.0"}
@@ -59,7 +59,6 @@ depends: [
5959
"stdlib-shims" {= "0.3.0"}
6060
"yojson" {= "1.7.0"}
6161
"zarith" {= "1.12-gob0"}
62-
"zarith_stubs_js" {= "v0.14.0"}
6362
]
6463
build: [
6564
["dune" "subst"] {dev}
@@ -79,10 +78,6 @@ dev-repo: "git+https://github.com/goblint/analyzer.git"
7978
# on `dune build` goblint.opam will be generated from goblint.opam.template and dune-project
8079
# also remember to generate/adjust goblint.opam.locked!
8180
pin-depends: [
82-
[
83-
"goblint-cil.1.8.1"
84-
"git+https://github.com/goblint/cil.git#c16dddf74f6053a8b3fac07ca2feff18d4d56964"
85-
]
8681
[
8782
"apron.v0.9.13"
8883
"git+https://github.com/antoinemine/apron.git#c852ebcc89e5cf4a5a3318e7c13c73e1756abb11"

goblint.opam.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# on `dune build` goblint.opam will be generated from goblint.opam.template and dune-project
22
# also remember to generate/adjust goblint.opam.locked!
33
pin-depends: [
4-
[ "goblint-cil.1.8.1" "git+https://github.com/goblint/cil.git#c16dddf74f6053a8b3fac07ca2feff18d4d56964" ]
4+
# the published goblint-cil 1.8.2 is currently up-to-date, so no pin needed
5+
# [ "goblint-cil.1.8.1" "git+https://github.com/goblint/cil.git#c16dddf74f6053a8b3fac07ca2feff18d4d56964" ]
56
[ "ppx_deriving.5.2.1" "git+https://github.com/ocaml-ppx/ppx_deriving.git#0a89b619f94cbbfc3b0fb3255ab4fe5bc77d32d6" ]
67
[ "ppx_deriving_yojson.3.6.1" "git+https://github.com/ocaml-ppx/ppx_deriving_yojson.git#e030f13a3450e9cf7d2c43fa04e709ef608486cd" ]
78
[ "zarith.1.12-gob0" "git+https://github.com/goblint/Zarith.git#goblint-release-1.12" ]

0 commit comments

Comments
 (0)