Re: [pkg-go] [pkg-golang-devel] Security support for packages written in Go

2016-04-12 Thread Tianon Gravi
On 12 April 2016 at 21:39, Michael Hudson-Doyle
 wrote:
> We could do it without 1) and the consequent re-uploading of every go
> library by using dpkg-query --search a lot, which would be slow I
> guess, but maybe could be done as a fallback?

I still asking dpkg about file/directory package ownership should be
our primary means of generating this field -- the metadata that dpkg
itself tracks about "which package provided
/usr/share/gocode/src/abc/xyz which I just compiled against" will
always be correct (due to the fact that it really is the single proper
source of truth for such information), where some arbitrary metadata
we add not only clutters up the package metadata as has been
discussed, but much more importantly will have a tendency to "drift"
from the truth, which is something that IMO we shouldn't tolerate for
a field whose primary purpose is knowing when it's necessary to
rebuild, especially for security fixes.  Even for really large
packages like Docker (to choose an example that I know off the top of
my head is reasonably hefty WRT deps) we're only talking about maybe
~200 of these queries at the outside end, and only at build-time, and
only once per build, which IMO is in the realm of reasonable to avoid
yet again uploading a minor fix to every package (moving the metadata
over to the binary packages when we still haven't added the existing
source package metadata to all of them yet) with information that will
have a potential for drifting from the truth or for being too limited
(single package providing multiple namespaces after a repo move, for
example).

♥,
- Tianon
  4096R / B42F 6819 007F 00F8 8E36  4FD4 036A 9C25 BF35 7DD4

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Re: [pkg-go] Security support for packages written in Go

2016-04-12 Thread Florian Weimer
* Michael Hudson-Doyle:

> There is another approach to the static linking issue, which is to
> start using dynamic linking instead. It's implemented upstream for
> most architectures now (only mips64 le/be and ppc64 be missing I
> think). I'm going to be working on starting to use dynamic linking
> during the next cycle of Ubuntu development, and I'd certainly be
> interested in getting it going for Debian too. (the timeframes re:
> stretch release look reasonable for this).

Can you explain a bit more how dynamic linking would help us to
determine what we need to rebuild?

I expect that dynamic linking will complicate matters because we will
have to rebuild library packages in dependency order.  I don't see how
Go shared objects can provide a stable ABI.

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers


Re: [pkg-go] Security support for packages written in Go

2016-04-12 Thread Michael Hudson-Doyle
Bit of a late reply, been busy.

On 5 April 2016 at 19:27, Florian Weimer  wrote:
> Hi,
>
> we need to discuss how we can support applications written in Go for
> stretch.
>
> The most radical approach would be not to ship any Go applications in
> stretch, only the basic Go language implementations.  This is probably
> not desirable.

Yeah, probably not desirable. I think it makes sense to be fairly
selective about which Go applications are supported, though.

> So we need something to deal with the static linking issue.

There is another approach to the static linking issue, which is to
start using dynamic linking instead. It's implemented upstream for
most architectures now (only mips64 le/be and ppc64 be missing I
think). I'm going to be working on starting to use dynamic linking
during the next cycle of Ubuntu development, and I'd certainly be
interested in getting it going for Debian too. (the timeframes re:
stretch release look reasonable for this).

> The current state seems to be that -dev packages do not contain object
> code.  This means that they can be built in any admissible order (as
> determined by their (versioned) build dependencies), without altering
> the end result, which simplifies matters somewhat (but see below).
>
> One approach would be to ship applications as source code only (just
> like libraries), and compile them locally upon installation.  This is
> what Emacs and Common Lisp implementations already do.  With the
> growth of Go compilation and link times, this seems less and less
> attractive, though.

Uh yeah, let's not do this (it also means that any system that wants
to use a Go binary needs a Go development environment installed).

> The alternative is to rebuild reverse dependencies as needed.  I can
> see two challenges with that.  Right now, the Built-Using field only
> records the source versions of the *direct* dependencies (based on the
> dh_golang manual page and a few examples I looked at).

Yeah, that seems like a bug, basically, given my understanding of what
Built-Using is supposed to mean.

Summarising other posts in the thread, it seems the sanest fix for
this goes along the lines of:

1) Change all binary golang-*-dev packages to have a Go-Import-Path
control field (dh_golang can probably add this?)
2) Change dh_golang to use "go list -f {{ .Deps }}" and "dpkg-query -W
-f '${Go-Import-Path}' golang-*-dev" and some perl to generate a
better Built-Using.

We could do it without 1) and the consequent re-uploading of every go
library by using dpkg-query --search a lot, which would be slow I
guess, but maybe could be done as a fallback?

Someone (tm) should file a bug about this, if there is not one already.

> If a critical
> update happens farther down the dependency chain, a tool based on
> Built-Using will not mark the top-level package as a rebuild
> candidate.  When performing the rebuild, it is possible to compensate
> for that by rebuilding everything that has an outdated Go source
> package in its Build-Using field, iteratively, until we reach a
> fixpoint.  But this does not currently work because the -dev packages
> do not contain Built-Using information.

And -dev packages should not really contain Built-Using information...

> But this requires that the source package version changes as a result
> of the rebuild.  I'm not sure if this is what happens.  Ideally, we
> want to do this with binNMUs, not sourceful uploads.

I'm mostly an Ubuntu developer so obviously all uploads change the
source package version :-)

> We may also need
> some build ordering optimization to avoid redundant rebuilds.  This
> means that the fact that the -dev packages contain no object files is
> of little practical consequence: The optimization would have to order
> the builds in the same way as if they did contain object code.  But
> maybe the optimization is not needed.

It would be interesting to check out some imaginary situations (e.g. a
security fix in golang-golang-x-crypto) and see how much this matters
in practice. My suspicion is not all that much, but who knows.

> It does not seem possible to determine rebuild candidates based on
> Built-Using alone, building the transitive closure after the fact.  It
> may have changed between the original application build and subsequent
> library builds.

Yes. So let's fix the problem in the right place :-)

> Unrelated to all that, we cannot currently perform binNMUs in the
> security archive because it does not contain a completely copy of the
> main archive.  I'm not sure if there are good approaches to deal with
> this yet.

Cheers,
mwh

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers


[pkg-go] golang-github-masterzen-xmlpath_0.0~git20140218.13f4951-1_amd64.changes is NEW

2016-04-12 Thread Debian FTP Masters
binary:golang-github-masterzen-xmlpath-dev is NEW.
source:golang-github-masterzen-xmlpath is NEW.

Your package has been put into the NEW queue, which requires manual action
from the ftpteam to process. The upload was otherwise valid (it had a good
OpenPGP signature and file hashes are valid), so please be patient.

Packages are routinely processed through to the archive, and do feel
free to browse the NEW queue[1].

If there is an issue with the upload, you will receive an email from a
member of the ftpteam.

If you have any questions, you may reply to this email.

[1]: https://ftp-master.debian.org/new.html

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers


[pkg-go] Processing of golang-github-masterzen-xmlpath_0.0~git20140218.13f4951-1_amd64.changes

2016-04-12 Thread Debian FTP Masters
golang-github-masterzen-xmlpath_0.0~git20140218.13f4951-1_amd64.changes 
uploaded successfully to localhost
along with the files:
  golang-github-masterzen-xmlpath_0.0~git20140218.13f4951-1.dsc
  golang-github-masterzen-xmlpath_0.0~git20140218.13f4951.orig.tar.xz
  golang-github-masterzen-xmlpath_0.0~git20140218.13f4951-1.debian.tar.xz
  golang-github-masterzen-xmlpath-dev_0.0~git20140218.13f4951-1_all.deb

Greetings,

Your Debian queue daemon (running on host franck.debian.org)

___
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers