Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Sep 2020 22:46:29 +0200
From:      =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= <fernando.apesteguia@gmail.com>
To:        Matthias Fechner <idefix@fechner.net>
Cc:        FreeBSD Mailing List <freebsd-ports@freebsd.org>
Subject:   Re: Help with go based port (invalid flag in pkg-config --libs: -D_THREAD_SAFE )
Message-ID:  <CAGwOe2bfhrRd9Y4Lq0fVkffpND%2B02rqOPRhvQMzgwm3byQripQ@mail.gmail.com>
In-Reply-To: <472de244-207e-66ad-128f-859a90817696@fechner.net>
References:  <472de244-207e-66ad-128f-859a90817696@fechner.net>

next in thread | previous in thread | raw e-mail | index | archive | help
El mi=C3=A9., 23 sept. 2020 21:49, Matthias Fechner <idefix@fechner.net>
escribi=C3=B3:

> 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
> some problems compiling it.
>
> It seems that a new go dependency is added that requires libgit2 as a
> 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
>
> /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
> --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
> -L/usr/local/lib -lssl -L/usr/local/lib -pthread -lcrypto -pthread
> -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
> --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
> so I can release the next gitlab-ce 13.4 upgrade.
>
> Thanks a lot.
>

I found this:

https://fipress.org/knowledge/invalid-flags-in-cgo-ldflags-pkg-config-or-in=
valid-flag-in-pkg-config

HTH


>
> Gru=C3=9F
> Matthias
>
> --
>
> "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
>
>
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGwOe2bfhrRd9Y4Lq0fVkffpND%2B02rqOPRhvQMzgwm3byQripQ>