marguerite / golang-packaging

golang packaging tool for openSUSE
GNU General Public License v3.0
8 stars 17 forks source link

golang-macros.rb doesn't work as expected #6

Closed matwey closed 8 years ago

matwey commented 8 years ago

Look here https://build.opensuse.org/package/live_build_log/home:matwey:influxdb_0.9.6.1/golang-github-golang-protobuf/openSUSE_Leap_42.1/i586

Segmentation fault occurred in go compiler

[   59s] /usr/lib/go/pkg/tool/linux_386/compile -o $WORK/github.com/golang/protobuf/proto.a -trimpath $WORK -p github.com/golang/protobuf/proto -complete -buildid 02dcdff0c737159eb5b2fa1723f1edabb219aee1 -D _/home/abuild/rpmbuild/BUILD/go/src/github.com/golang/protobuf/proto -I $WORK -pack ./clone.go ./decode.go ./encode.go ./equal.go ./extensions.go ./lib.go ./message_set.go ./pointer_unsafe.go ./properties.go ./text.go ./text_parser.go
[   59s] go build github.com/golang/protobuf/proto: /usr/lib/go/pkg/tool/linux_386/compile: signal: segmentation fault
[   59s] Build Finished!
[   59s] + exit 0

instead of failing the build right here it proceeds and fails with cryptic error later.

[   61s] RPM build errors:
[   61s]     File not found: /home/abuild/rpmbuild/BUILDROOT/golang-github-golang-protobuf-0.0.0+git20151207.68415e7-8.4.i386/usr/bin/protoc-gen-go
[   61s]     File not found by glob: /home/abuild/rpmbuild/BUILDROOT/golang-github-golang-protobuf-0.0.0+git20151207.68415e7-8.4.i386/usr/lib/go/contrib/pkg/linux_386/*

Could you please return old behavior?

marguerite commented 8 years ago

I can catch stderr and make it fail at the right place, but the segmentation fault is apparently not because of my code.

matwey commented 8 years ago

Of course SIGFAULT is not due your code. You should handle process status when you call it. This is what bash does for you.

Every system should be wrapped somehow like that:

if ! system("abc")
    exit($?)
end
marguerite commented 8 years ago

I wonder if I should skip installation and -source packaging as well.

I don't know if the build process (which is bash) will stop when ruby script returns an unclean exit.

marguerite commented 8 years ago

fixed in master