Git Product home page Git Product logo

golang-packaging's Introduction

Go Report Card

golang-packaging


RPM macros and utilities for golang packaging.

A golang packager can just say

BuildRequires: golang-packaging

and let the included scripts handle Provides/Requires for you automatically. You can also say

BuildRequires: golang(xxx)

in specifications for packages built with golang-packaging.

golang-packaging's People

Contributors

afaerber avatar cyphar avatar flavio avatar jordimassaguerpla avatar marguerite avatar monstermunchkin avatar themarix avatar yecril71pl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

golang-packaging's Issues

golang-macros.rb doesn't work as expected

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?

$GOPATH not set correctly

I have been building my own syncthing packages for openSUSE 13.1 because syncthing requires go 1.3+ which is not available in the original distro. So on the advice of a syncthing maintainer I established a project, linked it to go & go1.4 in the devel:languages:go project and was able to produce my own syncthing packages.

Following go revision 242, when golang-macros.rb was added, syncthing would no longer compile. A series of errors were logged stating that various library packages could not be found. I suspect this is due to $GOPATH being set incorrectly.

A sample of the error log is shown below:

GOPATH=/home/abuild/rpmbuild/BUILD/syncthing/Godeps/_workspace:/home/abuild/go:/usr/share/go/contrib

cmd/stcompdirs/main.go:19:2: cannot find package "github.com/syncthing/syncthing/lib/symlinks" in any of:

  • /usr/lib64/go/src/github.com/syncthing/syncthing/lib/symlinks (from $GOROOT)
  • home/abuild/rpmbuild/BUILD/syncthing/Godeps/_workspace/src/github.com/syncthing/syncthing/lib/symlinks (from $GOPATH)
  • /home/abuild/go/src/github.com/syncthing/syncthing/lib/symlinks
  • /usr/share/go/contrib/src/github.com/syncthing/syncthing/lib/symlinks

The actual path to the library packages is:

/home/abuild/rpmbuild/BUILD/go/src/github.com/syncthing/syncthing/lib/symlinks

Reverting to go version 241 has fixed the problem for the moment and $GOPATH is now logged as

GOPATH=/home/abuild/rpmbuild/BUILD/syncthing/Godeps/_workspace:/home/abuild/rpmbuild/BUILD/go

findprovs does't work for openSUSE Leap 42.1

Hello,

For instance, package golang-github-prometheus-client_golang doesn't provide anything on openSUSE Leap 42.1:

> rpm -q --provides -p golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.x86_64.rpm
предупреждение: golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
golang-github-prometheus-client_golang = 0.7.0+git20151127.67994f1-1.1
golang-github-prometheus-client_golang(x86-64) = 0.7.0+git20151127.67994f1-1.1
> rpm -q --info -p golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.x86_64.rpm --
предупреждение: golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
Name        : golang-github-prometheus-client_golang
Version     : 0.7.0+git20151127.67994f1
Release     : 1.1
Architecture: x86_64
Install Date: (not installed)
Group       : Development/Languages/Other
Size        : 13745009
License     : Apache-2.0
Signature   : DSA/SHA1, Вс 24 янв 2016 00:00:06, Key ID af4cfe4d307d7bf9
Source RPM  : golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.src.rpm
Build Date  : Сб 23 янв 2016 23:59:47
Build Host  : build75
Relocations : (not relocatable)
Vendor      : obs://build.opensuse.org/devel:languages:go
URL         : https://github.com/prometheus/client_golang
Summary     : Prometheus instrumentation library for Go applications
Description :
This is the Go client library for Prometheus.
Distribution: devel:languages:go / openSUSE_Leap_42.1
> rpm -q --list -p golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.x86_64.rpm --
предупреждение: golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.1.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
/usr/bin/random
/usr/bin/simple
/usr/lib64/go/contrib/pkg/linux_amd64/github.com
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/prometheus
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/prometheus/client_golang
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/prometheus/client_golang/api
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/prometheus/client_golang/api/prometheus.a
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/prometheus/client_golang/prometheus.a
/usr/share/doc/packages/golang-github-prometheus-client_golang
/usr/share/doc/packages/golang-github-prometheus-client_golang/LICENSE
/usr/share/doc/packages/golang-github-prometheus-client_golang/README.md

At the same time, the same package for openSUSE Factory provides the modules:

> rpm -q --provides -p golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.2.x86_64.rpm
предупреждение: golang-github-prometheus-client_golang-0.7.0+git20151127.67994f1-1.2.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
golang(github.com/prometheus/client_golang)
golang(github.com/prometheus/client_golang/api/prometheus)
golang(github.com/prometheus/client_golang/prometheus)
golang-github-prometheus-client_golang = 0.7.0+git20151127.67994f1-1.2
golang-github-prometheus-client_golang(x86-64) = 0.7.0+git20151127.67994f1-1.2

Fails to build on Power

[ 28s] /home/abuild/rpmbuild/BUILD/golang-packaging-14.5/golang/rpmsysinfo.rb:83:in get_go_contribdir': uninitialized class variable @@libdir in RpmSysinfo (NameError) [ 28s] from /home/abuild/rpmbuild/BUILD/golang-packaging-14.5/golang/filelists.rb:9:in<module:Filelists>'
[ 28s] from /home/abuild/rpmbuild/BUILD/golang-packaging-14.5/golang/filelists.rb:1:in &lt;top (required)&gt;' [ 28s] from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:inrequire'
[ 28s] from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in require' [ 28s] from ./golang-macros.rb:8:in<main>'
[ 28s] + GOARCH=
[ 28s] error: Bad exit status from /var/tmp/rpm-tmp.YnysZH (%prep)

golang-github-hashicorp-raft doesn't requires anything

Hello,

the following package doesn't require any others:

> rpm -q -R -p golang-github-hashicorp-raft-0.0.0+git20151117.d136cd1-1.3.x86_64.rpm
предупреждение: golang-github-hashicorp-raft-0.0.0+git20151117.d136cd1-1.3.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsLzma) <= 4.4.6-1

At the same time, the package provides file /usr/lib64/go/contrib/pkg/linux_amd64/github.com/hashicorp/raft.a which requires at least two external packages:

        import codec "github.com/hashicorp/go-msgpack/codec"
        import metrics "github.com/armon/go-metrics"

Missed provides in golang-github-stretchr-testify

Hi,

Something wrong with the package https://build.opensuse.org/package/show/devel:languages:go/golang-github-stretchr-testify

> rpm -q --provides -p golang-github-stretchr-testify-0.0.0+git20150620.089c718-1.7.x86_64.rpm
предупреждение: golang-github-stretchr-testify-0.0.0+git20150620.089c718-1.7.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
go-testify = 0.0.0+git20150620.089c718
golang-github-stretchr-testify-devel = 0.0.0+git20150620.089c718
golang-github-stretchr-testify-devel-static = 0.0.0+git20150620.089c718
golang-github-stretchr-testify = 0.0.0+git20150620.089c718-1.7
golang-github-stretchr-testify(x86-64) = 0.0.0+git20150620.089c718-1.7

It should provide the following:

github.com/stretchr/testify
github.com/stretchr/testify/assert
github.com/stretchr/testify/http
github.com/stretchr/testify/mock
> rpm -q -p golang-github-stretchr-testify-0.0.0+git20150620.089c718-1.7.x86_64.rpm --list
предупреждение: golang-github-stretchr-testify-0.0.0+git20150620.089c718-1.7.x86_64.rpm: Заголовок V3 DSA/SHA1 Signature, key ID 307d7bf9: NOKEY
/usr/lib64/go/contrib/pkg/linux_amd64/github.com
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/stretchr
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/stretchr/testify
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/stretchr/testify.a
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/stretchr/testify/assert.a
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/stretchr/testify/http.a
/usr/lib64/go/contrib/pkg/linux_amd64/github.com/stretchr/testify/mock.a
/usr/share/doc/packages/golang-github-stretchr-testify
/usr/share/doc/packages/golang-github-stretchr-testify/LICENCE.txt
/usr/share/doc/packages/golang-github-stretchr-testify/README.md

Requires could be extracted directly from .a files

Look at .a files, they can be extracted using ar x file.a.
In each archive file.a there is a text file __.PKGDEF containing (among other) list of imports:

        import gollectd "github.com/kimor79/gollectd"

This is the more direct way which does not rely on scanning sources on build system, you only need to scan the files which are provided to prov.find by RPM on standard input.

Move this repository under the openSUSE organization

Hi, I just forked this repository as openSUSE so that more people can contribute to it. I know you are already a member of the openSUSE org, so you will still be able to review PRs against the repo.

I hope you won't mind :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.