packaging: update arch packaging for 2.27 snapshot #3649

Merged
merged 2 commits into from Aug 7, 2017

Conversation

Projects
None yet
7 participants
Contributor

zyga commented Aug 2, 2017

This patch updates arch packaging a little bit:

  • switch to 2.27 master snapshot (bugfixes)
  • drop build-dependency on bzr
  • add dependency on libseccomp
  • build and install snapctl, snap-update-ns, snap-seccomp
  • link snap-seccomp to libseccomp dynamically
  • apply some fixes from master as patches
  • generate version earlier so that snapd sees it
  • pass packaging version to mkversion.sh (no guessing)
  • skip static analysis checks (wrong moment to run)
  • merge snap-confine into the snapd package
  • don't show arch release as "unknown"
  • ship the bash tab completion files
  • switch to dynamic pkgver (git snapshot)
  • don't use host's /etc/nsswitch.conf

Signed-off-by: Zygmunt Krynicki me@zygoon.pl

As Arch user, I can confirm this now builds and installs* properly.

* installation requires passing --force to pacman, at least if done manually, on my system that previously had some older community/snapd version installed.

$ snap version                    
snap    2.26.14.r1437.ge03706018-1
snapd   2.26.14
series  16
arch    unknown
kernel  4.12.3-1-ARCH
Contributor

zyga commented Aug 2, 2017

Note that after installing it you want to do:

systemctl daemon-reload
systemctl restart snapd

Otherwise you're still running the old code.

packaging: update arch packaging for 2.27 snapshot
This patch updates arch packaging a little bit:
 - switch to 2.27 master snapshot (bugfixes)
 - drop build-dependency on bzr
 - add dependency on libseccomp
 - build and install snapctl, snap-update-ns, snap-seccomp
 - link snap-seccomp to libseccomp dynamically
 - apply some fixes from master as patches
 - generate version earlier so that snapd sees it
 - pass packaging version to mkversion.sh (no guessing)
 - skip static analysis checks (wrong moment to run)
 - merge snap-confine into the snapd package
 - don't show arch release as "unknown"
 - ship the bash tab completion files
 - switch to dynamic pkgver (git snapshot)
 - don't use host's /etc/nsswitch.conf

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>

codecov-io commented Aug 2, 2017

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3649      +/-   ##
==========================================
- Coverage    75.2%   75.19%   -0.01%     
==========================================
  Files         387      387              
  Lines       33452    33452              
==========================================
- Hits        25157    25154       -3     
- Misses       6482     6485       +3     
  Partials     1813     1813
Impacted Files Coverage Δ
interfaces/sorting.go 97.43% <0%> (-2.57%) ⬇️
cmd/snap/cmd_aliases.go 93.33% <0%> (-1.67%) ⬇️

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 3df03f9...c4b67a2. Read the comment docs.

Contributor

zyga commented Aug 4, 2017

This will need slight adjustments as patches are landing in master (but that's the spirit) so that packaging becomes simpler and simpler.

-pkgname=(snapd snap-confine)
-pkgver=2.26.1
+pkgname=snapd
+pkgver=2.26.14.r1445.g3df03f98b
@morphis

morphis Aug 4, 2017

Contributor

Why do we hadd the git revision here? Should this be just plain 2.26.14 or better 2.27 as that is the upcoming next version?

@zyga

zyga Aug 4, 2017

Contributor

Because this is a pre-release snapshot. Note that this version is automatically updated by makepkg due to pkgver function below.

+source=("git+https://github.com/snapcore/$pkgname.git"
+ 'snapd.sh'
+ '0001-release-remove-default-from-VERSION_ID.patch'
+ '0001-cmd-snap-confine-don-t-share-etc-nsswitch-from-host.patch')
md5sums=('SKIP'
@morphis

morphis Aug 4, 2017

Contributor

What does the 'SKIP' mean here?

@zyga

zyga Aug 4, 2017

Contributor

It means that makepkg won't try to checksum the tarball coming out of git master (since it keeps moving)

@@ -36,23 +42,35 @@ prepare() {
# above describes.
mkdir -p "$(dirname "$GOPATH/src/${_gourl}")"
ln --no-target-directory -fs "$srcdir/$pkgname" "$GOPATH/src/${_gourl}"
+ # Patch snap-seccomp build flags not to link libseccomp statically.
+ sed -i -e 's/-Wl,-Bstatic -lseccomp -Wl,-Bdynamic/-lseccomp/' "$srcdir/$pkgname/cmd/snap-seccomp/main.go"
@morphis

morphis Aug 4, 2017

Contributor

Can we do this via a patch too? That would make this coherent.

@zyga

zyga Aug 4, 2017

Contributor

I need to explore this because ideally there'd be no patch necessary. If we can use some conditional hacks just fur Ubuntu 16.04 and not touch anything else I would have much less gray hair about this. For now it's easier to use sed rather than (potentially) redo the patch each time.

Once @mvo5 is back I'd like to simplify this and move the special casing to ubuntu packging.

@Conan-Kudo

Conan-Kudo Aug 6, 2017

Contributor

That would fix issues for Fedora, too. 👍

@@ -36,23 +42,35 @@ prepare() {
# above describes.
mkdir -p "$(dirname "$GOPATH/src/${_gourl}")"
ln --no-target-directory -fs "$srcdir/$pkgname" "$GOPATH/src/${_gourl}"
+ # Patch snap-seccomp build flags not to link libseccomp statically.
+ sed -i -e 's/-Wl,-Bstatic -lseccomp -Wl,-Bdynamic/-lseccomp/' "$srcdir/$pkgname/cmd/snap-seccomp/main.go"
+ # Apply some upstream fixes not present in the release.
@morphis

morphis Aug 4, 2017

Contributor

Can you add links to the proposed PRs? Makes it easier to track these.

@zyga

zyga Aug 4, 2017

Contributor

There's just one left, I was really hoping to just merge them all and get rid of this. The only kind of patches that we want to carry here (in snapd master, not in the actual packaging in arch git repos) is the one that doesn't need to carry patches since we can just apply those.

@@ -93,17 +120,20 @@ package_snapd() {
# Install the snapd socket and service for the main daemon
install -m 644 "$GOPATH/src/${_gourl}/data/systemd/snapd.service" "$pkgdir/usr/lib/systemd/system"
install -m 644 "$GOPATH/src/${_gourl}/data/systemd/snapd.socket" "$pkgdir/usr/lib/systemd/system"
- # Install snap and snapd executables
+ # Install snap, snapctl, snap-update-ns, snap-seccomp and snapd executables
@morphis

morphis Aug 4, 2017

Contributor

I would prefer not to list all binaries again in the comment as then we need to update it with every new added one and the comments gets bigger. Why not just "Install necessary exeutables for snapd"

@zyga

zyga Aug 4, 2017

Contributor

Yes, good point.

mvo5 approved these changes Aug 7, 2017

Thanks, this looks good.

@mvo5 mvo5 merged commit 653f17c into snapcore:master Aug 7, 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

@zyga zyga deleted the zyga:feature/improve-arch-package branch Aug 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment