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

fix: nodejs bindings build #706

Closed
wants to merge 3 commits into from
Closed

Conversation

perrin4869
Copy link
Contributor

hopefully this is the end of it 😅

@perrin4869 perrin4869 closed this May 21, 2024
@tdewolff
Copy link
Owner

Thanks for the effort, I've pushed out v2.20.26 and really hoping this is the end of it. Would really appreciate your feedback!

@perrin4869
Copy link
Contributor Author

hm... installing the npm package 2.20.26 on linux arm fails with an error:

npm ERR! code 1
npm ERR! path /codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! make: Entering directory '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify/build'
npm ERR!   ACTION Building Go library... minify.a
npm ERR! make[1]: Entering directory '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify'
npm ERR! go build -buildmode=c-archive -o minify.a minify.go
npm ERR! make[1]: Leaving directory '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify'
npm ERR! make: Leaving directory '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.1.0
npm ERR! gyp info using node@20.10.0 | linux | arm64
npm ERR! gyp info find Python using Python version 3.11.7 found at "/root/.pyenv/versions/3.11.7/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v20.10.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v20.10.0/SHASUMS256.txt
npm ERR! gyp info spawn /root/.pyenv/versions/3.11.7/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/20.10.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.10.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.10.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! minify.go:11:2: no required module provides package github.com/tdewolff/minify/v2: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:12:2: no required module provides package github.com/tdewolff/minify/v2/css: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:13:2: no required module provides package github.com/tdewolff/minify/v2/html: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:14:2: no required module provides package github.com/tdewolff/minify/v2/js: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:15:2: no required module provides package github.com/tdewolff/minify/v2/json: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:16:2: no required module provides package github.com/tdewolff/minify/v2/svg: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:17:2: no required module provides package github.com/tdewolff/minify/v2/xml: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! minify.go:18:2: no required module provides package github.com/tdewolff/parse/v2/buffer: go.mod file not found in current directory or any parent directory; see 'go help modules'
npm ERR! make[1]: *** [Makefile:18: compile] Error 1
npm ERR! make: *** [minify.target.mk:13: minify.a] Error 2
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 4.14.336-257.562.amzn2.aarch64
npm ERR! gyp ERR! command "/usr/local/bin/node" "/codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /codebuild/output/src2153160425/src/github.com/univapaycast/services-typescript/node_modules/@tdewolff/minify
npm ERR! gyp ERR! node -v v20.10.0
npm ERR! gyp ERR! node-gyp -v v10.1.0
npm ERR! gyp ERR! not ok

Maybe we can generate the go.mod file dynamically when publishing the npm package, with the correct versions?

tdewolff added a commit that referenced this pull request May 22, 2024
@tdewolff
Copy link
Owner

Yes, that's what I was thinking as well. Can you check v2.20.27? We'll get there eventually...

@perrin4869
Copy link
Contributor Author

oh I'm using the node bindings, not the python bindings 😅

@tdewolff
Copy link
Owner

Right, how about v2.20.28?

@perrin4869
Copy link
Contributor Author

I'm testing the CI right now! It installed perfectly, once it finishes I'll report back, so far so good 🙂
The only thing is, the Makefile is doing go mod init github.com/tdewolff/minify/bindings/py, but it should probably be go mod init github.com/tdewolff/minify/bindings/js instead? Seems to work either way though

@perrin4869
Copy link
Contributor Author

everything is fixed now!!! Thank you so much as always!!!!

tdewolff added a commit that referenced this pull request May 22, 2024
@tdewolff
Copy link
Owner

I'm happy to hear this is finally working!!! Thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants