ipfs / distributions

Legacy dist.ipfs.tech website and artifact build tools. Currently only used for notarizing builds of Kubo and IPFS Cluster.
https://dist.ipfs.tech
MIT License
48 stars 32 forks source link

Hugo build does not work #338

Closed hsanjuan closed 3 years ago

hsanjuan commented 3 years ago
 dist.ipfs.io@1.0.0 build:hugo /home/hector/ipn/distributions
> hugo --quiet -s site -d ../releases

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn /home/hector/ipn/distributions/node_modules/hugo-bin/vendor/hugo ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    [... lines matching original stack trace ...]
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dist.ipfs.io@1.0.0 build:hugo: `hugo --quiet -s site -d ../releases`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dist.ipfs.io@1.0.0 build:hugo script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/hector/.npm/_logs/2021-04-07T10_19_19_628Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dist.ipfs.io@1.0.0 build: `npm run dist && npm run build:assets && npm run build:hugo`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dist.ipfs.io@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/hector/.npm/_logs/2021-04-07T10_19_19_643Z-debug.log

I guess this is my fault for not having some very concrete version of node/npm that knows how to install things in a very concrete way that knows where it itself places its own binaries?

Why is javascript ecosystem so broken?

hsanjuan commented 3 years ago

It seems running npm install hugo-bin actually puts hugo in the right place. Don't ask me why the deps script which runs npm install does not do it.

Stebalien commented 3 years ago

What command did you run? It seems like we need to explicitly run hugo instead of relying on the path.

hsanjuan commented 3 years ago

make publish.

hugo was not installed at all in node_modules/hugo-bin/vendor/hugo. It only appeared there after doing npm install hugo-bin manually. But deps_check.sh already does npm install --no-audit --progress=false and.. ohhh hugo-bin is in devDependencies, not in dependencies. Perhaps that is why it does not get installed?

Stebalien commented 3 years ago

I can't reproduce. The make deps target (run by make publish, make site, etc.) installs hugo into node_modules/.bin/.

hsanjuan commented 3 years ago

installs hugo into node_modules/.bin/. <- thats not the hugo binary, that is a javascript script that runs the hugo binary, which should live in node_modules/hugo-bin/vendor/hugo.

(I learned it the hard way by symlinking that to node_modules/hugo-bin/vendor/hugo).

Stebalien commented 3 years ago

Hm. I'm still seeing node_modules/hugo-bin/vendor/hugo. I've re-cloned, uninstalled hugo, deleted all my node caches, etc.

Maybe something was dirty? What version of npm are you using?

Stebalien commented 3 years ago

Maybe https://github.com/ipfs/distributions/pull/341 helps?

Stebalien commented 3 years ago

@hsanjuan it's sounding like you're using a pretty old version of node (likely due to Debian's "never update anything" policy).

hsanjuan commented 3 years ago

I use OpenSuSE and I have all the versions. :)

I guess old npm or something was just buggy.