microsoft / microsoft/node-spdlog

Won't build on Alpine 3.19 and above

Open
#55 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
58
Forks
30
Avg merge
3d 23h
Merged PRs (30d)
3

Description

beatit:~# npm i -g @vscode/spdlog
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/@vscode/spdlog
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Entering directory '/usr/local/lib/node_modules/@vscode/spdlog/build'
npm ERR!   TOUCH Release/obj.target/node_modules/node-addon-api/node_addon_api_except.stamp
npm ERR!   CXX(target) Release/obj.target/spdlog/src/main.o
npm ERR!   CXX(target) Release/obj.target/spdlog/src/logger.o
npm ERR!   SOLINK_MODULE(target) Release/obj.target/spdlog.node
npm ERR! make: Leaving directory '/usr/local/lib/node_modules/@vscode/spdlog/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@20.15.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.11.14 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/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 '/usr/local/lib/node_modules/@vscode/spdlog/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/20.15.1/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.15.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.15.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/@vscode/spdlog',
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! /usr/include/fortify/stdio.h: In function 'snprintf_float.constprop.isra':
npm ERR! /usr/include/fortify/stdio.h:114:27: error: inlining failed in call to 'always_inline' 'snprintf': function body can be overwritten at link time
npm ERR!   114 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
npm ERR!       |                           ^
npm ERR! ../deps/spdlog/include/spdlog/fmt/bundled/format.h:1609:36: note: called from here
npm ERR!  1609 |                      ? snprintf_ptr(begin, capacity, format, precision, value)
npm ERR!       |                                    ^
npm ERR! /usr/include/fortify/stdio.h:114:27: error: inlining failed in call to 'always_inline' 'snprintf': function body can be overwritten at link time
npm ERR!   114 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
npm ERR!       |                           ^
npm ERR! ../deps/spdlog/include/spdlog/fmt/bundled/format.h:1610:36: note: called from here
npm ERR!  1610 |                      : snprintf_ptr(begin, capacity, format, value);
npm ERR!       |                                    ^
npm ERR! make[1]: *** [/tmp/ccFAGFGK.mk:14: /tmp/cccbOpoA.ltrans4.ltrans.o] Error 1
npm ERR! make[1]: *** Waiting for unfinished jobs....
npm ERR! In function 'snprintf_float',
npm ERR!     inlined from 'write' at ../deps/spdlog/include/spdlog/fmt/bundled/format.h:3214:19:
npm ERR! /usr/include/fortify/stdio.h:114:27: error: inlining failed in call to 'always_inline' 'snprintf': function body can be overwritten at link time
npm ERR!   114 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
npm ERR!       |                           ^
npm ERR! ../deps/spdlog/include/spdlog/fmt/bundled/format.h:1609:36: note: called from here
npm ERR!  1609 |                      ? snprintf_ptr(begin, capacity, format, precision, value)
npm ERR!       |                                    ^
npm ERR! /usr/include/fortify/stdio.h:114:27: error: inlining failed in call to 'always_inline' 'snprintf': function body can be overwritten at link time
npm ERR!   114 | _FORTIFY_FN(snprintf) int snprintf(char *__s, size_t __n,
npm ERR!       |                           ^
npm ERR! ../deps/spdlog/include/spdlog/fmt/bundled/format.h:1610:36: note: called from here
npm ERR!  1610 |                      : snprintf_ptr(begin, capacity, format, value);
npm ERR!       |                                    ^
npm ERR! make[1]: *** [/tmp/ccFAGFGK.mk:5: /tmp/cccbOpoA.ltrans1.ltrans.o] Error 1
npm ERR! lto-wrapper: fatal error: make returned 2 exit status
npm ERR! compilation terminated.
npm ERR! /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: error: lto-wrapper failed
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make: *** [spdlog.target.mk:142: Release/obj.target/spdlog.node] Error 1
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> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 6.6.116-0-lts
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/@vscode/spdlog
npm ERR! gyp ERR! node -v v20.15.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok

Steps to reproduce:

  1. Install Alpine Linux 3.19 or above
  2. Install dependencies: apk add python3 krb5-dev alpine-sdk bash libstdc++ libc6-compat nodejs npm yarn
  3. Attempt to install @vscode/spdlog

Installing fmt and spdlog from package repos does not change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure on Alpine 3.19 or later using the listed apk dependencies and npm i -g @vscode/spdlog. Start with binding.gyp and the native build output around deps/spdlog/include/spdlog/fmt/bundled/format.h; identify the Alpine compiler or linker incompatibility. Done means the package builds and installs successfully on the affected Alpine versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, node.js
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.