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

install necessary packages for using a CGO-extension compiled version of Hugo #183

Closed
fool opened this Issue Jul 10, 2018 · 18 comments

Comments

Projects
None yet
@fool
Copy link
Member

fool commented Jul 10, 2018

When attempting to run a new hugo build, it seems we are missing some dependencies:

6:20:18 PM: Executing user command: ./hugo --config paceup.com.toml,config.toml
6:20:18 PM: ./hugo: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./hugo)
6:20:18 PM: ./hugo: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./hugo)

We need to install whatever is needed here :)

@regisphilibert

This comment has been minimized.

Copy link

regisphilibert commented Jul 24, 2018

Untill then it’s hard to mention Netlify (let alone use it) alongside Hugo Pipes... too bad because speeding up deployement is among the big pros 😔

@DirtyF

This comment has been minimized.

Copy link
Contributor

DirtyF commented Jul 24, 2018

@regisphilibert for now you have to commit generated resourcesas @bep shows on https://hugoscss.netlify.com/ 😲

@regisphilibert

This comment has been minimized.

Copy link

regisphilibert commented Jul 24, 2018

@DirtyF this repo commits its resources directory. For me tt’s really not ideal if the assets can be edited by an editor.

@oncletom

This comment has been minimized.

Copy link

oncletom commented Jul 24, 2018

@regisphilibert my understanding is commiting the resources folder is only a workaround solution whilst this PR has not landed. Once it is the case, I think Hugo resources.ToCSS will work as expected.

Is that correct?

@regisphilibert

This comment has been minimized.

Copy link

regisphilibert commented Jul 24, 2018

@brycekahle

This comment has been minimized.

Copy link
Contributor

brycekahle commented Jul 31, 2018

Appears it was intended to be a dynamically linked binary: gohugoio/hugo#4985

brycekahle added a commit that referenced this issue Jul 31, 2018

@jensamunch

This comment has been minimized.

Copy link

jensamunch commented Aug 1, 2018

this doesn't work still for hugo 0.46

what is the best thread for tracking this issue and netlify using the extended version?

@brycekahle

This comment has been minimized.

Copy link
Contributor

brycekahle commented Aug 1, 2018

@jensamunch This issue is tracking it.

@fool

This comment has been minimized.

Copy link
Member Author

fool commented Aug 1, 2018

hugo 0.46 works well for me - just can't use the extended version, right @jensamunch ?

@oncletom

This comment has been minimized.

Copy link

oncletom commented Aug 7, 2018

I did not fully grasp why installing this specific version of libstdc++ solves the problem but this message on Hugo forums explains how to install a version of libstdc++ which is picked up by Hugo and works with the extended build: https://discourse.gohugo.io/t/solved-hugo-v44-extended-and-relocation-errors-on-travis/13029/5

@baublet

This comment has been minimized.

Copy link

baublet commented Aug 24, 2018

Ping for visibility. As of Hugo 0.47.1, extended still won't work on Netlify due to two reasons:

  1. The default binary Netlify uses is not the extended binary
  2. The Netlify image needs the required dependencies (see @oncletom's comment above) to run the extended binary.

To those looking for a workaround until this is fixed:

Run hugo locally with the extended version, then check in your resources/_gen/assets directory to the repository so that Hugo skips trying to generate the assets.

bahlo added a commit to bahlo/blog that referenced this issue Aug 29, 2018

snithish added a commit to snithish/blog that referenced this issue Aug 30, 2018

snithish added a commit to snithish/blog that referenced this issue Aug 30, 2018

@sshesh

This comment has been minimized.

Copy link

sshesh commented Sep 5, 2018

I installed hugo through snap and a recent version (0.47.1) works well for me.

$ snap list
Name Version Rev Tracking Publisher Notes
core 16-2.35 5328 stable canonical* core
hugo 0.47.1 2590 stable hugo-authors -

@igk1972

This comment has been minimized.

Copy link
Contributor

igk1972 commented Sep 6, 2018

Fast workaround for Hugo extended version.

package.json

{
    // ...
    "scripts": {
      "build": "NF_IMAGE_VERSION=1 bash ./netlify-build-fix.sh && LD_LIBRARY_PATH=$(pwd)/tmp/usr/lib/x86_64-linux-gnu $(pwd)/tmp/usr/local/bin/hugo",
      // ...
    },
   //  ...
}

netlify-build-fix.sh

#!/bin/bash

HUGO_FLAVOUR="hugo_extended"
HUGO_VERSION="0.48"

[ -z "${NF_IMAGE_VERSION}" ] && exit 0

rm -fr *.deb 
wget --no-clobber http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.10_amd64.deb || exit 1
wget --no-clobber https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_FLAVOUR}_${HUGO_VERSION}_Linux-64bit.deb || exit 1
grep "hugo=" ~/.bashrc || echo "alias hugo='LD_LIBRARY_PATH=$(pwd)/tmp/usr/lib/x86_64-linux-gnu $(pwd)/tmp/usr/local/bin/hugo'" >> ~/.bashrc 
find -name '*.deb' -exec dpkg -x {} $(pwd)/tmp \;
rm -fr *.deb

exit 0
@bep

This comment has been minimized.

Copy link

bep commented Sep 14, 2018

Doing ldd --version in a Netlify script gets this:

ldd (Ubuntu EGLIBC 2.19-0ubuntu6.13) 2.19
12:28:30 AM: Copyright (C) 2014 Free Software Foundation, Inc.
12:28:30 AM: This is free software; see the source for copying conditions.  There is NO
12:28:30 AM: warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12:28:30 AM: Written by Roland McGrath and Ulrich Drepper.

This is a Ubuntu from 4 years+ ago. Debian and Ubuntu have since moved from EGLIBC to GLIBC -- which should work fine with the extended Hugo version. If not, let me know and I will look into it quickly from the Hugo side of it.

/cc @biilmann

@fool

This comment has been minimized.

Copy link
Member Author

fool commented Sep 15, 2018

@fool

This comment has been minimized.

Copy link
Member Author

fool commented Sep 25, 2018

To summarize the currently available workarounds:

  1. recommended, follow bep's advice here: https://discourse.gohugo.io/t/netlify-and-hugo-pipes/13145 - summarized in the thread on this issue here: #183 (comment)
  2. not recommended but may work for you: #183 (comment)

RealOrangeOne added a commit to RealOrangeOne/theorangeone.net that referenced this issue Oct 5, 2018

RealOrangeOne added a commit to RealOrangeOne/theorangeone.net that referenced this issue Oct 5, 2018

RealOrangeOne added a commit to RealOrangeOne/theorangeone.net that referenced this issue Oct 5, 2018

Pl4nty pushed a commit to Pl4nty/tplant.com.au that referenced this issue Nov 17, 2018

ZachGlassman added a commit to ZachGlassman/personal-site that referenced this issue Nov 23, 2018

newsch added a commit to newsch/newsch.github.io that referenced this issue Nov 23, 2018

bnjmn added a commit to bnjmn/bp.com that referenced this issue Dec 27, 2018

Commit resource dir to make netlify work
Currently netlify does not support the extended version of hugo. In
order to make the build work, we are committing the resources that are
built locally. The netlify build will then use these files as a cache
and not need to run the `ToCSS` command which is currently failing.

See: netlify/build-image#183

@gcushen gcushen referenced this issue Jan 29, 2019

Open

Restructure CSS as SASS #680

0 of 6 tasks complete
@bcomnes

This comment has been minimized.

Copy link
Member

bcomnes commented Feb 16, 2019

Since this is solved in the xenial image and isn't easily solvable in the trusty image, I'm going to close this issue. We should have that image out to everyone soonish.

@bcomnes bcomnes closed this Feb 16, 2019

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