Results 1 to 7 of 7

Thread: How to package Golang application?

  1. #1

    Default How to package Golang application?

    I am trying to package this Go application https://github.com/arduino/arduino-cli and failing super-miserably.

    I know nothing about Go, so after having read this guide https://en.opensuse.org/openSUSE:Packaging_Go I searched for a couple of packages to use as examples, and I found these:

    * https://build.opensuse.org/package/v....spec?expand=1
    * https://build.opensuse.org/package/v....spec?expand=1 (found via another thread)

    Armed with that, and taking a guess at this packages' other Golang dependencies from a manual compilation attempt, I put together a spec file which, as you can see, fails to build claiming that "nothing provides golang([…])". 😢

    I have tried locally and OBS with the same result.

    Any ideas how to go about building this package?
    Last edited by licehunter; 27-Jul-2019 at 10:04. Reason: Disabled smileys

  2. #2
    Join Date
    Sep 2012
    Posts
    5,028

    Default Re: How to package Golang application?

    Quote Originally Posted by licehunter View Post
    taking a guess at this packages' other Golang dependencies
    Did you actually check that these dependencies are provided by any package?

    fails to build claiming that "nothing provides golang([…])
    I am not really surprised, on vanilla TW I see very small number of golang packages and not all of them even have "goloang(xxx)" provides.
    Any ideas how to go about building this package?
    Either you add additional repositories where necessary packages are provided to your project, so missing provides can be resolved, or you build needed packages locally as part of your project.

    The first step is to actually verify that necessary packages exist, not guess what they may be.

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,143
    Blog Entries
    2

    Default Re: How to package Golang application?

    Since the project hasn't yet gotten around to creating build instructions,
    I'd suggest using their posted Dockerfile as a likely recipe for building, which of course would list dependencies

    https://github.com/arduino/arduino-c.../CI/Dockerfile

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4

    Default Re: How to package Golang application?

    Thanks for the answer. I guess a better question is: what does "BuildRequires: golang([something])" do?

    Clearly, those are not normal dependencies as can be deduced from the links I posted earlier. So what is that expression supposed to do?

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: How to package Golang application?

    Quote Originally Posted by licehunter View Post
    Thanks for the answer. I guess a better question is: what does "BuildRequires: golang([something])" do?

    Clearly, those are not normal dependencies as can be deduced from the links I posted earlier. So what is that expression supposed to do?
    Hi
    First off you will not get anything from the internet in the buildroot, the only way is before build with a _service. In saying that if you remove all of those build requires and do a test build, what is the error? If those requirements are not present in the distribution then you will need to build....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6
    Join Date
    Sep 2012
    Posts
    5,028

    Default Re: How to package Golang application?

    Quote Originally Posted by licehunter View Post
    what does "BuildRequires: golang([something])" do?
    It declares that at the time package is being built another package that Provides string "golang([something])" must be present. If such package is not present (i.e. nothing provides "golang([something])") rpmbuild fails.

    Sometimes such Provides are autogenerated during package build. I am not familiar with golang (or its packaging) so I cannot comment here. After cursory look at Wiki page it sounds like these Provides are added manually.

  7. #7

    Default Re: How to package Golang application?

    Thank you once again. Mostly for my own reference, I leave here a URL documenting the _service feature: https://en.opensuse.org/openSUSE:Bui..._SourceService

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •