Commit e046ef3b authored by Tomáš Pecka's avatar Tomáš Pecka

Use ninja in dockerfiles

We are using alt's docker images based on alpine:edge. As of today (Oct
31, 2020), strange errors began to come from cmake/make.

```
 -- Check for working C compiler: /usr/bin/cc
 -- Check for working C compiler: /usr/bin/cc - broken
 CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:66 (message):
   The C compiler

     "/usr/bin/cc"

   is not able to compile a simple test program.

   It fails with the following output:

     Change Dir: /app/CMakeFiles/CMakeTmp

     Run Build Command(s):/usr/bin/make cmTC_49c71/fast && /usr/bin/make  -f CMakeFiles/cmTC_49c71.dir/build.make CMakeFiles/cmTC_49c71.dir/build
     make: /usr/bin/make: Operation not permitted
     make: *** [Makefile:140: cmTC_49c71/fast] Error 127

   CMake will not be able to correctly generate this project.
 Call Stack (most recent call first):
   CMakeLists.txt:2 (project)
```

However, ninja builds seem fine. In the alpine:edge they have the
samurai[1] implementation of ninja. Let's use that as a workaround.

[1] https://pkgs.alpinelinux.org/package/edge/main/x86_64/samurai
parent 097a80c7
Pipeline #96899 canceled with stages
in 7 seconds
...@@ -6,9 +6,9 @@ ADD ./webui/json_generators /app ...@@ -6,9 +6,9 @@ ADD ./webui/json_generators /app
ADD cmake ./app/cmake ADD cmake ./app/cmake
WORKDIR /app WORKDIR /app
RUN apk add jsoncpp-dev build-base cmake RUN apk add jsoncpp-dev build-base cmake samurai
RUN cmake . -DCMAKE_MODULE_PATH=cmake && \ RUN cmake . -DCMAKE_MODULE_PATH=cmake -GNinja && \
make -j2 && \ ninja -j$(grep -c processor /proc/cpuinfo) && \
mkdir -p static_jsons/ && \ mkdir -p static_jsons/ && \
./algorithms-json > static_jsons/algorithms.json && \ ./algorithms-json > static_jsons/algorithms.json && \
./version-json "$VERSION" > static_jsons/version.json ./version-json "$VERSION" > static_jsons/version.json
......
...@@ -3,14 +3,14 @@ FROM gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/ci-docker-images/activem ...@@ -3,14 +3,14 @@ FROM gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/ci-docker-images/activem
#----------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------
FROM gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/automata-library/cli:snapshot AS builder FROM gitlab.fit.cvut.cz:5000/algorithms-library-toolkit/automata-library/cli:snapshot AS builder
RUN apk add --no-cache build-base cmake jsoncpp-dev pkgconf apr-dev RUN apk add --no-cache build-base cmake jsoncpp-dev pkgconf apr-dev samurai
COPY worker /build/worker COPY worker /build/worker
COPY cmake /build/cmake COPY cmake /build/cmake
COPY --from=activemqcpp /usr/local/ /usr/local/ COPY --from=activemqcpp /usr/local/ /usr/local/
WORKDIR /build/worker WORKDIR /build/worker
RUN cmake . && make -j$(grep -c processor /proc/cpuinfo) && make install RUN cmake . -GNinja && ninja -j$(grep -c processor /proc/cpuinfo) && ninja install
#----------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment