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

ci build alpine: add workaround for msgpack-c to resolve relative paths #43

Closed

Conversation

otegami
Copy link
Contributor

@otegami otegami commented Jun 21, 2024

The following error happened when building docker images for Alpine Linux.

  > [linux/amd64 stage-0 4/4] RUN   /build.sh 3.2.0 14.0.2 &&   rm -f build.sh:
366.6 libtool:   error: cannot determine absolute directory name of 'lib'
366.6 make[4]: *** [Makefile:1025: libgroonga.la] Error 1
366.6 make[4]: Leaving directory '/build/groonga-14.0.2/lib'

The cause of this error

Adding --prefix=/usr/local during configuration step, we expected the
libdir path like /user/local/lib. But the actual path is /lib without prefix
because this prefix isn't reflected to pkgconfig file.
This is the same problem is this PR: msgpack/msgpack-c#1119

$ 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}

Solution

We re-write the msgpack-c.pc which can handle prefix path as a workaround.
This workaround is referred to this commit: groonga/groonga@8275463.
This problem has already fixed at upstream.
So after new version releasing, we can delete this workaround.

Additionally, I checked the build step passed here.

@otegami otegami force-pushed the fix-msgpack-path-during-build-process branch from 6282c53 to 2d4bb0c Compare June 21, 2024 06:29
The following error happened when building docker images for Alpine Linux.
- ref: https://github.com/pgroonga/docker/actions/runs/9554591639/job/26335983002

```
  > [linux/amd64 stage-0 4/4] RUN   /build.sh 3.2.0 14.0.2 &&   rm -f build.sh:
366.6 libtool:   error: cannot determine absolute directory name of 'lib'
366.6 make[4]: *** [Makefile:1025: libgroonga.la] Error 1
366.6 make[4]: Leaving directory '/build/groonga-14.0.2/lib'
```

The cause of this error

Adding `--prefix=/usr/local` during configuration step, we expected the
libdir path like `/user/local/lib`. But the actual path is `/lib` without prefix
because this prefix isn't reflected to pkgconfig file.

```console
$ 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}
```

Solution
We re-write the msgpack-c.pc which can handle prefix path as a
workaround.
This problem has already fixed on upstream.
So after new version releasing, we can delete this workaround.
- ref: https://github.com/msgpack/msgpack-c/blob/a5c8a2c845ba43100b7cad7f8a8db0c2ce361d1e/CMakeLists.txt#L33-L42
@otegami otegami force-pushed the fix-msgpack-path-during-build-process branch from 2d4bb0c to 4f3d125 Compare June 21, 2024 08:17
@otegami otegami changed the title Fix msgpack path during build process ci build alpine: add workaround for msgpack-c to resolve relative paths Jun 21, 2024
@otegami otegami marked this pull request as ready for review June 21, 2024 08:26
@otegami
Copy link
Contributor Author

otegami commented Jun 21, 2024

Additionally, I checked the build step passed here.

I realized that I couldn't check whether this image could be built or not on CI.
I checked here. https://github.com/otegami/pgroonga-docker/actions/runs/9610854142

@kou
Copy link
Member

kou commented Jun 21, 2024

Can we solve this by using CMake?
We will drop support for GNU Autotools. So using CMake based build system is better than using workaround for GNU Autotools based build system.

@otegami
Copy link
Contributor Author

otegami commented Jun 22, 2024

Sure. I think it's good timing to use CMake because we can test it at this time too,

@otegami
Copy link
Contributor Author

otegami commented Jun 22, 2024

I'm going to close this issue and then open a new PR for solving this issue using CMake.

@otegami otegami closed this Jun 22, 2024
@otegami otegami deleted the fix-msgpack-path-during-build-process branch June 22, 2024 01:57
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

Successfully merging this pull request may close these issues.

2 participants