[pkg-go] Building and distributing Go packages as shared libraries

Michael Stapelberg stapelberg at debian.org
Thu Oct 30 07:14:35 UTC 2014

On Thu, Oct 30, 2014 at 2:02 AM, Michael Hudson-Doyle
<michael.hudson at canonical.com> wrote:
> Michael Stapelberg <stapelberg at debian.org> writes:
>> On Wed, Oct 29, 2014 at 8:46 AM, Michael Hudson-Doyle
>> <michael.hudson at canonical.com> wrote:
>>> Hi there,
>>> I'm Michael, I work for Canonical and very soon I'm going to be working
>>> on implementing shared libraries for the gc toolchain.  The reason
>>> Canonical is getting me to work on this is that we want to distribute
>>> applications written in Go as part of Ubuntu and be able to deliver
>>> updates to them and the components they depend on in a way that's more
>>> familiar to the security team and others who do this sort of thing.
>> That was also the reason which was stated when the discussion about
>> “do we want static or shared linking of go packages” in Debian
>> happened. To this day, I’m not convinced that it’s a good reason :).
> Well, Canonical appears to be happy to pay me to find out...
>>> As your name is on https://wiki.debian.org/MichaelStapelberg/GoPackaging
>>> (and this even says "in case go supports shared libraries") I thought
>>> I'd send you an email to ask if you've thought much about how this might
>>> work in practice, or if not, if you have time to bounce some ideas
>>> around with me.  Obviously there are toolchain changes needed, but those
>> The state of the world hasn’t changed since I wrote that package as
>> far as I’m concerned — but I haven’t been following Go upstream
>> closely except for enjoying the new features.
> No, I don't think the state of the world has changed here.
>>> are the fun technical bit :) I think I'm a bit more concerned right now
>>> about the build system side: the changes to the go tool and making sure
>>> that dh-golang can make use of them.
>>> I'm planning on following Ian Lance Taylor's document at
>>> https://docs.google.com/document/d/1nr-TQHw_er6GOQRsF6T43GGhFDelrAP0NqSS_00RgZQ/edit
>> I’ve read that document, and I don’t see an execution mode that
>> describes “all go modules built as a shared library”. The shared
>> library parts of the document refer to plugin interfaces AFAICT, which
>> seems more specific than what you’re talking about.
> The -buildmode=shared and the -linkshared flags are the interesting ones
> for this I think.
> FWIW, I'm working on a proposal to send to golang-dev, you can see it
> here for now:
> https://docs.google.com/a/canonical.com/document/d/1lORuq0X5zPFPH0atUl6QNgBkrjjsFd0C8330kjgFW8c/pub
>>> I guess the things I'm most unsure of at this point are:
>>>  1) Where the shared objects will end up on the file system, and
>>>  2) The usual shared library fun of things being compiled in one place
>>>     in the knowledge that they will end up somewhere else.
>>> Anyway, I've probably rambled a bit much, I just wanted to let you know
>>> that I'm working on this and I'm interested in your input.  I hope
>>> you're interested in this topic too :)
>> I appreciate that you contacted me early on, so thanks for that.
> No worries, thanks for replying!
>> However, I also have to mention that my involvement in Debian is
>> gradually shrinking for multiple reasons, and I’ve never been able to
>> implement much of the plans I’ve had for pkg-go.
> Fair enough.  Do you know of anyone else who cares about packaging Go in
> Debian who might be interested in this?
Unfortunately not. Check the list archives on pkg-go-maintainers, not
much is happening there…

>> Therefore, don’t expect more collaboration than the bare minimum my
>> current spare time permits. That said, I don’t want to be a blocker
>> for your work, so I hope I can mostly get out of the way :).
> Heh thanks.  I may have some questions about/patches for dh-golang at
> some point I guess...
> Cheers,
> mwh

Best regards,

More information about the Pkg-go-maintainers mailing list