[opensuse-go] A fix for go archive is missing __.PKGDEF
Hello, I managed to figure out why we get this error on openSUSE (and SLE): % go vet github.com/cyphar/umoci/image/cas vet: import failed: reading export data: /usr/lib64/go/pkg/linux_amd64/fmt.a: go archive is missing __.PKGDEF vet: import failed: reading export data: /usr/lib64/go/pkg/linux_amd64/fmt.a: go archive is missing __.PKGDEF exit status 1 It looks like OBS does some sort of "sanitisation" of paths inside .a archives. This results in the entry for __.PKGDEF to have a '/' appended to it in our packages (to indicate that it's a directory I guess). This then causes an error to occur because the importer code for Go does a string comparison to "__.PKGDEF"[1]. I've opened an issue against Go[2], as well as posted a patch (which is attached to this mail). We should probably carry this patch (I don't think SUSE's signed the Google CLA so that might take a while). [1]: https://golang.org/src/go/internal/gcimporter/exportdata.go#L60 [2]: https://github.com/golang/go/issues/17890 -- Aleksa Sarai Software Engineer (Containers) SUSE Linux GmbH https://www.cyphar.com/
It looks like OBS does some sort of "sanitisation" of paths inside .a archives. This results in the entry for __.PKGDEF to have a '/' appended to it in our packages (to indicate that it's a directory I guess). This then causes an error to occur because the importer code for Go does a string comparison to "__.PKGDEF"[1].
I found out more. It's because when you run `strip` on a Go .a archive, the __.PKGDEF entry gets modified when regenerating the archive. The solution is to disable stripping. I'm going to just make an SR with that fix. -- Aleksa Sarai Software Engineer (Containers) SUSE Linux GmbH https://www.cyphar.com/ -- To unsubscribe, e-mail: opensuse-go+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-go+owner@opensuse.org
It looks like OBS does some sort of "sanitisation" of paths inside .a archives. This results in the entry for __.PKGDEF to have a '/' appended to it in our packages (to indicate that it's a directory I guess). This then causes an error to occur because the importer code for Go does a string comparison to "__.PKGDEF"[1].
I found out more. It's because when you run `strip` on a Go .a archive, the __.PKGDEF entry gets modified when regenerating the archive. The solution is to disable stripping.
I'm going to just make an SR with that fix.
Here's the SR: https://build.opensuse.org/request/show/439834 -- Aleksa Sarai Software Engineer (Containers) SUSE Linux GmbH https://www.cyphar.com/ -- To unsubscribe, e-mail: opensuse-go+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-go+owner@opensuse.org
participants (1)
-
Aleksa Sarai