Skip to content

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

Closed
otegami wants to merge 1 commit into
pgroonga:mainfrom
otegami:fix-msgpack-path-during-build-process
Closed

ci build alpine: add workaround for msgpack-c to resolve relative paths#43
otegami wants to merge 1 commit into
pgroonga:mainfrom
otegami:fix-msgpack-path-during-build-process

Conversation

@otegami

@otegamiotegami commented Jun 21, 2024

Copy link
Copy Markdown
Contributor

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.pcprefix=/usrexec_prefix=/usrlibdir=libincludedir=includeName: MessagePackDescription: Binary-based efficient object serialization libraryVersion: 6.0.1Libs: -L${libdir} -lmsgpack-cCflags: -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
otegamiforce-pushed the fix-msgpack-path-during-build-process branch from 6282c53 to 2d4bb0cCompareJune 21, 2024 06:29
@otegamiotegami mentioned this pull request Jun 21, 2024
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
otegamiforce-pushed the fix-msgpack-path-during-build-process branch from 2d4bb0c to 4f3d125CompareJune 21, 2024 08:17
@otegamiotegami changed the title Fix msgpack path during build processci build alpine: add workaround for msgpack-c to resolve relative pathsJun 21, 2024
@otegami
otegami marked this pull request as ready for review June 21, 2024 08:26
@otegami

otegami commented Jun 21, 2024

Copy link
Copy Markdown
ContributorAuthor

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

kou commented Jun 21, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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

@otegami

Copy link
Copy Markdown
ContributorAuthor

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

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

@otegami@kou