Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from Jun 19, 2017

Conversation

morphis
Copy link
Contributor

@morphis morphis commented Jun 9, 2017

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

@codecov-io
Copy link

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.

Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 with some comments for your consideration

%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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed one of both.

GOFLAGS="-tags withtestkeys"
%endif

# We have to build snapd first to prevent the build from
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

# 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

GOFLAGS=
%if 0%{?with_test_keys}
GOFLAGS="-tags withtestkeys"
%endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you erasing the GOFLAGS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

%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=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mvo5 mvo5 merged commit 0309a02 into snapcore:master Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants