Bug 295862 - editors/vscode: build failure on recent main (16-CURRENT 1600018)
Summary: editors/vscode: build failure on recent main (16-CURRENT 1600018)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hiroki Tagato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-04 23:57 UTC by Alexey Shuvaev
Modified: 2026-06-14 18:14 UTC (History)
1 user (show)

See Also:
tagattie: maintainer-feedback+


Attachments
poudriere build log with failure for vscode-1.119.0 (216.86 KB, text/plain)
2026-06-04 23:57 UTC, Alexey Shuvaev
no flags Details
poudriere build log with failure for vscode-1.121.0 (217.68 KB, text/plain)
2026-06-04 23:58 UTC, Alexey Shuvaev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shuvaev 2026-06-04 23:57:43 UTC
Created attachment 271498 [details]
poudriere build log with failure for vscode-1.119.0
Comment 1 Alexey Shuvaev 2026-06-04 23:58:48 UTC
Created attachment 271499 [details]
poudriere build log with failure for vscode-1.121.0
Comment 2 Alexey Shuvaev 2026-06-05 00:04:55 UTC
Build failures are not for the latest version in ports, my build machine is not catching up with the rate of updates!

But, I have got 2 failures in a row in the same module, so the chances are high that the incompatibility is still there for the latest version as well! The error message is in node_modules/keytar:

gmake[1]: Entering directory '/wrkdirs/usr/ports/editors/vscode/work/vscode-1.121.0/node_modules/keytar/build'
  CXX(target) Release/obj.target/keytar/src/async.o
In file included from ../src/async.cc:4:
../node_modules/node-addon-api/napi.h:1147:39: error: in-class initializer for static data member is not a constant expression
 1147 |     static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
      |                                       ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/node-addon-api/napi.h:1147:60: note: integer value -1 is outside the valid range of values [0, 15] for the enumeration type 'napi_typedarray_type'
 1147 |     static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
      |                                                            ^
1 error generated.
gmake[1]: *** [keytar.target.mk:134: Release/obj.target/keytar/src/async.o] Error 1
gmake[1]: Leaving directory '/wrkdirs/usr/ports/editors/vscode/work/vscode-1.121.0/node_modules/keytar/build'
gyp ERR! build error

Probably the fallout from the import of llvm21 into main...
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-06-07 10:38:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3666da5f42ad79ebe317043e445502ac820e751d

commit 3666da5f42ad79ebe317043e445502ac820e751d
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2026-06-07 10:36:25 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2026-06-07 10:37:51 +0000

    editors/vscode: Add patches to fix build error of keytar node module with clang 21

    The error in question was:

      CXX(target) Release/obj.target/keytar/src/async.o
    In file included from ../src/async.cc:4:
    ../node_modules/node-addon-api/napi.h:1147:39: error: in-class initializer for static data member is not a constant expression
     1147 |     static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
          |                                       ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../node_modules/node-addon-api/napi.h:1147:60: note: integer value -1 is outside the valid range of values [0, 15] for the enumeration type 'napi_typedarray_type'
     1147 |     static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
          |                                                            ^
    1 error generated.

    PR:             295862
    Reported by:    Alexey Shuvaev <bugsbeastie@gmail.com>

 .../patch-build_node__modules_node-addon-api_napi.h (new)     | 11 +++++++++++
 ...tensions_copilot_node__modules_node-addon-api_napi.h (new) | 11 +++++++++++
 ...__modules_keytar_node__modules_node-addon-api_napi.h (new) | 11 +++++++++++
 3 files changed, 33 insertions(+)
Comment 4 Hiroki Tagato freebsd_committer freebsd_triage 2026-06-07 10:39:32 UTC
I pushed a commit to fix the build issue with clang 21.

Can you update the ports tree and try again to see if the issue is resolved?
Comment 5 Alexey Shuvaev 2026-06-07 17:13:10 UTC
(In reply to Hiroki Tagato from comment #4)
Hi!
Thank you for the quick fix!

I will update the ports tree and give it a try!
Unfortunately I can report back only in a few days, my build machine has only 4 cores and I am afraid that a recompilation of something as heavy as electron would be needed :/
Comment 6 Rainer Hurling freebsd_committer freebsd_triage 2026-06-08 05:11:19 UTC
(In reply to Hiroki Tagato from comment #4)

I can confirm that vscode with this patch builds again on 16.0-CURRENT amd64.

Many thanks for the fix!
Comment 7 Alexey Shuvaev 2026-06-09 00:25:19 UTC
(In reply to Rainer Hurling from comment #6)
Thank you for the report!
And...actually you were somehow lucky!

My build machine is still building llvm19/llvm22, but it also just stumbled upon bug #295929, and without node24 it will not finish neither electron42 nor vscode.
I have a bad luck last days :(
Comment 8 Alexey Shuvaev 2026-06-14 18:14:19 UTC
(In reply to Alexey Shuvaev from comment #7)
After updating the main and successfully building www/node24 I have finally got to this issue!

As of FreeBSD 16-CURRENT g23c99b64918e n286572 and ports top-level git hash f4d9b517af826b97ef5b06716f48b1af71b2740f, vscode-1.123_1 was built successfully!

Thanks to everyone for the patches!
I am closing this PR now!