Skip to content

Commit

Permalink
fixed dockerfile builds (facebook#1734)
Browse files Browse the repository at this point in the history
Summary:
Building the docker images that compile infer from source under [master](https://github.com/facebook/infer/tree/main/docker/master) and [master-java](https://github.com/facebook/infer/tree/main/docker) currently result in compilation and execution failures.

The compilation error is due to a missing `sqlite3` apt dependency since the command is now used during the make process in `./infer/models/Makefile` line 68 `sqlite3 $(RESULTS_DB) $(SQL_DUMP_MODEL_SPECS) </dev/null`.

```
facebook#12 259.8 [*ERROR**][5483] bash: line 1: sqlite3: command not found
facebook#12 259.8 [*ERROR**][5483] make[2]: *** [Makefile:67: /infer/infer/lib/models.sql] Error 127
facebook#12 259.8 make[1]: *** [Makefile:437: infer_models] Error 2
facebook#12 259.8 make[1]: Leaving directory '/infer'
facebook#12 259.8 make: *** [Makefile:449: opt] Error 2
facebook#12 259.9
facebook#12 259.9   compilation failure; you can try running
facebook#12 259.9
facebook#12 259.9     make clean
facebook#12 259.9     './build-infer.sh' java
facebook#12 259.9
```

The build phase is performed by debian bullseye whereas execution is performed by debian buster (older libc) which results in the following error when attempting to execute:

```
root@4212e6b6b322:/home/wsl2/# infer --help
infer: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by infer)
infer: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /infer/lib/infer/infer/bin/../libso/libsqlite3.so.0)

root@4212e6b6b322:/home/wsl2/# ls /lib/x86_64-linux-gnu/libc
libc-2.28.so        libcap-ng.so.0      libcom_err.so.2     libcrypt-2.28.so                      libc.so.6           libcap-ng.so.0.0.0  libcom_err.so.2.1   libcrypt.so.1
```

----

The short fixes to the Dockerfiles have been tested on a WSL2 Ubuntu 20.04 host running docker desktop.

After making the changes, infer was built and run successfully using `docker build -t infer .`

Pull Request resolved: facebook#1734

Reviewed By: geralt-encore

Differential Revision: D43627784

Pulled By: jvillard

fbshipit-source-id: 55eb735020d5c55af478dbd45e342c4f4206c21d
  • Loading branch information
whoismissing authored and facebook-github-bot committed Feb 28, 2023
1 parent 159db3c commit 23f0aa3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docker/master-java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN apt-get update && \
libgmp-dev \
libmpfr-dev \
libsqlite3-dev \
sqlite3 \
make \
opam \
openjdk-11-jdk-headless \
Expand Down Expand Up @@ -53,7 +54,7 @@ RUN cd /infer && \
DESTDIR="/infer-release" \
libdir_relative_to_bindir="../lib"

FROM debian:buster-slim AS executor
FROM debian:bullseye-slim AS executor

RUN apt-get update && apt-get install --yes --no-install-recommends sqlite3

Expand Down
3 changes: 2 additions & 1 deletion docker/master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apt-get update && \
libgmp-dev \
libmpfr-dev \
libsqlite3-dev \
sqlite3 \
make \
opam \
openjdk-11-jdk-headless \
Expand Down Expand Up @@ -58,7 +59,7 @@ RUN cd /infer && \
DESTDIR="/infer-release" \
libdir_relative_to_bindir="../lib"

FROM debian:buster-slim AS executor
FROM debian:bullseye-slim AS executor

RUN apt-get update && apt-get install --yes --no-install-recommends sqlite3

Expand Down

0 comments on commit 23f0aa3

Please sign in to comment.