Failed upgrade of localhost docker test instance (/bin/sh: cmake: not found)
I had a local Mobilizon docker instance I played with, so when I heard that there was a new version (1.0.3) I thought I would try upgrading, but ... it didn't work.
In the Mobilizon repository I did git pull
then docker-compose pull
then docker-compose up --force-recreate --build -d
. In the logs I see some kind of infinite loop :
api_1 | [...]
api_1 | All dependencies are up to date
api_1 |
api_1 | 20:08:33.160 [info] Using environment configuration for Docker
api_1 | ==> fast_html
api_1 | # Sadly, build components separately seems to sporadically fail
api_1 | cd c_src/lexbor; cmake -DLEXBOR_BUILD_SEPARATELY=OFF -DLEXBOR_BUILD_SHARED=OFF
api_1 | /bin/sh: cmake: not found
api_1 | make: *** [Makefile:42: c_src/lexbor/liblexbor_static.a] Error 127
api_1 | could not compile dependency :fast_html, "mix compile" failed. You can recompile this dependency with "mix deps.compile fast_html", update it with "mix deps.update fast_html" or clean it with "mix deps.clean fast_html"
api_1 | ==> mobilizon
api_1 | ** (Mix) Could not compile with "make" (exit status: 2).
api_1 | Please check you have: a C compiler, GNUMake, CMake and Erlang development headers installed before reporting an issue.
mobilizon_api exited with code 1
api_1 | yarn install v1.22.4
api_1 | [1/4] Resolving packages...
What you see at the end (yarn install
etc ...) is the beginning of a new loop: you had the same exact output at the beginning of the previous loop that ended with “Could not compile with "make"”.
From discussion with @tcit on https://riot.im/app/#/room/#Mobilizon:matrix.org:
don't use the docker-compose from the main repo, it is for development and shouldn't work
I never maintained it since I don’t use it myself, that’s why there seem to be dependencies issues
I’ll see if I can adapt the production dockerfile to development
~ @tcit
Since the error is pretty clear (cmake
is missing) I tried to “fix” it in the Dockerfile
:
diff --git a/Dockerfile b/Dockerfile
index 9c73fff5..ef703458 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
FROM bitwalker/alpine-elixir:latest
RUN apk add inotify-tools postgresql-client yarn file
-RUN apk add --no-cache make gcc libc-dev argon2 imagemagick
+RUN apk add --no-cache make gcc libc-dev argon2 imagemagick cmake
RUN mix local.hex --force && mix local.rebar --force
(then docker-compose up --force-recreate --build -d
)
Now I see cmake
starting in the logs, but ... it still doesn't work:
api_1 | All dependencies are up to date
api_1 |
api_1 | 20:28:45.917 [info] Using environment configuration for Docker
api_1 | ==> fast_html
api_1 | # Sadly, build components separately seems to sporadically fail
api_1 | cd c_src/lexbor; cmake -DLEXBOR_BUILD_SEPARATELY=OFF -DLEXBOR_BUILD_SHARED=OFF
api_1 | CMake Warning:
api_1 | No source or binary directory provided. Both will be assumed to be the
api_1 | same as the current working directory, but note that this warning will
api_1 | become a fatal error in future CMake releases.
api_1 |
api_1 |
api_1 | -- Project name: lexbor
api_1 | CMake Warning (dev) at /usr/share/cmake/Modules/GNUInstallDirs.cmake:225 (message):
api_1 | Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
api_1 | target architecture is known. Please enable at least one language before
api_1 | including GNUInstallDirs.
api_1 | Call Stack (most recent call first):
api_1 | CMakeLists.txt:81 (include)
api_1 | This warning is for project developers. Use -Wno-dev to suppress it.
api_1 |
api_1 | -- Build without Threads
api_1 | -- Lexbor version: 1.0.0
api_1 | -- The CXX compiler identification is unknown
api_1 | CMake Error at CMakeLists.txt:113 (PROJECT):
api_1 | No CMAKE_CXX_COMPILER could be found.
api_1 |
api_1 | Tell CMake where to find the compiler by setting either the environment
api_1 | variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
api_1 | to the compiler, or to the compiler name if it is in the PATH.
api_1 |
api_1 |
api_1 | -- Configuring incomplete, errors occurred!
api_1 | See also "/app/deps/fast_html/c_src/lexbor/CMakeFiles/CMakeOutput.log".
api_1 | See also "/app/deps/fast_html/c_src/lexbor/CMakeFiles/CMakeError.log".
api_1 | make: *** [Makefile:42: c_src/lexbor/liblexbor_static.a] Error 1
api_1 | could not compile dependency :fast_html, "mix compile" failed. You can recompile this dependency with "mix deps.compile fast_html", update it with "mix deps.update fast_html" or clean it with "mix deps.clean fast_html"
api_1 | ==> mobilizon
api_1 | ** (Mix) Could not compile with "make" (exit status: 2).
api_1 | Please check you have: a C compiler, GNUMake, CMake and Erlang development headers installed before reporting an issue.
mobilizon_api exited with code 1