Go packaging

Vincent Batts vbatts at redhat.com
Thu Oct 2 16:02:45 UTC 2014


On 30/09/14 08:46 +0100, Richard W.M. Jones wrote:
>How does gccgo affect the packaging of libraries?

The libraries may have support for one or more versions of the go API,
or exclusively one version. Since the gccgo support is usually an API
version or so behind, this compatibility would need to be considered.
Also, many libraries provide unit test files (*_test.go source) that are
tested using `go test` traditionally. Perhaps it is possible to test
them using only gccgo. I had never tried, but just did the following:
```
vbatts at noyee ~/huff (master) $ go test -c -x -compiler gccgo
WORK=/tmp/go-build256629732
mkdir -p $WORK/_/home/vbatts/huff/_test/_/home/vbatts/
mkdir -p $WORK/_/home/vbatts/huff/_test/
cd /home/vbatts/huff
gccgo -I $WORK -c -g -m64 -fgo-pkgpath=_/home/vbatts/huff -fgo-relative-import-path=_/home/vbatts/huff -o $WORK/_/home/vbatts/huff/_test/huff.o ./huffman.go ./words.go ./huffman_test.go ./words_test.go
ar cru $WORK/_/home/vbatts/huff/_test/_/home/vbatts/libhuff.a $WORK/_/home/vbatts/huff/_test/huff.o
cd $WORK/_/home/vbatts/huff/_test
gccgo -I . -I $WORK -c -g -m64 -o ./main.o ./_testmain.go
ar cru ./main.a ./main.o
cd .
gccgo -o $WORK/_/home/vbatts/huff/_test/huff.test $WORK/_/home/vbatts/huff/_test/main.o -Wl,-( -m64 $WORK/_/home/vbatts/huff/_test/_/home/vbatts/libhuff.a -Wl,-)
mkdir -p /home/vbatts/huff/
cp $WORK/_/home/vbatts/huff/_test/huff.test /home/vbatts/huff/huff.test
vbatts at noyee ~/huff (master) $ ./huff.test 
PASS
```

Perhaps an rpm macro could wrap this?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20141002/7c5e30fb/attachment.sig>


More information about the devel mailing list