Hugo: Investigate if we can build the snaps statically

Created on 25 Mar 2018  路  3Comments  路  Source: gohugoio/hugo

This was made by someone in Cannocial:

https://github.com/gohugoio/hugo/blob/master/snapcraft.yaml

Building Hugo as a statically linked binary should fix the issue described in https://discourse.gohugo.io/t/hugos-snap-stopped-working/11184/26

It will create a bigger binary, but it is better than a broken binary.

This is how we build the binaries for the GitHub release:

https://github.com/gohugoio/hugo/blob/master/goreleaser.yml#L6

/cc @elopio @anthonyfok

Most helpful comment

Thanks for bringing this to my attention.

And my apologies: I _did_ change something:

I was trying to fix some failed-to-build problems in 0.38-DEV as may be seen here:

Suspecting that it might had to do with the somewhat outdated go1.6 in Ubuntu Xenial (16.04 LTS), I experimented and eventually discovered that changing the "Distribution series" (from Ubuntu Xenial (16.04 LTS) to Ubuntu Artful (17.10) did the trick, and applied the same to the stable series at https://launchpad.net/~gohugoio/+snap/hugo

Unfortunately, as it turned out, that changed caused the following error as reported in the Hugo discussion forum:

/snap/hugo/1455/bin/hugo: relocation error: /snap/hugo/1455/lib/x86_64-linux-gnu/libpthread.so.0: symbol __mmap, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

which turns out even I can reproduce. My sincere apologies for causing all the trouble.

I went to https://launchpad.net/~gohugoio/+snap/hugo and changed it back to Ubuntu Xenial, and the latest revision of Hugo snap (e.g. revision 1462 for amd64) works correctly again. I guess that solves this issue? :-D

All 3 comments

Hey @bep. I'm no longer working on snapcraft, but my friends @popey and @flexiondotorg can give you a hand.

Thanks for bringing this to my attention.

And my apologies: I _did_ change something:

I was trying to fix some failed-to-build problems in 0.38-DEV as may be seen here:

Suspecting that it might had to do with the somewhat outdated go1.6 in Ubuntu Xenial (16.04 LTS), I experimented and eventually discovered that changing the "Distribution series" (from Ubuntu Xenial (16.04 LTS) to Ubuntu Artful (17.10) did the trick, and applied the same to the stable series at https://launchpad.net/~gohugoio/+snap/hugo

Unfortunately, as it turned out, that changed caused the following error as reported in the Hugo discussion forum:

/snap/hugo/1455/bin/hugo: relocation error: /snap/hugo/1455/lib/x86_64-linux-gnu/libpthread.so.0: symbol __mmap, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference

which turns out even I can reproduce. My sincere apologies for causing all the trouble.

I went to https://launchpad.net/~gohugoio/+snap/hugo and changed it back to Ubuntu Xenial, and the latest revision of Hugo snap (e.g. revision 1462 for amd64) works correctly again. I guess that solves this issue? :-D

I can confirm that the fix worked for me. Thanks @anthonyfok.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moorereason picture moorereason  路  3Comments

geddski picture geddski  路  3Comments

mariusa picture mariusa  路  3Comments

digitalcraftsman picture digitalcraftsman  路  3Comments

VoidingWarranties picture VoidingWarranties  路  3Comments