On Wed, Feb 5, 2020 at 9:33 AM Florent Bonneau
<tnerolf.bonn...@gmail.com> wrote:
>
> Using docker image golang:1.13-alpine to build our code :
> - Compiling with "go install -v oursoftware/..." our build is sucessfull
> - Compiling with "go install -v -trimpath oursoftware/..." fails with 
> following error :
>
>
> ...
>
> runtime
> runtime/cgo
> vendor/golang.org/x/crypto/curve25519
> # runtime/cgo
> exec: "gcc": executable file not found in $PATH
> encoding
> ...
>
> We can for sure install the build tools upon the base image to solve the 
> issue, but it doesn't seem normal that the "-trimpath" option had this 
> side-effect ?
>
> Can someone explain why it happens ?

I haven't verified this, so this is just a guess, but perhaps without
-trimpath the go tool is using the prebuilt runtime/cgo.a, which was
built on a system with a C compiler.  When you add -trimpath, the
runtime/cgo package needs to be rebuilt in order to trim the paths.
Unfortunately, that rebuild fails, as the system you are building on
does not have a C compiler.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXzreOoLtEa5bwky_zq3wza45iSZxYbcD9X5GN%3DYBxsug%40mail.gmail.com.

Reply via email to