~mvo/snapd/+git/snapd-mvo:use-go-buildid

Last commit made on 2019-04-29
Get this branch:
git clone -b use-go-buildid https://git.launchpad.net/~mvo/snapd/+git/snapd-mvo

Branch merges

Branch information

Name:
use-go-buildid
Repository:
lp:~mvo/snapd/+git/snapd-mvo

Recent commits

1efc757... by Maciej Borzecki

osutil: update tests to workaround hexstring build ID format

Signed-off-by: Maciej Borzecki <email address hidden>

2452c4d... by Maciej Borzecki

osutil: tweak build ID tests to account for too-old 'file'

The host's 'file' comamnd may be to old to be aware of Go BuildID, in which
case, the unit tests will fail. Work around that by forcing a specific Go build
ID via -ldflags=-buildid=.. For consistency, add a test for a fixed GNU BuildID
too.

Signed-off-by: Maciej Borzecki <email address hidden>

d284d90... by Maciej Borzecki

osutil: tweak ReadBuildID() comment

Signed-off-by: Maciej Borzecki <email address hidden>

a59c2d4... by Maciej Borzecki

osutil: log 'file' output in test

Try to debug the issue appearing on Travis where a unit test failure like this
appears:

FAIL: buildid_test.go:107: buildIDSuite.TestReadBuildGo

buildid_test.go:122:
    c.Assert(string(decoded), Equals, buildID(c, goTruth))
buildid_test.go:53:
    c.Assert(matches, HasLen, 3)
... obtained []string = []string(nil)
... n int = 3

Signed-off-by: Maciej Borzecki <email address hidden>

9a7d163... by Michael Vogt

osutil: add constants for {go,gnu}ElfNote

3d5ba1f... by Michael Vogt

osutil: do not use `go tool builid` in the tests, it is only available since go1.10

d863674... by Michael Vogt

osutil: use go build-id when no gnu build-id is available

The go compiler will only create a GNU build-id when either
build with -buildmode=pie or when we have a `import "C"`
somewhere. We do not use -buildmode=pie on 32bit systems
and with PR#6759 we will stop using cgo (`import "C"`) soon.

This means that we have no GNU build-id in our binaries
anymore on some sytems. The build-id is criticial for the
system-key generation. Fortunately go also provides a
build-id that we can use. It is available since at least
go-1.6 so should cause no problems. Its longer than the
GNU build id (~50 bytes) but not unwieldy.

96bf0ef... by Michael Vogt

Merge pull request #6773 from jdstrand/fix-is-valid-username

osutil: make IsValidUsername public and fix regex

ba027a7... by Jamie Strandboge

osutil: make IsValidUsername public and fix regex

The old regex, `^[a-z0-9][-a-z0-9+.-_]*$`, had a bug in it where it
would accept any character within the range of '.-_' where 'a:b'
would match since '.' < ':' < '_' in the ASCII table.

Make IsValidUsername public since it makes adding tests easier and
subsequent commits will use this.

6dbb46a... by Michael Vogt

Merge pull request #6716 from pedronis/serialize-session-acquisition

store: serialize the acquisition of device sessions