Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build docker image #41

Closed
komainu8 opened this issue Jun 18, 2024 · 8 comments
Closed

Fail to build docker image #41

komainu8 opened this issue Jun 18, 2024 · 8 comments

Comments

@komainu8
Copy link
Member

komainu8 commented Jun 18, 2024

Fail to build docker image for Alpine Linux as below.
https://github.com/pgroonga/docker/actions/runs/9554591639/job/26335980522#step:7:4970

#12 [linux/amd64 4/5] RUN   /build.sh 3.2.0 14.0.2 &&   rm -f build.sh
#12 393.2   CXXLD    libgroonga.la
#12 393.9 ../libtool: cd: line 5164: can't cd to lib: No such file or directory
#12 393.9 libtool:   error: cannot determine absolute directory name of 'lib'
#12 393.9 make[4]: *** [Makefile:1025: libgroonga.la] Error 1
#12 393.9 make[4]: Leaving directory '/build/groonga-14.0.2/lib'
#12 393.9 make[3]: *** [Makefile:1208: all-recursive] Error 1
#12 393.9 make[2]: *** [Makefile:943: all] Error 2
#12 393.9 make[3]: Leaving directory '/build/groonga-14.0.2/lib'
#12 393.9 make[2]: Leaving directory '/build/groonga-14.0.2/lib'
#12 393.9 make[1]: *** [Makefile:659: all-recursive] Error 1
#12 393.9 make[1]: Leaving directory '/build/groonga-14.0.2'
#12 393.9 make: *** [Makefile:538: all] Error 2

Probably, this problem resolve by changing to CMake base build system.

Related issues is #40.

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

Let me check it!

Before trying the following steps, I will read logs again.

I will try to resolve this issue at the following steps.

  • Build alpine-12-slim's docker image at the local using CMake
  • Run build it at the GitHub Actions
  • Build alpine-12's docker image at the local using CMake
  • Run build it at the GitHub Actions
  • And so on

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

Before trying the following steps, I will read logs again.

I will build current docker image to check the ./libtool file.

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

I'm wait for the build,

$ git diff
diff --git a/alpine/12-slim/Dockerfile b/alpine/12-slim/Dockerfile
index 7593b86..06cd1ad 100644
--- a/alpine/12-slim/Dockerfile
+++ b/alpine/12-slim/Dockerfile
@@ -16,25 +16,25 @@ RUN \
 ENV PGROONGA_VERSION=3.2.0 \
     GROONGA_VERSION=14.0.2

-COPY alpine/build.sh /
-RUN \
-  /build.sh ${PGROONGA_VERSION} ${GROONGA_VERSION} && \
-  rm -f build.sh
+# COPY alpine/build.sh /
+# RUN \
+#   /build.sh ${PGROONGA_VERSION} ${GROONGA_VERSION} && \
+#   rm -f build.sh

-FROM postgres:12-alpine
+# FROM postgres:12-alpine

-# copy thirdpart lib files
-COPY --from=0 /usr/lib/libmsgpack-c.so.? /usr/lib/
-COPY --from=0 /usr/lib/liblz4.so.? /usr/lib/
-COPY --from=0 /usr/lib/libzstd.so.? /usr/lib/
-# copy MeCab files
-COPY --from=0 /usr/local/etc/mecabrc /usr/local/etc/
-COPY --from=0 /usr/local/lib/libmecab.so.? /usr/local/lib/
-COPY --from=0 /usr/local/lib/mecab/ /usr/local/lib/mecab/
-# copy Groonga lib files
-COPY --from=0 /usr/local/etc/groonga/ /usr/local/etc/groonga/
-COPY --from=0 /usr/local/lib/groonga/ /usr/local/lib/groonga/
-COPY --from=0 /usr/local/lib/libgroonga.so.? /usr/local/lib/
-# copy PGroonga extension files
-COPY --from=0 /usr/local/lib/postgresql/pgroonga*.so /usr/local/lib/postgresql/
-COPY --from=0 /usr/local/share/postgresql/extension/pgroonga* /usr/local/share/postgresql/extension/
+# # copy thirdpart lib files
+# COPY --from=0 /usr/lib/libmsgpack-c.so.? /usr/lib/
+# COPY --from=0 /usr/lib/liblz4.so.? /usr/lib/
+# COPY --from=0 /usr/lib/libzstd.so.? /usr/lib/
+# # copy MeCab files
+# COPY --from=0 /usr/local/etc/mecabrc /usr/local/etc/
+# COPY --from=0 /usr/local/lib/libmecab.so.? /usr/local/lib/
+# COPY --from=0 /usr/local/lib/mecab/ /usr/local/lib/mecab/
+# # copy Groonga lib files
+# COPY --from=0 /usr/local/etc/groonga/ /usr/local/etc/groonga/
+# COPY --from=0 /usr/local/lib/groonga/ /usr/local/lib/groonga/
+# COPY --from=0 /usr/local/lib/libgroonga.so.? /usr/local/lib/
+# # copy PGroonga extension files
+# COPY --from=0 /usr/local/lib/postgresql/pgroonga*.so /usr/local/lib/postgresql/
+# COPY --from=0 /usr/local/share/postgresql/extension/pgroonga* /usr/local/share/postgresql/extension/
$ docker build -f alpine/12-slim/Dockerfile \
             -t pgroonga-12-slim \
             .
