packaging/{opensuse,fedora}: allow package build with testkeys included #3450

Merged
merged 7 commits into from Jun 19, 2017

Conversation

Projects
None yet
5 participants
Contributor

morphis commented Jun 9, 2017

Special build with test keys enabled is necessary for a few spread tests.

Simon Fels added some commits Jun 8, 2017

codecov-io commented Jun 9, 2017

Codecov Report

Merging #3450 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3450      +/-   ##
==========================================
- Coverage   77.15%   77.14%   -0.01%     
==========================================
  Files         373      373              
  Lines       25793    25793              
==========================================
- Hits        19901    19899       -2     
- Misses       4134     4136       +2     
  Partials     1758     1758
Impacted Files Coverage Δ
interfaces/sorting.go 90% <0%> (-3.34%) ⬇️
cmd/snap/cmd_aliases.go 94% <0%> (-2%) ⬇️
overlord/ifacestate/helpers.go 65.54% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8064fa0...1320943. Read the comment docs.

zyga approved these changes Jun 9, 2017

+1 with some comments for your consideration

packaging/fedora/snapd.spec
-%gobuild -o bin/snapctl %{import_path}/cmd/snapctl
-%gobuild -o bin/snapd %{import_path}/cmd/snapd
-%gobuild -o bin/snap-update-ns %{import_path}/cmd/snap-update-ns
+# We have to build snapd first to prevent the build from
@zyga

zyga Jun 9, 2017

Contributor

The comment seems to be copy pasted, is this intended?

@morphis

morphis Jun 12, 2017

Contributor

Removed one of both.

packaging/fedora/snapd.spec
+GOFLAGS="-tags withtestkeys"
+%endif
+
+# We have to build snapd first to prevent the build from
@zyga

zyga Jun 9, 2017

Contributor

I don't think anything else cares about test keys, if that lets you simplify things, go for it!

packaging/opensuse-42.2/snapd.spec
+# so we we have to invoke `go install` here manually.
+export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib
+export GOBIN=%{_builddir}/go/bin
+go install -s -v -p 4 -x -tags withtestkeys github.com/snapcore/snapd/cmd/snapd
@zyga

zyga Jun 9, 2017

Contributor

Nitpick, can you use long forms or document the meaning of the switches above in a comment, for the next reader?

@morphis

morphis Jun 9, 2017

Contributor

You mean for -x -v -p 4 -x

@morphis

morphis Jun 12, 2017

Contributor

Done.

packaging/fedora/snapd.spec
+GOFLAGS=
+%if 0%{?with_test_keys}
+GOFLAGS="-tags withtestkeys"
+%endif
@Conan-Kudo

Conan-Kudo Jun 9, 2017

Contributor

Why are you erasing the GOFLAGS?

@morphis

morphis Jun 12, 2017

Contributor

Fixed

Simon Fels added some commits Jun 12, 2017

-%gobuild -o bin/snapctl %{import_path}/cmd/snapctl
-%gobuild -o bin/snapd %{import_path}/cmd/snapd
-%gobuild -o bin/snap-update-ns %{import_path}/cmd/snap-update-ns
+GOFLAGS=
@Conan-Kudo

Conan-Kudo Jun 17, 2017

Contributor

You're still erasing the GOFLAGS here... :(

@morphis

morphis Jun 19, 2017

Contributor

Who else uses GOFLAGS? Nothing in the spec file does and nothing of the RPM golang macros does.

mvo5 approved these changes Jun 19, 2017

LGTM

@mvo5 mvo5 merged commit 0309a02 into snapcore:master Jun 19, 2017

7 checks passed

artful-amd64 autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
xenial-i386 autopkgtest finished (success)
Details
xenial-ppc64el autopkgtest finished (success)
Details
yakkety-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment