Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2020 21:48:48 +0200
From:      Matthias Fechner <idefix@fechner.net>
To:        freebsd-ports@freebsd.org
Subject:   Help with go based port (invalid flag in pkg-config --libs: -D_THREAD_SAFE )
Message-ID:  <472de244-207e-66ad-128f-859a90817696@fechner.net>

next in thread | raw e-mail | index | archive | help
Dear all,

I currently package a new gitaly version which is required for gitlab-ce =

13.4.0.

The current version I have now can be found here:
https://gitlab.fechner.net/mfechner/Gitlab/-/tree/13.4/devel/gitaly

But for this port there are a lot of upstream changes which causes now=20
some problems compiling it.

It seems that a new go dependency is added that requires libgit2 as a=20
dependency.

I used the following command to better see the error message:
poudriere testport -p gitlab -j 121amd64 -i devel/gitaly

In the shell I executed then:
cd=20
/wrkdirs/usr/ports/devel/gitaly/work/gitaly-cf359cb573106371a6026bd85c314=
5caabf8c06b-cf359cb573106371a6026bd85c3145caabf8c06b/
gmake

And then a tried the following:
cd /root/go/pkg/mod/github.com/libgit2/git2go/v30@v30.0.5
pkg-config --cflags --static -- libgit2
pkg-config --libs --static -- libgit2
go build github.com/libgit2/git2go/v30: invalid flag in pkg-config=20
--libs: -D_THREAD_SAFE

I think the problem is somehow related to the output of:
pkg-config --libs --static -- libgit

which shows:
-L/usr/local/lib -lgit2 -lrt -pthread -lz -L/usr/local/lib -lssh2=20
-L/usr/local/lib -lssl -L/usr/local/lib -pthread -lcrypto -pthread=20
-lpcre -D_THREAD_SAFE -pthread

The error message I was able to found in the log:
go build github.com/libgit2/git2go/v30: invalid flag in pkg-config=20
--libs: -D_THREAD_SAFE

The full log is here:
https://pkg.fechner.net/data/121amd64-gitlab/2020-09-23_11h17m24s/logs/er=
rors/gitaly-13.4.0.log

The log is really hard to read, as go executed several compiles at once.

I tried to limit it to one thread using:
GO_BUILDFLAGS+=3D "-x -p 1"

but this does not work.

I tried to add compiler:c11 to the use flags, but this does not help (it =

seems that pkgconfig is for sure required).
It would be really great if someone could help me, fixing this problem=20
so I can release the next gitlab-ce 13.4 upgrade.

Thanks a lot.


Gru=C3=9F
Matthias

--=20

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?472de244-207e-66ad-128f-859a90817696>