$ docker run -it \
           --rm \
           --name pgroonga-12-slim \
           -e POSTGRES_DB=pgroonga \
           -e POSTGRES_PASSWORD=pgroonga \
           -e POSTGRES_USER=pgroonga \
           --volume ${PWD}:/host \
           pgroonga-12-slim
$ docker exec -it pgroonga-12-slim bin/bash
# cd host/alpine/
# ./build.sh ${PGROONGA_VERSION} ${GROONGA_VERSION}

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

The following error is raised. It's the same one.
ref: https://github.com/pgroonga/docker/actions/runs/9554591639/job/26335983002

# ./build.sh ${PGROONGA_VERSION} ${GROONGA_VERSION}
  CXXLD    libgroonga.la
../libtool: cd: line 5164: can't cd to lib: No such file or directory
libtool:   error: cannot determine absolute directory name of 'lib'
make[4]: *** [Makefile:1025: libgroonga.la] Error 1
make[4]: Leaving directory '/host/alpine/build/groonga-14.0.2/lib'
make[3]: *** [Makefile:1208: all-recursive] Error 1
make[3]: Leaving directory '/host/alpine/build/groonga-14.0.2/lib'
make[2]: *** [Makefile:943: all] Error 2
make[2]: Leaving directory '/host/alpine/build/groonga-14.0.2/lib'
make[1]: *** [Makefile:659: all-recursive] Error 1
make[1]: Leaving directory '/host/alpine/build/groonga-14.0.2'
make: *** [Makefile:538: all] Error 2

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

It's because of the msgpack-c's pkgconfig path.

# cat /usr/lib/pkgconfig/msgpack-c.pc
prefix=/usr
exec_prefix=/usr
libdir=lib
includedir=include

Name: MessagePack
Description: Binary-based efficient object serialization library
Version: 6.0.1
Libs: -L${libdir} -lmsgpack-c
Cflags: -I${includedir}

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

After adding workaround for msgpack-c pkgconfig, It succeeded.
I have already made a pull request for fixing this issue for handling path problems.
After releasing new version of msgpack-c. it will solve it.
ref: msgpack/msgpack-c#1119

$ git diff
diff --git a/alpine/build.sh b/alpine/build.sh
index 3b909bb..64d9a7e 100755
--- a/alpine/build.sh
+++ b/alpine/build.sh
@@ -37,6 +37,7 @@ make -j$(nproc)
 make install
 cd -

+sed -i.bak -E -e 's,^(include|lib)dir=,\1dir=${prefix}/,g' /usr/lib/pkgconfig/msgpack-c.pc
 wget https://packages.groonga.org/source/groonga/groonga-${GROONGA_VERSION}.tar.gz
 tar xf groonga-${GROONGA_VERSION}.tar.gz
 cd groonga-${GROONGA_VERSION}
$ docker build -f alpine/12-slim/Dockerfile \
             -t pgroonga-12-slim \
             .

@otegami
Copy link
Contributor

otegami commented Jun 21, 2024

This change might fix this issue.
#43

@otegami
Copy link
Contributor

otegami commented Jun 24, 2024

We decided to resolve this issue by changing to CMake base build system.
So I will start to do #40 at first.

@kou kou closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants