After trying to track down why was causing this symptom I found that where the go plugin creates a custom environment for running commands it adds its own LDFLAGS like this:
I think when this added to scripts that are used to configure the environment the fact that the CGO_LDFLAGS is outside the quote marks causes issues in some circumstances. I have found changing this to the following allows these builds to work fine:
After trying to track down why was causing this symptom I found that where the go plugin creates a custom environment for running commands it adds its own LDFLAGS like this:
env = [
'GOPATH= {}/go'. format( root),
'CGO_ LDFLAGS= $CGO_LDFLAGS" ' + ' '.join([
'-L{0} /lib',
'-L{0} /usr/lib' ,
'-L{0} /lib/{1} ',
'-L{0} /usr/lib/ {1}',
'$LDFLAGS'
]) .format( root, snapcraft. common. get_arch_ triplet( )) + '"',
I think when this added to scripts that are used to configure the environment the fact that the CGO_LDFLAGS is outside the quote marks causes issues in some circumstances. I have found changing this to the following allows these builds to work fine:
env = [
'GOPATH= {}/go'. format( root),
'CGO_ LDFLAGS= "$CGO_LDFLAGS ' + ' '.join([
'-L{0} /lib',
'-L{0} /usr/lib' ,
'-L{0} /lib/{1} ',
'-L{0} /usr/lib/ {1}',
'$LDFLAGS'
]) .format( root, snapcraft. common. get_arch_ triplet( )) + '"',