Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jun 2026 10:38:00 +0000
From:      Hiroki Tagato <tagattie@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 3666da5f42ad - main - editors/vscode: Add patches to fix build error of keytar node module with clang 21
Message-ID:  <6a254a08.23a43.4ff97c03@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by tagattie:

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>
---
 .../files/patch-build_node__modules_node-addon-api_napi.h     | 11 +++++++++++
 ...tch-extensions_copilot_node__modules_node-addon-api_napi.h | 11 +++++++++++
 ...h-node__modules_keytar_node__modules_node-addon-api_napi.h | 11 +++++++++++
 3 files changed, 33 insertions(+)

diff --git a/editors/vscode/files/patch-build_node__modules_node-addon-api_napi.h b/editors/vscode/files/patch-build_node__modules_node-addon-api_napi.h
new file mode 100644
index 000000000000..2420138194b2
--- /dev/null
+++ b/editors/vscode/files/patch-build_node__modules_node-addon-api_napi.h
@@ -0,0 +1,11 @@
+--- build/node_modules/node-addon-api/napi.h.orig	2026-06-07 09:08:42 UTC
++++ build/node_modules/node-addon-api/napi.h
+@@ -1144,7 +1144,7 @@ namespace Napi {
+ 
+     TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length);
+ 
+-    static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
++    static inline const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
+ 
+     template <typename T>
+     static
diff --git a/editors/vscode/files/patch-extensions_copilot_node__modules_node-addon-api_napi.h b/editors/vscode/files/patch-extensions_copilot_node__modules_node-addon-api_napi.h
new file mode 100644
index 000000000000..25dfce76caba
--- /dev/null
+++ b/editors/vscode/files/patch-extensions_copilot_node__modules_node-addon-api_napi.h
@@ -0,0 +1,11 @@
+--- extensions/copilot/node_modules/node-addon-api/napi.h.orig	2026-06-07 09:13:35 UTC
++++ extensions/copilot/node_modules/node-addon-api/napi.h
+@@ -1144,7 +1144,7 @@ namespace Napi {
+ 
+     TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length);
+ 
+-    static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
++    static inline const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
+ 
+     template <typename T>
+     static
diff --git a/editors/vscode/files/patch-node__modules_keytar_node__modules_node-addon-api_napi.h b/editors/vscode/files/patch-node__modules_keytar_node__modules_node-addon-api_napi.h
new file mode 100644
index 000000000000..bc1100fc6b82
--- /dev/null
+++ b/editors/vscode/files/patch-node__modules_keytar_node__modules_node-addon-api_napi.h
@@ -0,0 +1,11 @@
+--- node_modules/keytar/node_modules/node-addon-api/napi.h.orig	2026-06-07 09:05:42 UTC
++++ node_modules/keytar/node_modules/node-addon-api/napi.h
+@@ -1144,7 +1144,7 @@ namespace Napi {
+ 
+     TypedArray(napi_env env, napi_value value, napi_typedarray_type type, size_t length);
+ 
+-    static const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
++    static inline const napi_typedarray_type unknown_array_type = static_cast<napi_typedarray_type>(-1);
+ 
+     template <typename T>
+     static


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a254a08.23a43.4ff97c03>