Building packer and golang dependencies

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Building packer and golang dependencies

Johannes Kastl-2
Dear all,

another day, another adventure:

I tried to build Hashicorp's packer tool for openSUSE:

home:ojkastl_buildservice:Packer

For Tumbleweed it (and its newly created dependencies) builds, is
installable and seems to work (in my not too many tests). Testers welcome.

SRs to d:l:go are here:
sr#502537 https://build.opensuse.org/request/show/502537
sr#502538 https://build.opensuse.org/request/show/502538
sr#502539 https://build.opensuse.org/request/show/502539
sr#502530 https://build.opensuse.org/request/show/502540

I would appreciate if some more skillable packagers had a look to see
if I got it right. ;-)

At the moment I try to package it for Leap 42.2/3, but seems like the
golang-packaging macros need some more adaption:

> [   49s] Copying deps to /home/abuild/rpmbuild/BUILD/contrib
> [   49s] ++ get_gocontrib_path
> [   49s] +++ rpm --eval '%{_datadir}'
> [   49s] +++ rpm --eval %go_api_ver
> [   49s] ++ echo /usr/share/go/1.6/contrib
> [   49s] ++ get_buildcontrib_path
> [   49s] ++ echo /home/abuild/rpmbuild/BUILD/contrib
> [   49s] + cp -rT /usr/share/go/1.6/contrib/src /home/abuild/rpmbuild/BUILD/contrib/src
> [   49s] cp: cannot stat '/usr/share/go/1.6/contrib/src': No such file or directory
> [   49s] error: Bad exit status from /var/tmp/rpm-tmp.lJjN7p (%build)
I find no directory named /usr/share/go/1.6/contrib, just
/usr/share/go/contrib on my Leap machines.

Has somebody already tried to build go stuff on Leap? I would assume...

Kind Regards,
Johannes


signature.asc (900 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Building packer and golang dependencies

Jordi Massaguer Pla-2


On 06/09/2017 05:15 PM, Johannes Kastl wrote:

> Dear all,
>
> another day, another adventure:
>
> I tried to build Hashicorp's packer tool for openSUSE:
>
> home:ojkastl_buildservice:Packer
>
> For Tumbleweed it (and its newly created dependencies) builds, is
> installable and seems to work (in my not too many tests). Testers welcome.
>
> SRs to d:l:go are here:
> sr#502537 https://build.opensuse.org/request/show/502537
> sr#502538 https://build.opensuse.org/request/show/502538
> sr#502539 https://build.opensuse.org/request/show/502539
> sr#502530 https://build.opensuse.org/request/show/502540
>
> I would appreciate if some more skillable packagers had a look to see
> if I got it right. ;-)
>
> At the moment I try to package it for Leap 42.2/3, but seems like the
> golang-packaging macros need some more adaption:
>
>> [   49s] Copying deps to /home/abuild/rpmbuild/BUILD/contrib
>> [   49s] ++ get_gocontrib_path
>> [   49s] +++ rpm --eval '%{_datadir}'
>> [   49s] +++ rpm --eval %go_api_ver
>> [   49s] ++ echo /usr/share/go/1.6/contrib
>> [   49s] ++ get_buildcontrib_path
>> [   49s] ++ echo /home/abuild/rpmbuild/BUILD/contrib
>> [   49s] + cp -rT /usr/share/go/1.6/contrib/src /home/abuild/rpmbuild/BUILD/contrib/src
>> [   49s] cp: cannot stat '/usr/share/go/1.6/contrib/src': No such file or directory
>> [   49s] error: Bad exit status from /var/tmp/rpm-tmp.lJjN7p (%build)
> I find no directory named /usr/share/go/1.6/contrib, just
> /usr/share/go/contrib on my Leap machines.
>
> Has somebody already tried to build go stuff on Leap? I would assume...

Make sure you use the latest go and golang-packages from
devel:languages:go . You can either set it up in your project
configuration or link the packages in your project.

> Kind Regards,
> Johannes
>

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Building packer and golang dependencies

Johannes Kastl-2
Hi Jordi,

thanks for your answer.

On 09.06.17 17:41 Jordi Massaguer Pla wrote:

>> At the moment I try to package it for Leap 42.2/3, but seems like
>> the golang-packaging macros need some more adaption:

> Make sure you use the latest go and golang-packages from
> devel:languages:go . You can either set it up in your project
> configuration or link the packages in your project.

Actually I seem to have packages that build. I have not tried them
thoroughly, but it seems like they can be installed and used.

All I had to do was patch golang-packaging to change the macros on
Leap. From the spec file of golang-packaging:

> %if %{defined leap_version}
> sed -i 's/..go_api_ver.\///' %{buildroot}/etc/rpm/macros.go
> sed -i 's/$(rpm --eval .go_api_ver)\///' %{buildroot}/usr/lib/rpm/golang.prov
> sed -i 's/$(rpm --eval .go_api_ver)\///' %{buildroot}/usr/lib/rpm/golang.req
> sed -i 's/$(rpm --eval .go_api_ver)\///' %{buildroot}/usr/lib/rpm/golang.sh
> %endif

This just changes the path /usr/share/go/1.6/... to /usr/share/go/...,
which seems to be enough so the packages build.

Please, I know this is a hacky solution. If some people could test the
packages and confirm they are working properly, someone more
knowledgeable than me can advise on how to get this into the d:l:go
golang-packaging package.

If anybody wants to help get the gotests enabled for packer on Leap, I
would be grateful.

Johannes




signature.asc (900 bytes) Download Attachment