<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>51743</bug_id>
          
          <creation_ts>2024-10-17 17:43:12 +0300</creation_ts>
          <short_desc>Не работает команда `node-gyp rebuild`</short_desc>
          <delta_ts>2026-10-20 09:48:34 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Branch p11</product>
          <component>node-gyp</component>
          <version>unspecified</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Makeenkov">amakeenk</reporter>
          <assigned_to name="Vitaly Lipatov">lav</assigned_to>
          <cc>kozhevnikovvs</cc>
    
    <cc>lav</cc>
    
    <cc>obidinog</cc>
    
    <cc>sychkinsv</cc>
          
          <qa_contact name="qa-p11@altlinux.org">qa-p11</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>253139</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2024-10-17 17:43:12 +0300</bug_when>
    <thetext>Версия пакета:
node-gyp-10.1.0-alt1

Шаги воспроизведения:
```
# apt-get install node-gyp npm node-addon-api
$ npm install bindings

$ cat &gt; binding.gyp &lt;&lt;EOF
{
  &quot;targets&quot;: [
    { 
      &quot;cflags!&quot;: [ &quot;-fno-exceptions&quot; ],
      &quot;cflags_cc!&quot;: [ &quot;-fno-exceptions&quot; ],
      &quot;include_dirs&quot; : [
        &quot;&lt;!@(node -p \&quot;require(&apos;node-addon-api&apos;).include\&quot;)&quot;
      ],
      &quot;target_name&quot;: &quot;hello_world&quot;,
      &quot;sources&quot;: [ &quot;hello_world.cc&quot; ],
      &apos;defines&apos;: [ &apos;NAPI_DISABLE_CPP_EXCEPTIONS&apos; ]
    }
  ]
}
EOF

$ cat &gt; hello_world.cc &lt;&lt;EOF
#include &lt;napi.h&gt;

Napi::String SayHi(const Napi::CallbackInfo&amp; info) {
  Napi::Env env = info.Env();

  return Napi::String::New(env, &quot;Hi!&quot;);
}

Napi::Object init(Napi::Env env, Napi::Object exports) {
    exports.Set(Napi::String::New(env, &quot;sayHi&quot;), Napi::Function::New(env, SayHi));
    return exports;
};

NODE_API_MODULE(hello_world, init);
EOF

$ cat &gt; main.js &lt;&lt;EOF
const hello_world = require(&apos;bindings&apos;)(&apos;hello_world&apos;)

console.log(hello_world.sayHi());
EOF

$ node-gyp configure
$ node-gyp build
$ node main.js
$ node-gyp rebuild
```

Получаемый результат:
```
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@10.1.0
gyp info using node@20.17.0 | linux | x64
gyp info find Python using Python version 3.12.7 found at &quot;/usr/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:48:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:35:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.6.56-un-def-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/usr/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /home/test/q
gyp ERR! node -v v20.17.0
gyp ERR! node-gyp -v v10.1.0
gyp ERR! not ok 
```

Выполнение configure не помогает, ошибка с таким же сообщением всё равно остаётся.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>278978</commentid>
    <comment_count>1</comment_count>
    <who name="obidinog@basealt.ru">obidinog</who>
    <bug_when>2025-12-12 14:53:04 +0300</bug_when>
    <thetext>Актуально для 
node-gyp-11.0.0-alt1
node-22.19.0-alt1

gyp info it worked if it ends with ok
gyp info using node-gyp@11.0.0
gyp info using node@22.19.0 | linux | x64
gyp info find Python using Python version 3.13.11 found at &quot;/usr/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:49:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:36:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.12.61-6.12-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/usr/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /tmp/.private/root/05_node-gyp_rebuild_test-rIAfKp2TfO
gyp ERR! node -v v22.19.0
gyp ERR! node-gyp -v v11.0.0
gyp ERR! not ok</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>278997</commentid>
    <comment_count>2</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2025-12-13 04:34:43 +0300</bug_when>
    <thetext>У меня воспроизводится поломка, но с другой ошибкой

node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@11.0.0
gyp info using node@22.19.0 | linux | x64
gyp info find Python using Python version 3.13.11 found at &quot;/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:49:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:36:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.12.54-6.12-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /srv/lav/Projects/git-alt/node/8
gyp ERR! node -v v22.19.0
gyp ERR! node-gyp -v v11.0.0
gyp ERR! not ok 

Она из-за пустого build/config.gypi

но node-gyp configure
это лечит.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285475</commentid>
    <comment_count>3</comment_count>
    <who name="Сычкин Сергей Витальевич">sychkinsv</who>
    <bug_when>2026-04-09 15:05:20 +0300</bug_when>
    <thetext>Воспроизводится:

gyp info it worked if it ends with ok
gyp info using node-gyp@12.2.0
gyp info using node@22.19.0 | linux | x64
gyp info find Python using Python version 3.13.12 found at &quot;/usr/bin/python3&quot;
gyp ERR! build error 
gyp ERR! stack Error: You must run `node-gyp configure` first!
gyp ERR! stack at loadConfigGypi (/usr/lib/node_modules/node-gyp/lib/build.js:49:15)
gyp ERR! stack at async build (/usr/lib/node_modules/node-gyp/lib/build.js:36:3)
gyp ERR! stack at async run (/usr/lib/node_modules/node-gyp/bin/node-gyp.js:81:18)
gyp ERR! System Linux 6.12.33-6.12-alt1
gyp ERR! command &quot;/usr/bin/node&quot; &quot;/usr/bin/node-gyp&quot; &quot;rebuild&quot;
gyp ERR! cwd /home/test
gyp ERR! node -v v22.19.0
gyp ERR! node-gyp -v v12.2.0
gyp ERR! not ok</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>301720</commentid>
    <comment_count>4</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2026-10-11 15:45:15 +0300</bug_when>
    <thetext>node-gyp-13.1.0-alt2 -&gt; sisyphus:

Sun Oct 11 2026 Vitaly Lipatov &lt;lav@altlinux.ru&gt; 13.1.0-alt2
- fix node-gyp rebuild: await build dir creation in system nodedir patch (closes: #51743)
- drop no-op gyp_script substitution</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302418</commentid>
    <comment_count>5</comment_count>
    <who name="Кожевников Владимир Сергеевич">kozhevnikovvs</who>
    <bug_when>2026-10-14 14:55:35 +0300</bug_when>
    <thetext>Версия пакета:
node-gyp-10.1.0-alt2

Ошибка воспроизводится на p11.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302419</commentid>
    <comment_count>6</comment_count>
    <who name="Кожевников Владимир Сергеевич">kozhevnikovvs</who>
    <bug_when>2026-10-14 15:27:48 +0300</bug_when>
    <thetext>На Sisyphus (node-gyp-13.1.0-alt2) ошибка не воспроизвелась.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302451</commentid>
    <comment_count>7</comment_count>
    <who name="Vitaly Lipatov">lav</who>
    <bug_when>2026-10-14 21:40:18 +0300</bug_when>
    <thetext>Подтверждаю: воспроизводится на p11 (docker, node-gyp-10.1.0-alt2, node-22.23.3-alt1, минимальный аддон на node-addon-api): `node-gyp rebuild` падает с &quot;You must run `node-gyp configure` first!&quot;, build/config.gypi остаётся пустым. В Sisyphus (node-gyp-13.1.0-alt2) тот же сценарий собирается успешно (gyp info ok, hello_world.node создан). Исправление для p11 - перенос из Sisyphus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>302864</commentid>
    <comment_count>8</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2026-10-20 09:48:34 +0300</bug_when>
    <thetext>node-gyp-13.1.0-alt2 -&gt; p11:

Sun Oct 11 2026 Vitaly Lipatov &lt;lav@altlinux.ru&gt; 13.1.0-alt2
- fix node-gyp rebuild: await build dir creation in system nodedir patch (closes: #51743)
- drop no-op gyp_script substitution
Sun Oct 11 2026 Vitaly Lipatov &lt;lav@altlinux.ru&gt; 13.1.0-alt1
- new version 13.1.0
- require node &gt;= 22.22.2 (upstream engines)
- security fixes:
  + CVE-2026-53655, GHSA-vmf3-w455-68vh: fix tar parser interpretation differential via PAX size override on GNU long-name/long-link headers.
  + CVE-2026-59871, GHSA-w8wr-v893-vjvp: fix tar process crash via PAX numeric path type confusion.
  + CVE-2026-59873, GHSA-23hp-3jrh-7fpw: fix tar decompression/parse DoS via unlimited input.
  + CVE-2026-59874, GHSA-8x88-c5mf-7j5w: fix tar infinite loop on negative entry size in archive replace.
  + CVE-2026-59875, GHSA-gvwx-54wh-qm9j: fix tar uncaught exception DoS via NUL byte in PAX path/linkpath.
  + CVE-2026-73566, GHSA-r292-9mhp-454m: fix tar stack overflow DoS via crafted long-path archive.
  + CVE-2026-33671, GHSA-c2c7-rcm5-vvqj: fix picomatch ReDoS via extglob quantifiers.
  + CVE-2026-33672, GHSA-3v7f-55p6-f55p: fix picomatch method injection in POSIX character classes.
Thu Mar 12 2026 Vitaly Lipatov &lt;lav@altlinux.ru&gt; 12.2.0-alt1
- new version 12.2.0
Sun Feb 09 2025 Vitaly Lipatov &lt;lav@altlinux.ru&gt; 11.0.0-alt1
- new version 11.0.0 (with rpmrb script)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>