* [PR PATCH] [NOMERGE] nodejs: update to 18.12.1.
@ 2022-12-22 16:29 paper42
2022-12-22 16:44 ` [PR PATCH] [Updated] " paper42
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: paper42 @ 2022-12-22 16:29 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]
There is a new pull request by paper42 against master on the void-packages repository
https://github.com/paper42/void-packages nodejs-18
https://github.com/void-linux/void-packages/pull/41239
[NOMERGE] nodejs: update to 18.12.1.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Blockers
- [ ] element-desktop - nodejs 18 not supported upstream
- [ ] vscode - nodejs 18 not supported upstream
- [ ] ... maybe more, rebuilds are still running
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/41239.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nodejs-18-41239.patch --]
[-- Type: text/x-diff, Size: 12314 bytes --]
From 2f05921a63e84243b8d1814aab04b6544bab01ba Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 22 Dec 2022 10:43:50 +0100
Subject: [PATCH 1/2] nodejs: update to 18.12.1.
---
...s-v8-src-trap-handler-trap-handler.h.patch | 31 -------------------
srcpkgs/nodejs/template | 4 +--
2 files changed, 2 insertions(+), 33 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
diff --git a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch b/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
deleted file mode 100644
index 56529af97223..000000000000
--- a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/nxhack/openwrt-node-packages/blob/master/node/patches/v16.x/999-deps-v8-src-trap-handler-trap-handler.h.patch
-
---- a/deps/v8/src/trap-handler/trap-handler.h
-+++ b/deps/v8/src/trap-handler/trap-handler.h
-@@ -17,19 +17,16 @@ namespace v8 {
- namespace internal {
- namespace trap_handler {
-
--// X64 on Linux, Windows, MacOS, FreeBSD.
--#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
-- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \
-- V8_OS_FREEBSD)
-+#if V8_TARGET_ARCH_X64 && V8_OS_LINUX && !V8_OS_ANDROID
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 (non-simulator) on Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX
-+#elif V8_TARGET_ARCH_X64 && V8_OS_WIN
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 simulator on x64 on Linux or Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && (V8_OS_LINUX || V8_OS_MACOSX)
--#define V8_TRAP_HANDLER_VIA_SIMULATOR
-+#elif V8_TARGET_ARCH_X64 && V8_OS_MACOSX
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_TARGET_ARCH_X64 && V8_OS_FREEBSD
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Everything else is unsupported.
- #else
- #define V8_TRAP_HANDLER_SUPPORTED false
- #endif
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index 0fee0a8ec725..43d70f938ed3 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,6 +1,6 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=16.19.0
+version=18.12.1
revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=8b8a2939fa5f654ff61cae29b12118c24109273458ecbe6162ad8a8858309e0d
+checksum=ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186
python_version=3
build_options="ssl libuv icu nghttp2 cares"
From 21106885ff00c61370e8b148a73aae6cc815e9af Mon Sep 17 00:00:00 2001
From: Zapeth <steami@live.at>
Date: Thu, 22 Dec 2022 17:00:45 +0100
Subject: [PATCH 2/2] firefox-esr: fix build with Python 3.11
---
.../patches/fix-iomode-python3.11.patch | 107 ++++++++++++++++++
.../firefox-esr/patches/ply-python3.11.patch | 85 ++++++++++++++
2 files changed, 192 insertions(+)
create mode 100644 srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
create mode 100644 srcpkgs/firefox-esr/patches/ply-python3.11.patch
diff --git a/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch b/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
new file mode 100644
index 000000000000..3c13bc656d54
--- /dev/null
+++ b/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
@@ -0,0 +1,107 @@
+Support for 'U' mode was removed in python 3.11, see https://bugs.python.org/issue37330
+
+diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py
+index 780e3b3..7e2c714 100644
+--- a/dom/base/usecounters.py
++++ b/dom/base/usecounters.py
+@@ -8,7 +8,7 @@ import re
+
+ def read_conf(conf_filename):
+ # Can't read/write from a single StringIO, so make a new one for reading.
+- stream = open(conf_filename, "rU")
++ stream = open(conf_filename, "r")
+
+ def parse_counters(stream):
+ for line_num, line in enumerate(stream):
+diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py
+index f1d401a..aca59d0 100644
+--- a/python/mozbuild/mozbuild/action/process_define_files.py
++++ b/python/mozbuild/mozbuild/action/process_define_files.py
+@@ -36,7 +36,7 @@ def process_define_file(output, input):
+ ) and not config.substs.get("JS_STANDALONE"):
+ config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src"))
+
+- with open(path, "rU") as input:
++ with open(path, "r") as input:
+ r = re.compile(
+ "^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
+ )
+diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py
+index 7bc1986..b64a709 100644
+--- a/python/mozbuild/mozbuild/backend/base.py
++++ b/python/mozbuild/mozbuild/backend/base.py
+@@ -272,7 +272,7 @@ class BuildBackend(LoggingMixin):
+ return status
+
+ @contextmanager
+- def _write_file(self, path=None, fh=None, readmode="rU"):
++ def _write_file(self, path=None, fh=None, readmode="r"):
+ """Context manager to write a file.
+
+ This is a glorified wrapper around FileAvoidWrite with integration to
+diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
+index f7820b9..857f1a6 100644
+--- a/python/mozbuild/mozbuild/preprocessor.py
++++ b/python/mozbuild/mozbuild/preprocessor.py
+@@ -531,7 +531,7 @@ class Preprocessor:
+
+ if args:
+ for f in args:
+- with io.open(f, "rU", encoding="utf-8") as input:
++ with io.open(f, "r", encoding="utf-8") as input:
+ self.processFile(input=input, output=out)
+ if depfile:
+ mk = Makefile()
+@@ -860,7 +860,7 @@ class Preprocessor:
+ args = self.applyFilters(args)
+ if not os.path.isabs(args):
+ args = os.path.join(self.curdir, args)
+- args = io.open(args, "rU", encoding="utf-8")
++ args = io.open(args, "r", encoding="utf-8")
+ except Preprocessor.Error:
+ raise
+ except Exception:
+@@ -914,7 +914,7 @@ class Preprocessor:
+ def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"):
+ pp = Preprocessor(defines=defines, marker=marker)
+ for f in includes:
+- with io.open(f, "rU", encoding="utf-8") as input:
++ with io.open(f, "r", encoding="utf-8") as input:
+ pp.processFile(input=input, output=output)
+ return pp.includes
+
+diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
+index b09f164..4f1e0cd 100644
+--- a/python/mozbuild/mozbuild/util.py
++++ b/python/mozbuild/mozbuild/util.py
+@@ -236,7 +236,7 @@ class FileAvoidWrite(BytesIO):
+ still occur, as well as diff capture if requested.
+ """
+
+- def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"):
++ def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"):
+ BytesIO.__init__(self)
+ self.name = filename
+ assert type(capture_diff) == bool
+diff --git a/python/mozbuild/mozpack/files.py b/python/mozbuild/mozpack/files.py
+index 1d8a1ed..a295a67 100644
+--- a/python/mozbuild/mozpack/files.py
++++ b/python/mozbuild/mozpack/files.py
+@@ -554,7 +554,7 @@ class PreprocessedFile(BaseFile):
+ pp = Preprocessor(defines=self.defines, marker=self.marker)
+ pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+
+- with _open(self.path, "rU") as input:
++ with _open(self.path, "r") as input:
+ with _open(os.devnull, "w") as output:
+ pp.processFile(input=input, output=output)
+
+@@ -611,7 +611,7 @@ class PreprocessedFile(BaseFile):
+ pp = Preprocessor(defines=self.defines, marker=self.marker)
+ pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+
+- with _open(self.path, "rU") as input:
++ with _open(self.path, "r") as input:
+ pp.processFile(input=input, output=dest, depfile=deps_out)
+
+ dest.close()
diff --git a/srcpkgs/firefox-esr/patches/ply-python3.11.patch b/srcpkgs/firefox-esr/patches/ply-python3.11.patch
new file mode 100644
index 000000000000..8d1415a4b369
--- /dev/null
+++ b/srcpkgs/firefox-esr/patches/ply-python3.11.patch
@@ -0,0 +1,85 @@
+The Ply lexer, which doesn't seem too active a project, wraps regular
+expressions from grammar definitions in its own regular expressions that name
+groups. This breaks re.compile in Python >= 3.11 when the original expressions
+contain global flags, because the compiler requires that global flags appear at
+the start of the expression instead of inside the named group.
+
+This patch wraps re.compile to scan the expression for any global flags and,
+when found, moves them to the start of the expression.
+
+--- a/third_party/python/ply/ply/lex.py
++++ b/third_party/python/ply/ply/lex.py
+@@ -49,6 +49,37 @@
+ # Python 3.0
+ StringTypes = (str, bytes)
+
++
++def _re_compile(expression, *args, **kwargs):
++ '''
++ Rearrange global flags in the regular expression to appear at the
++ beginning, avoiding deprecation warnings on Python < 3.11 and hard
++ errors on Python >= 3.11.
++ '''
++ flags = set()
++ remainder = ''
++
++ pattern = re.compile(r'\(\?([aiLmsux]+)\)')
++ while m := pattern.search(expression):
++ # Location of the global flag spec
++ l, h = m.span(0)
++ # Accumulate global flags from this spec
++ flags.update(m.group(1))
++ # Capture all text leading up to the match
++ remainder += expression[:l]
++ # Trim to the end fo the flag spec
++ expression = expression[h:]
++
++ # Any remaining expression contains no flags
++ remainder += expression
++
++ # If there are flags, they belong at the beginning
++ if flags:
++ remainder = f'(?{"".join(sorted(flags))})' + remainder
++
++ return re.compile(remainder, *args, **kwargs)
++
++
+ # This regular expression is used to match valid token names
+ _is_identifier = re.compile(r'^[a-zA-Z0-9_]+$')
+
+@@ -230,7 +261,7 @@
+ titem = []
+ txtitem = []
+ for pat, func_name in lre:
+- titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict)))
++ titem.append((_re_compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict)))
+
+ self.lexstatere[statename] = titem
+ self.lexstateretext[statename] = txtitem
+@@ -495,7 +526,7 @@
+ return []
+ regex = '|'.join(relist)
+ try:
+- lexre = re.compile(regex, reflags)
++ lexre = _re_compile(regex, reflags)
+
+ # Build the index to function map for the matching engine
+ lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1)
+@@ -758,7 +789,7 @@
+ continue
+
+ try:
+- c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
++ c = _re_compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
+ if c.match(''):
+ self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__)
+ self.error = True
+@@ -782,7 +813,7 @@
+ continue
+
+ try:
+- c = re.compile('(?P<%s>%s)' % (name, r), self.reflags)
++ c = _re_compile('(?P<%s>%s)' % (name, r), self.reflags)
+ if (c.match('')):
+ self.log.error("Regular expression for rule '%s' matches empty string", name)
+ self.error = True
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PR PATCH] [Updated] [NOMERGE] nodejs: update to 18.12.1.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
@ 2022-12-22 16:44 ` paper42
2022-12-24 23:44 ` paper42
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-22 16:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]
There is an updated pull request by paper42 against master on the void-packages repository
https://github.com/paper42/void-packages nodejs-18
https://github.com/void-linux/void-packages/pull/41239
[NOMERGE] nodejs: update to 18.12.1.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Blockers
- [ ] element-desktop - nodejs 18 not supported upstream
- [ ] vscode - nodejs 18 not supported upstream
- [ ] ... maybe more, rebuilds are still running
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/41239.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nodejs-18-41239.patch --]
[-- Type: text/x-diff, Size: 15809 bytes --]
From 19066d474abdb9c2ca2b8e9414ed733e08d21c34 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 22 Dec 2022 10:43:50 +0100
Subject: [PATCH 1/2] nodejs: update to 18.12.1.
---
...s-v8-src-trap-handler-trap-handler.h.patch | 31 --------
srcpkgs/nodejs/patches/python3.11.patch | 74 +++++++++++++++++++
srcpkgs/nodejs/template | 4 +-
3 files changed, 76 insertions(+), 33 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
create mode 100644 srcpkgs/nodejs/patches/python3.11.patch
diff --git a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch b/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
deleted file mode 100644
index 56529af97223..000000000000
--- a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/nxhack/openwrt-node-packages/blob/master/node/patches/v16.x/999-deps-v8-src-trap-handler-trap-handler.h.patch
-
---- a/deps/v8/src/trap-handler/trap-handler.h
-+++ b/deps/v8/src/trap-handler/trap-handler.h
-@@ -17,19 +17,16 @@ namespace v8 {
- namespace internal {
- namespace trap_handler {
-
--// X64 on Linux, Windows, MacOS, FreeBSD.
--#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
-- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \
-- V8_OS_FREEBSD)
-+#if V8_TARGET_ARCH_X64 && V8_OS_LINUX && !V8_OS_ANDROID
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 (non-simulator) on Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX
-+#elif V8_TARGET_ARCH_X64 && V8_OS_WIN
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 simulator on x64 on Linux or Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && (V8_OS_LINUX || V8_OS_MACOSX)
--#define V8_TRAP_HANDLER_VIA_SIMULATOR
-+#elif V8_TARGET_ARCH_X64 && V8_OS_MACOSX
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_TARGET_ARCH_X64 && V8_OS_FREEBSD
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Everything else is unsupported.
- #else
- #define V8_TRAP_HANDLER_SUPPORTED false
- #endif
diff --git a/srcpkgs/nodejs/patches/python3.11.patch b/srcpkgs/nodejs/patches/python3.11.patch
new file mode 100644
index 000000000000..7b9dbcb99584
--- /dev/null
+++ b/srcpkgs/nodejs/patches/python3.11.patch
@@ -0,0 +1,74 @@
+From cf748ad2b7f760e2df1bc8a811f887161b892534 Mon Sep 17 00:00:00 2001
+From: Luigi Pinca <luigipinca@gmail.com>
+Date: Wed, 26 Oct 2022 15:01:59 +0200
+Subject: [PATCH] build: support Python 3.11
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PR-URL: https://github.com/nodejs/node/pull/45191
+Reviewed-By: Rich Trott <rtrott@gmail.com>
+Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
+Reviewed-By: Richard Lau <rlau@redhat.com>
+Reviewed-By: Christian Clauss <cclauss@me.com>
+Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
+Reviewed-By: James M Snell <jasnell@gmail.com>
+Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
+Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
+---
+ BUILDING.md | 6 +++---
+ configure | 3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/BUILDING.md b/BUILDING.md
+index 0dd954880131..e66aa314d329 100644
+--- a/BUILDING.md
++++ b/BUILDING.md
+@@ -225,7 +225,7 @@ The Node.js project supports Python >= 3 for building and testing.
+
+ * `gcc` and `g++` >= 8.3 or newer
+ * GNU Make 3.81 or newer
+-* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
++* Python >=3.6 <=3.11 (see note above)
+ * For test coverage, your Python installation must include pip.
+
+ Installation via Linux package manager can be achieved with:
+@@ -241,7 +241,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`.
+ #### macOS prerequisites
+
+ * Xcode Command Line Tools >= 11 for macOS
+-* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
++* Python >=3.6 <=3.11 (see note above)
+ * For test coverage, your Python installation must include pip.
+
+ macOS users can install the `Xcode Command Line Tools` by running
+@@ -565,7 +565,7 @@ to run it again before invoking `make -j4`.
+
+ ##### Option 1: Manual install
+
+-* [Python 3.10](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5)
++* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
+ * The "Desktop development with C++" workload from
+ [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) or
+ the "C++ build tools" workload from the
+diff --git a/configure b/configure
+index 6ef2da2e631e..fefb313c9cd1 100755
+--- a/configure
++++ b/configure
+@@ -4,6 +4,7 @@
+ # Note that the mix of single and double quotes is intentional,
+ # as is the fact that the ] goes on a new line.
+ _=[ 'exec' '/bin/sh' '-c' '''
++command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
+ command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
+ command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
+ command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
+@@ -22,7 +23,7 @@ except ImportError:
+ from distutils.spawn import find_executable as which
+
+ print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
+-acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
++acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+ if sys.version_info[:2] in acceptable_pythons:
+ import configure
+ else:
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index 0fee0a8ec725..43d70f938ed3 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,6 +1,6 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=16.19.0
+version=18.12.1
revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=8b8a2939fa5f654ff61cae29b12118c24109273458ecbe6162ad8a8858309e0d
+checksum=ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186
python_version=3
build_options="ssl libuv icu nghttp2 cares"
From 81e23fab9ff14be4838070c72b01133075ce3f3a Mon Sep 17 00:00:00 2001
From: Zapeth <steami@live.at>
Date: Thu, 22 Dec 2022 17:00:45 +0100
Subject: [PATCH 2/2] firefox-esr: fix build with Python 3.11
---
.../patches/fix-iomode-python3.11.patch | 107 ++++++++++++++++++
.../firefox-esr/patches/ply-python3.11.patch | 85 ++++++++++++++
2 files changed, 192 insertions(+)
create mode 100644 srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
create mode 100644 srcpkgs/firefox-esr/patches/ply-python3.11.patch
diff --git a/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch b/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
new file mode 100644
index 000000000000..3c13bc656d54
--- /dev/null
+++ b/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
@@ -0,0 +1,107 @@
+Support for 'U' mode was removed in python 3.11, see https://bugs.python.org/issue37330
+
+diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py
+index 780e3b3..7e2c714 100644
+--- a/dom/base/usecounters.py
++++ b/dom/base/usecounters.py
+@@ -8,7 +8,7 @@ import re
+
+ def read_conf(conf_filename):
+ # Can't read/write from a single StringIO, so make a new one for reading.
+- stream = open(conf_filename, "rU")
++ stream = open(conf_filename, "r")
+
+ def parse_counters(stream):
+ for line_num, line in enumerate(stream):
+diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py
+index f1d401a..aca59d0 100644
+--- a/python/mozbuild/mozbuild/action/process_define_files.py
++++ b/python/mozbuild/mozbuild/action/process_define_files.py
+@@ -36,7 +36,7 @@ def process_define_file(output, input):
+ ) and not config.substs.get("JS_STANDALONE"):
+ config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src"))
+
+- with open(path, "rU") as input:
++ with open(path, "r") as input:
+ r = re.compile(
+ "^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
+ )
+diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py
+index 7bc1986..b64a709 100644
+--- a/python/mozbuild/mozbuild/backend/base.py
++++ b/python/mozbuild/mozbuild/backend/base.py
+@@ -272,7 +272,7 @@ class BuildBackend(LoggingMixin):
+ return status
+
+ @contextmanager
+- def _write_file(self, path=None, fh=None, readmode="rU"):
++ def _write_file(self, path=None, fh=None, readmode="r"):
+ """Context manager to write a file.
+
+ This is a glorified wrapper around FileAvoidWrite with integration to
+diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
+index f7820b9..857f1a6 100644
+--- a/python/mozbuild/mozbuild/preprocessor.py
++++ b/python/mozbuild/mozbuild/preprocessor.py
+@@ -531,7 +531,7 @@ class Preprocessor:
+
+ if args:
+ for f in args:
+- with io.open(f, "rU", encoding="utf-8") as input:
++ with io.open(f, "r", encoding="utf-8") as input:
+ self.processFile(input=input, output=out)
+ if depfile:
+ mk = Makefile()
+@@ -860,7 +860,7 @@ class Preprocessor:
+ args = self.applyFilters(args)
+ if not os.path.isabs(args):
+ args = os.path.join(self.curdir, args)
+- args = io.open(args, "rU", encoding="utf-8")
++ args = io.open(args, "r", encoding="utf-8")
+ except Preprocessor.Error:
+ raise
+ except Exception:
+@@ -914,7 +914,7 @@ class Preprocessor:
+ def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"):
+ pp = Preprocessor(defines=defines, marker=marker)
+ for f in includes:
+- with io.open(f, "rU", encoding="utf-8") as input:
++ with io.open(f, "r", encoding="utf-8") as input:
+ pp.processFile(input=input, output=output)
+ return pp.includes
+
+diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
+index b09f164..4f1e0cd 100644
+--- a/python/mozbuild/mozbuild/util.py
++++ b/python/mozbuild/mozbuild/util.py
+@@ -236,7 +236,7 @@ class FileAvoidWrite(BytesIO):
+ still occur, as well as diff capture if requested.
+ """
+
+- def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"):
++ def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"):
+ BytesIO.__init__(self)
+ self.name = filename
+ assert type(capture_diff) == bool
+diff --git a/python/mozbuild/mozpack/files.py b/python/mozbuild/mozpack/files.py
+index 1d8a1ed..a295a67 100644
+--- a/python/mozbuild/mozpack/files.py
++++ b/python/mozbuild/mozpack/files.py
+@@ -554,7 +554,7 @@ class PreprocessedFile(BaseFile):
+ pp = Preprocessor(defines=self.defines, marker=self.marker)
+ pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+
+- with _open(self.path, "rU") as input:
++ with _open(self.path, "r") as input:
+ with _open(os.devnull, "w") as output:
+ pp.processFile(input=input, output=output)
+
+@@ -611,7 +611,7 @@ class PreprocessedFile(BaseFile):
+ pp = Preprocessor(defines=self.defines, marker=self.marker)
+ pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+
+- with _open(self.path, "rU") as input:
++ with _open(self.path, "r") as input:
+ pp.processFile(input=input, output=dest, depfile=deps_out)
+
+ dest.close()
diff --git a/srcpkgs/firefox-esr/patches/ply-python3.11.patch b/srcpkgs/firefox-esr/patches/ply-python3.11.patch
new file mode 100644
index 000000000000..8d1415a4b369
--- /dev/null
+++ b/srcpkgs/firefox-esr/patches/ply-python3.11.patch
@@ -0,0 +1,85 @@
+The Ply lexer, which doesn't seem too active a project, wraps regular
+expressions from grammar definitions in its own regular expressions that name
+groups. This breaks re.compile in Python >= 3.11 when the original expressions
+contain global flags, because the compiler requires that global flags appear at
+the start of the expression instead of inside the named group.
+
+This patch wraps re.compile to scan the expression for any global flags and,
+when found, moves them to the start of the expression.
+
+--- a/third_party/python/ply/ply/lex.py
++++ b/third_party/python/ply/ply/lex.py
+@@ -49,6 +49,37 @@
+ # Python 3.0
+ StringTypes = (str, bytes)
+
++
++def _re_compile(expression, *args, **kwargs):
++ '''
++ Rearrange global flags in the regular expression to appear at the
++ beginning, avoiding deprecation warnings on Python < 3.11 and hard
++ errors on Python >= 3.11.
++ '''
++ flags = set()
++ remainder = ''
++
++ pattern = re.compile(r'\(\?([aiLmsux]+)\)')
++ while m := pattern.search(expression):
++ # Location of the global flag spec
++ l, h = m.span(0)
++ # Accumulate global flags from this spec
++ flags.update(m.group(1))
++ # Capture all text leading up to the match
++ remainder += expression[:l]
++ # Trim to the end fo the flag spec
++ expression = expression[h:]
++
++ # Any remaining expression contains no flags
++ remainder += expression
++
++ # If there are flags, they belong at the beginning
++ if flags:
++ remainder = f'(?{"".join(sorted(flags))})' + remainder
++
++ return re.compile(remainder, *args, **kwargs)
++
++
+ # This regular expression is used to match valid token names
+ _is_identifier = re.compile(r'^[a-zA-Z0-9_]+$')
+
+@@ -230,7 +261,7 @@
+ titem = []
+ txtitem = []
+ for pat, func_name in lre:
+- titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict)))
++ titem.append((_re_compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict)))
+
+ self.lexstatere[statename] = titem
+ self.lexstateretext[statename] = txtitem
+@@ -495,7 +526,7 @@
+ return []
+ regex = '|'.join(relist)
+ try:
+- lexre = re.compile(regex, reflags)
++ lexre = _re_compile(regex, reflags)
+
+ # Build the index to function map for the matching engine
+ lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1)
+@@ -758,7 +789,7 @@
+ continue
+
+ try:
+- c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
++ c = _re_compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
+ if c.match(''):
+ self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__)
+ self.error = True
+@@ -782,7 +813,7 @@
+ continue
+
+ try:
+- c = re.compile('(?P<%s>%s)' % (name, r), self.reflags)
++ c = _re_compile('(?P<%s>%s)' % (name, r), self.reflags)
+ if (c.match('')):
+ self.log.error("Regular expression for rule '%s' matches empty string", name)
+ self.error = True
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PR PATCH] [Updated] [NOMERGE] nodejs: update to 18.12.1.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
2022-12-22 16:44 ` [PR PATCH] [Updated] " paper42
@ 2022-12-24 23:44 ` paper42
2023-03-02 20:45 ` paper42
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2022-12-24 23:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]
There is an updated pull request by paper42 against master on the void-packages repository
https://github.com/paper42/void-packages nodejs-18
https://github.com/void-linux/void-packages/pull/41239
[NOMERGE] nodejs: update to 18.12.1.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Blockers
- [ ] element-desktop - nodejs 18 not supported upstream
- [ ] vscode - nodejs 18 not supported upstream
- [ ] ... maybe more, rebuilds are still running
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/41239.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nodejs-18-41239.patch --]
[-- Type: text/x-diff, Size: 16757 bytes --]
From dfd0ce9054b70b370cc24b3710b4c0aba672f616 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 22 Dec 2022 10:43:50 +0100
Subject: [PATCH 1/3] nodejs: update to 18.12.1.
---
...s-v8-src-trap-handler-trap-handler.h.patch | 31 --------
srcpkgs/nodejs/patches/python3.11.patch | 74 +++++++++++++++++++
srcpkgs/nodejs/template | 4 +-
3 files changed, 76 insertions(+), 33 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
create mode 100644 srcpkgs/nodejs/patches/python3.11.patch
diff --git a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch b/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
deleted file mode 100644
index 56529af97223..000000000000
--- a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/nxhack/openwrt-node-packages/blob/master/node/patches/v16.x/999-deps-v8-src-trap-handler-trap-handler.h.patch
-
---- a/deps/v8/src/trap-handler/trap-handler.h
-+++ b/deps/v8/src/trap-handler/trap-handler.h
-@@ -17,19 +17,16 @@ namespace v8 {
- namespace internal {
- namespace trap_handler {
-
--// X64 on Linux, Windows, MacOS, FreeBSD.
--#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
-- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \
-- V8_OS_FREEBSD)
-+#if V8_TARGET_ARCH_X64 && V8_OS_LINUX && !V8_OS_ANDROID
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 (non-simulator) on Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX
-+#elif V8_TARGET_ARCH_X64 && V8_OS_WIN
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 simulator on x64 on Linux or Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && (V8_OS_LINUX || V8_OS_MACOSX)
--#define V8_TRAP_HANDLER_VIA_SIMULATOR
-+#elif V8_TARGET_ARCH_X64 && V8_OS_MACOSX
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_TARGET_ARCH_X64 && V8_OS_FREEBSD
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Everything else is unsupported.
- #else
- #define V8_TRAP_HANDLER_SUPPORTED false
- #endif
diff --git a/srcpkgs/nodejs/patches/python3.11.patch b/srcpkgs/nodejs/patches/python3.11.patch
new file mode 100644
index 000000000000..7b9dbcb99584
--- /dev/null
+++ b/srcpkgs/nodejs/patches/python3.11.patch
@@ -0,0 +1,74 @@
+From cf748ad2b7f760e2df1bc8a811f887161b892534 Mon Sep 17 00:00:00 2001
+From: Luigi Pinca <luigipinca@gmail.com>
+Date: Wed, 26 Oct 2022 15:01:59 +0200
+Subject: [PATCH] build: support Python 3.11
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PR-URL: https://github.com/nodejs/node/pull/45191
+Reviewed-By: Rich Trott <rtrott@gmail.com>
+Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
+Reviewed-By: Richard Lau <rlau@redhat.com>
+Reviewed-By: Christian Clauss <cclauss@me.com>
+Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
+Reviewed-By: James M Snell <jasnell@gmail.com>
+Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
+Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
+---
+ BUILDING.md | 6 +++---
+ configure | 3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/BUILDING.md b/BUILDING.md
+index 0dd954880131..e66aa314d329 100644
+--- a/BUILDING.md
++++ b/BUILDING.md
+@@ -225,7 +225,7 @@ The Node.js project supports Python >= 3 for building and testing.
+
+ * `gcc` and `g++` >= 8.3 or newer
+ * GNU Make 3.81 or newer
+-* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
++* Python >=3.6 <=3.11 (see note above)
+ * For test coverage, your Python installation must include pip.
+
+ Installation via Linux package manager can be achieved with:
+@@ -241,7 +241,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`.
+ #### macOS prerequisites
+
+ * Xcode Command Line Tools >= 11 for macOS
+-* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
++* Python >=3.6 <=3.11 (see note above)
+ * For test coverage, your Python installation must include pip.
+
+ macOS users can install the `Xcode Command Line Tools` by running
+@@ -565,7 +565,7 @@ to run it again before invoking `make -j4`.
+
+ ##### Option 1: Manual install
+
+-* [Python 3.10](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5)
++* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
+ * The "Desktop development with C++" workload from
+ [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) or
+ the "C++ build tools" workload from the
+diff --git a/configure b/configure
+index 6ef2da2e631e..fefb313c9cd1 100755
+--- a/configure
++++ b/configure
+@@ -4,6 +4,7 @@
+ # Note that the mix of single and double quotes is intentional,
+ # as is the fact that the ] goes on a new line.
+ _=[ 'exec' '/bin/sh' '-c' '''
++command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
+ command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
+ command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
+ command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
+@@ -22,7 +23,7 @@ except ImportError:
+ from distutils.spawn import find_executable as which
+
+ print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
+-acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
++acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+ if sys.version_info[:2] in acceptable_pythons:
+ import configure
+ else:
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index 0fee0a8ec725..43d70f938ed3 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,6 +1,6 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=16.19.0
+version=18.12.1
revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=8b8a2939fa5f654ff61cae29b12118c24109273458ecbe6162ad8a8858309e0d
+checksum=ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186
python_version=3
build_options="ssl libuv icu nghttp2 cares"
From 9c980e92d72019361881e00f0a06dfd4273a7ba6 Mon Sep 17 00:00:00 2001
From: Zapeth <steami@live.at>
Date: Thu, 22 Dec 2022 17:00:45 +0100
Subject: [PATCH 2/3] firefox-esr: fix build with Python 3.11
---
.../patches/fix-iomode-python3.11.patch | 107 ++++++++++++++++++
.../firefox-esr/patches/ply-python3.11.patch | 85 ++++++++++++++
2 files changed, 192 insertions(+)
create mode 100644 srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
create mode 100644 srcpkgs/firefox-esr/patches/ply-python3.11.patch
diff --git a/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch b/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
new file mode 100644
index 000000000000..3c13bc656d54
--- /dev/null
+++ b/srcpkgs/firefox-esr/patches/fix-iomode-python3.11.patch
@@ -0,0 +1,107 @@
+Support for 'U' mode was removed in python 3.11, see https://bugs.python.org/issue37330
+
+diff --git a/dom/base/usecounters.py b/dom/base/usecounters.py
+index 780e3b3..7e2c714 100644
+--- a/dom/base/usecounters.py
++++ b/dom/base/usecounters.py
+@@ -8,7 +8,7 @@ import re
+
+ def read_conf(conf_filename):
+ # Can't read/write from a single StringIO, so make a new one for reading.
+- stream = open(conf_filename, "rU")
++ stream = open(conf_filename, "r")
+
+ def parse_counters(stream):
+ for line_num, line in enumerate(stream):
+diff --git a/python/mozbuild/mozbuild/action/process_define_files.py b/python/mozbuild/mozbuild/action/process_define_files.py
+index f1d401a..aca59d0 100644
+--- a/python/mozbuild/mozbuild/action/process_define_files.py
++++ b/python/mozbuild/mozbuild/action/process_define_files.py
+@@ -36,7 +36,7 @@ def process_define_file(output, input):
+ ) and not config.substs.get("JS_STANDALONE"):
+ config = PartialConfigEnvironment(mozpath.join(topobjdir, "js", "src"))
+
+- with open(path, "rU") as input:
++ with open(path, "r") as input:
+ r = re.compile(
+ "^\s*#\s*(?P<cmd>[a-z]+)(?:\s+(?P<name>\S+)(?:\s+(?P<value>\S+))?)?", re.U
+ )
+diff --git a/python/mozbuild/mozbuild/backend/base.py b/python/mozbuild/mozbuild/backend/base.py
+index 7bc1986..b64a709 100644
+--- a/python/mozbuild/mozbuild/backend/base.py
++++ b/python/mozbuild/mozbuild/backend/base.py
+@@ -272,7 +272,7 @@ class BuildBackend(LoggingMixin):
+ return status
+
+ @contextmanager
+- def _write_file(self, path=None, fh=None, readmode="rU"):
++ def _write_file(self, path=None, fh=None, readmode="r"):
+ """Context manager to write a file.
+
+ This is a glorified wrapper around FileAvoidWrite with integration to
+diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild/preprocessor.py
+index f7820b9..857f1a6 100644
+--- a/python/mozbuild/mozbuild/preprocessor.py
++++ b/python/mozbuild/mozbuild/preprocessor.py
+@@ -531,7 +531,7 @@ class Preprocessor:
+
+ if args:
+ for f in args:
+- with io.open(f, "rU", encoding="utf-8") as input:
++ with io.open(f, "r", encoding="utf-8") as input:
+ self.processFile(input=input, output=out)
+ if depfile:
+ mk = Makefile()
+@@ -860,7 +860,7 @@ class Preprocessor:
+ args = self.applyFilters(args)
+ if not os.path.isabs(args):
+ args = os.path.join(self.curdir, args)
+- args = io.open(args, "rU", encoding="utf-8")
++ args = io.open(args, "r", encoding="utf-8")
+ except Preprocessor.Error:
+ raise
+ except Exception:
+@@ -914,7 +914,7 @@ class Preprocessor:
+ def preprocess(includes=[sys.stdin], defines={}, output=sys.stdout, marker="#"):
+ pp = Preprocessor(defines=defines, marker=marker)
+ for f in includes:
+- with io.open(f, "rU", encoding="utf-8") as input:
++ with io.open(f, "r", encoding="utf-8") as input:
+ pp.processFile(input=input, output=output)
+ return pp.includes
+
+diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py
+index b09f164..4f1e0cd 100644
+--- a/python/mozbuild/mozbuild/util.py
++++ b/python/mozbuild/mozbuild/util.py
+@@ -236,7 +236,7 @@ class FileAvoidWrite(BytesIO):
+ still occur, as well as diff capture if requested.
+ """
+
+- def __init__(self, filename, capture_diff=False, dry_run=False, readmode="rU"):
++ def __init__(self, filename, capture_diff=False, dry_run=False, readmode="r"):
+ BytesIO.__init__(self)
+ self.name = filename
+ assert type(capture_diff) == bool
+diff --git a/python/mozbuild/mozpack/files.py b/python/mozbuild/mozpack/files.py
+index 1d8a1ed..a295a67 100644
+--- a/python/mozbuild/mozpack/files.py
++++ b/python/mozbuild/mozpack/files.py
+@@ -554,7 +554,7 @@ class PreprocessedFile(BaseFile):
+ pp = Preprocessor(defines=self.defines, marker=self.marker)
+ pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+
+- with _open(self.path, "rU") as input:
++ with _open(self.path, "r") as input:
+ with _open(os.devnull, "w") as output:
+ pp.processFile(input=input, output=output)
+
+@@ -611,7 +611,7 @@ class PreprocessedFile(BaseFile):
+ pp = Preprocessor(defines=self.defines, marker=self.marker)
+ pp.setSilenceDirectiveWarnings(self.silence_missing_directive_warnings)
+
+- with _open(self.path, "rU") as input:
++ with _open(self.path, "r") as input:
+ pp.processFile(input=input, output=dest, depfile=deps_out)
+
+ dest.close()
diff --git a/srcpkgs/firefox-esr/patches/ply-python3.11.patch b/srcpkgs/firefox-esr/patches/ply-python3.11.patch
new file mode 100644
index 000000000000..8d1415a4b369
--- /dev/null
+++ b/srcpkgs/firefox-esr/patches/ply-python3.11.patch
@@ -0,0 +1,85 @@
+The Ply lexer, which doesn't seem too active a project, wraps regular
+expressions from grammar definitions in its own regular expressions that name
+groups. This breaks re.compile in Python >= 3.11 when the original expressions
+contain global flags, because the compiler requires that global flags appear at
+the start of the expression instead of inside the named group.
+
+This patch wraps re.compile to scan the expression for any global flags and,
+when found, moves them to the start of the expression.
+
+--- a/third_party/python/ply/ply/lex.py
++++ b/third_party/python/ply/ply/lex.py
+@@ -49,6 +49,37 @@
+ # Python 3.0
+ StringTypes = (str, bytes)
+
++
++def _re_compile(expression, *args, **kwargs):
++ '''
++ Rearrange global flags in the regular expression to appear at the
++ beginning, avoiding deprecation warnings on Python < 3.11 and hard
++ errors on Python >= 3.11.
++ '''
++ flags = set()
++ remainder = ''
++
++ pattern = re.compile(r'\(\?([aiLmsux]+)\)')
++ while m := pattern.search(expression):
++ # Location of the global flag spec
++ l, h = m.span(0)
++ # Accumulate global flags from this spec
++ flags.update(m.group(1))
++ # Capture all text leading up to the match
++ remainder += expression[:l]
++ # Trim to the end fo the flag spec
++ expression = expression[h:]
++
++ # Any remaining expression contains no flags
++ remainder += expression
++
++ # If there are flags, they belong at the beginning
++ if flags:
++ remainder = f'(?{"".join(sorted(flags))})' + remainder
++
++ return re.compile(remainder, *args, **kwargs)
++
++
+ # This regular expression is used to match valid token names
+ _is_identifier = re.compile(r'^[a-zA-Z0-9_]+$')
+
+@@ -230,7 +261,7 @@
+ titem = []
+ txtitem = []
+ for pat, func_name in lre:
+- titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict)))
++ titem.append((_re_compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict)))
+
+ self.lexstatere[statename] = titem
+ self.lexstateretext[statename] = txtitem
+@@ -495,7 +526,7 @@
+ return []
+ regex = '|'.join(relist)
+ try:
+- lexre = re.compile(regex, reflags)
++ lexre = _re_compile(regex, reflags)
+
+ # Build the index to function map for the matching engine
+ lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1)
+@@ -758,7 +789,7 @@
+ continue
+
+ try:
+- c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
++ c = _re_compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags)
+ if c.match(''):
+ self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__)
+ self.error = True
+@@ -782,7 +813,7 @@
+ continue
+
+ try:
+- c = re.compile('(?P<%s>%s)' % (name, r), self.reflags)
++ c = _re_compile('(?P<%s>%s)' % (name, r), self.reflags)
+ if (c.match('')):
+ self.log.error("Regular expression for rule '%s' matches empty string", name)
+ self.error = True
From 81ef7655866c1f9fdfeb6eae474e5a9ea083281a Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Sun, 25 Dec 2022 00:39:34 +0100
Subject: [PATCH 3/3] vscode: fix build with nodejs 18
---
srcpkgs/vscode/template | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template
index 0baa97da3d23..5d4d4fd2b2c4 100644
--- a/srcpkgs/vscode/template
+++ b/srcpkgs/vscode/template
@@ -61,7 +61,11 @@ do_build() {
--target=$_electronver \
--tarball=/usr/include/electron${_electronver%%.*}/node_headers.tar.gz
- yarn install --frozen-lockfile --ignore-engines --arch=x64
+ # ignore nodejs version checks, we can not pass it as an argument to
+ # yarn install because it doesn't inherit properly
+ echo "ignore-engines true" >> .yarnrc
+
+ yarn install --frozen-lockfile --arch=x64
export CFLAGS="$CFLAGS -I/usr/include/node"
yarn run gulp vscode-linux-x64-min
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PR PATCH] [Updated] [NOMERGE] nodejs: update to 18.12.1.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
2022-12-22 16:44 ` [PR PATCH] [Updated] " paper42
2022-12-24 23:44 ` paper42
@ 2023-03-02 20:45 ` paper42
2023-03-06 22:46 ` dkwo
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2023-03-02 20:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
There is an updated pull request by paper42 against master on the void-packages repository
https://github.com/paper42/void-packages nodejs-18
https://github.com/void-linux/void-packages/pull/41239
[NOMERGE] nodejs: update to 18.12.1.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Blockers
- [ ] element-desktop - nodejs 18 not supported upstream
- [x] vscode - nodejs 18 not supported upstream
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/41239.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nodejs-18-41239.patch --]
[-- Type: text/x-diff, Size: 15503 bytes --]
From 974a3f3e954889b8de46f3b53f4c97b09a0d1513 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 22 Dec 2022 10:43:50 +0100
Subject: [PATCH 1/3] nodejs: update to 18.12.1.
---
...s-v8-src-trap-handler-trap-handler.h.patch | 31 --------
srcpkgs/nodejs/patches/python3.11.patch | 74 +++++++++++++++++++
srcpkgs/nodejs/template | 4 +-
3 files changed, 76 insertions(+), 33 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
create mode 100644 srcpkgs/nodejs/patches/python3.11.patch
diff --git a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch b/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
deleted file mode 100644
index 56529af97223..000000000000
--- a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/nxhack/openwrt-node-packages/blob/master/node/patches/v16.x/999-deps-v8-src-trap-handler-trap-handler.h.patch
-
---- a/deps/v8/src/trap-handler/trap-handler.h
-+++ b/deps/v8/src/trap-handler/trap-handler.h
-@@ -17,19 +17,16 @@ namespace v8 {
- namespace internal {
- namespace trap_handler {
-
--// X64 on Linux, Windows, MacOS, FreeBSD.
--#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
-- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \
-- V8_OS_FREEBSD)
-+#if V8_TARGET_ARCH_X64 && V8_OS_LINUX && !V8_OS_ANDROID
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 (non-simulator) on Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX
-+#elif V8_TARGET_ARCH_X64 && V8_OS_WIN
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 simulator on x64 on Linux or Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && (V8_OS_LINUX || V8_OS_MACOSX)
--#define V8_TRAP_HANDLER_VIA_SIMULATOR
-+#elif V8_TARGET_ARCH_X64 && V8_OS_MACOSX
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_TARGET_ARCH_X64 && V8_OS_FREEBSD
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Everything else is unsupported.
- #else
- #define V8_TRAP_HANDLER_SUPPORTED false
- #endif
diff --git a/srcpkgs/nodejs/patches/python3.11.patch b/srcpkgs/nodejs/patches/python3.11.patch
new file mode 100644
index 000000000000..7b9dbcb99584
--- /dev/null
+++ b/srcpkgs/nodejs/patches/python3.11.patch
@@ -0,0 +1,74 @@
+From cf748ad2b7f760e2df1bc8a811f887161b892534 Mon Sep 17 00:00:00 2001
+From: Luigi Pinca <luigipinca@gmail.com>
+Date: Wed, 26 Oct 2022 15:01:59 +0200
+Subject: [PATCH] build: support Python 3.11
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+PR-URL: https://github.com/nodejs/node/pull/45191
+Reviewed-By: Rich Trott <rtrott@gmail.com>
+Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
+Reviewed-By: Richard Lau <rlau@redhat.com>
+Reviewed-By: Christian Clauss <cclauss@me.com>
+Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
+Reviewed-By: James M Snell <jasnell@gmail.com>
+Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
+Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
+---
+ BUILDING.md | 6 +++---
+ configure | 3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/BUILDING.md b/BUILDING.md
+index 0dd954880131..e66aa314d329 100644
+--- a/BUILDING.md
++++ b/BUILDING.md
+@@ -225,7 +225,7 @@ The Node.js project supports Python >= 3 for building and testing.
+
+ * `gcc` and `g++` >= 8.3 or newer
+ * GNU Make 3.81 or newer
+-* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
++* Python >=3.6 <=3.11 (see note above)
+ * For test coverage, your Python installation must include pip.
+
+ Installation via Linux package manager can be achieved with:
+@@ -241,7 +241,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`.
+ #### macOS prerequisites
+
+ * Xcode Command Line Tools >= 11 for macOS
+-* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
++* Python >=3.6 <=3.11 (see note above)
+ * For test coverage, your Python installation must include pip.
+
+ macOS users can install the `Xcode Command Line Tools` by running
+@@ -565,7 +565,7 @@ to run it again before invoking `make -j4`.
+
+ ##### Option 1: Manual install
+
+-* [Python 3.10](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5)
++* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
+ * The "Desktop development with C++" workload from
+ [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) or
+ the "C++ build tools" workload from the
+diff --git a/configure b/configure
+index 6ef2da2e631e..fefb313c9cd1 100755
+--- a/configure
++++ b/configure
+@@ -4,6 +4,7 @@
+ # Note that the mix of single and double quotes is intentional,
+ # as is the fact that the ] goes on a new line.
+ _=[ 'exec' '/bin/sh' '-c' '''
++command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
+ command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
+ command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
+ command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
+@@ -22,7 +23,7 @@ except ImportError:
+ from distutils.spawn import find_executable as which
+
+ print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
+-acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
++acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+ if sys.version_info[:2] in acceptable_pythons:
+ import configure
+ else:
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index 0fee0a8ec725..43d70f938ed3 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,6 +1,6 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=16.19.0
+version=18.12.1
revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=8b8a2939fa5f654ff61cae29b12118c24109273458ecbe6162ad8a8858309e0d
+checksum=ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186
python_version=3
build_options="ssl libuv icu nghttp2 cares"
From d1d290839dce0270da0dbdf5e0b6008151602dd5 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Wed, 8 Feb 2023 21:43:40 +0100
Subject: [PATCH 2/3] nodejs: update to 18.14.0.
---
srcpkgs/nodejs/patches/cross-aarch64.patch | 29 ---------
srcpkgs/nodejs/patches/nodejs18.patch | 11 ++++
srcpkgs/nodejs/patches/python3.11.patch | 74 ----------------------
srcpkgs/nodejs/template | 6 +-
4 files changed, 14 insertions(+), 106 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/cross-aarch64.patch
create mode 100644 srcpkgs/nodejs/patches/nodejs18.patch
delete mode 100644 srcpkgs/nodejs/patches/python3.11.patch
diff --git a/srcpkgs/nodejs/patches/cross-aarch64.patch b/srcpkgs/nodejs/patches/cross-aarch64.patch
deleted file mode 100644
index 3b96c87f2fdb..000000000000
--- a/srcpkgs/nodejs/patches/cross-aarch64.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 4ac90c41065d338c4305cf6dc39e3084b21a7f79 Mon Sep 17 00:00:00 2001
-From: Michal Vasilek <michal@vasilek.cz>
-Date: Sun, 20 Nov 2022 19:22:03 +0100
-Subject: [PATCH] Revert "build: enable pointer authentication for branch
- protection on arm64"
-
-This reverts commit 938212f3e74a74d0b436941aa24e71425ff666c5.
----
- configure.py | 4 ----
- 1 file changed, 4 deletions(-)
-
-diff --git a/configure.py b/configure.py
-index d3192ca04c..2d049eb938 100755
---- a/configure.py
-+++ b/configure.py
-@@ -1241,10 +1241,6 @@ def configure_node(o):
-
- o['variables']['want_separate_host_toolset'] = int(cross_compiling)
-
-- # Enable branch protection for arm64
-- if target_arch == 'arm64':
-- o['cflags']+=['-msign-return-address=all']
--
- if options.node_snapshot_main is not None:
- if options.shared:
- # This should be possible to fix, but we will need to refactor the
---
-2.38.1
-
diff --git a/srcpkgs/nodejs/patches/nodejs18.patch b/srcpkgs/nodejs/patches/nodejs18.patch
new file mode 100644
index 000000000000..a508017bb60f
--- /dev/null
+++ b/srcpkgs/nodejs/patches/nodejs18.patch
@@ -0,0 +1,11 @@
+--- a/element-desktop/node_modules/node-gyp/gyp/pylib/gyp/input.py
++++ b/element-desktop/node_modules/node-gyp/gyp/pylib/gyp/input.py
+@@ -234,7 +234,7 @@
+ if check:
+ build_file_data = CheckedEval(build_file_contents)
+ else:
+- build_file_data = eval(build_file_contents, {"__builtins__": {}}, None)
++ build_file_data = eval(build_file_contents, {"__builtins__": {"openssl_fips": ""}}, None)
+ except SyntaxError as e:
+ e.filename = build_file_path
+ raise
diff --git a/srcpkgs/nodejs/patches/python3.11.patch b/srcpkgs/nodejs/patches/python3.11.patch
deleted file mode 100644
index 7b9dbcb99584..000000000000
--- a/srcpkgs/nodejs/patches/python3.11.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From cf748ad2b7f760e2df1bc8a811f887161b892534 Mon Sep 17 00:00:00 2001
-From: Luigi Pinca <luigipinca@gmail.com>
-Date: Wed, 26 Oct 2022 15:01:59 +0200
-Subject: [PATCH] build: support Python 3.11
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-PR-URL: https://github.com/nodejs/node/pull/45191
-Reviewed-By: Rich Trott <rtrott@gmail.com>
-Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
-Reviewed-By: Richard Lau <rlau@redhat.com>
-Reviewed-By: Christian Clauss <cclauss@me.com>
-Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
-Reviewed-By: James M Snell <jasnell@gmail.com>
-Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
-Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
----
- BUILDING.md | 6 +++---
- configure | 3 ++-
- 2 files changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/BUILDING.md b/BUILDING.md
-index 0dd954880131..e66aa314d329 100644
---- a/BUILDING.md
-+++ b/BUILDING.md
-@@ -225,7 +225,7 @@ The Node.js project supports Python >= 3 for building and testing.
-
- * `gcc` and `g++` >= 8.3 or newer
- * GNU Make 3.81 or newer
--* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
-+* Python >=3.6 <=3.11 (see note above)
- * For test coverage, your Python installation must include pip.
-
- Installation via Linux package manager can be achieved with:
-@@ -241,7 +241,7 @@ FreeBSD and OpenBSD users may also need to install `libexecinfo`.
- #### macOS prerequisites
-
- * Xcode Command Line Tools >= 11 for macOS
--* Python 3.6, 3.7, 3.8, 3.9, or 3.10 (see note above)
-+* Python >=3.6 <=3.11 (see note above)
- * For test coverage, your Python installation must include pip.
-
- macOS users can install the `Xcode Command Line Tools` by running
-@@ -565,7 +565,7 @@ to run it again before invoking `make -j4`.
-
- ##### Option 1: Manual install
-
--* [Python 3.10](https://www.microsoft.com/en-us/p/python-310/9pjpw5ldxlz5)
-+* [Python 3.11](https://apps.microsoft.com/store/detail/python-311/9NRWMJP3717K)
- * The "Desktop development with C++" workload from
- [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) or
- the "C++ build tools" workload from the
-diff --git a/configure b/configure
-index 6ef2da2e631e..fefb313c9cd1 100755
---- a/configure
-+++ b/configure
-@@ -4,6 +4,7 @@
- # Note that the mix of single and double quotes is intentional,
- # as is the fact that the ] goes on a new line.
- _=[ 'exec' '/bin/sh' '-c' '''
-+command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
- command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
- command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
- command -v python3.8 >/dev/null && exec python3.8 "$0" "$@"
-@@ -22,7 +23,7 @@ except ImportError:
- from distutils.spawn import find_executable as which
-
- print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
--acceptable_pythons = ((3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
-+acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
- if sys.version_info[:2] in acceptable_pythons:
- import configure
- else:
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index 43d70f938ed3..4306aee17a1b 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,6 +1,6 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=18.12.1
+version=18.14.0
revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=ba8174dda00d5b90943f37c6a180a1d37c861d91e04a4cb38dc1c0c74981c186
+checksum=4a13d9561ecc8d3c998ef952ab173396f84357572bd6ff1100012e4a10604c6b
python_version=3
build_options="ssl libuv icu nghttp2 cares"
@@ -41,7 +41,7 @@ fi
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
- ppc*) broken="Node 16.x does not support 32-bit ppc" ;;
+ ppc*) broken="Node 18.x does not support 32-bit ppc" ;;
esac
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
From b2f95e4b97d5c35e2b92f9c31b7a6aebe232b151 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 2 Mar 2023 21:44:54 +0100
Subject: [PATCH 3/3] nodejs: update to 18.14.2.
---
srcpkgs/nodejs/patches/nodejs18.patch | 11 -----------
srcpkgs/nodejs/template | 4 ++--
2 files changed, 2 insertions(+), 13 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/nodejs18.patch
diff --git a/srcpkgs/nodejs/patches/nodejs18.patch b/srcpkgs/nodejs/patches/nodejs18.patch
deleted file mode 100644
index a508017bb60f..000000000000
--- a/srcpkgs/nodejs/patches/nodejs18.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/element-desktop/node_modules/node-gyp/gyp/pylib/gyp/input.py
-+++ b/element-desktop/node_modules/node-gyp/gyp/pylib/gyp/input.py
-@@ -234,7 +234,7 @@
- if check:
- build_file_data = CheckedEval(build_file_contents)
- else:
-- build_file_data = eval(build_file_contents, {"__builtins__": {}}, None)
-+ build_file_data = eval(build_file_contents, {"__builtins__": {"openssl_fips": ""}}, None)
- except SyntaxError as e:
- e.filename = build_file_path
- raise
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index 4306aee17a1b..8484adfd5e7d 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,6 +1,6 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=18.14.0
+version=18.14.2
revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=4a13d9561ecc8d3c998ef952ab173396f84357572bd6ff1100012e4a10604c6b
+checksum=850aebb879e3efd904ebfe65325caa97b013773bb94fafd2d0fb794324918252
python_version=3
build_options="ssl libuv icu nghttp2 cares"
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [NOMERGE] nodejs: update to 18.12.1.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
` (2 preceding siblings ...)
2023-03-02 20:45 ` paper42
@ 2023-03-06 22:46 ` dkwo
2023-03-23 10:13 ` mhmdanas
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dkwo @ 2023-03-06 22:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 369 bytes --]
New comment by dkwo on void-packages repository
https://github.com/void-linux/void-packages/pull/41239#issuecomment-1457162784
Comment:
element-desktop builds fine here
```
=> Registering new packages to /host/binpkgs
index: added `element-desktop-1.11.24_2' (x86_64-musl).
index: added `riot-desktop-1.11.24_2' (x86_64-musl).
index: 5 packages registered.
```
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [NOMERGE] nodejs: update to 18.12.1.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
` (3 preceding siblings ...)
2023-03-06 22:46 ` dkwo
@ 2023-03-23 10:13 ` mhmdanas
2023-06-02 20:06 ` [PR PATCH] [Updated] " paper42
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mhmdanas @ 2023-03-23 10:13 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 477 bytes --]
New comment by mhmdanas on void-packages repository
https://github.com/void-linux/void-packages/pull/41239#issuecomment-1480923301
Comment:
I was able to build Node 18.15.0 successfully with `--enable-lto` passed to `./configure`, so you may want to add that to the template @paper42. Additionally, the package uses some vendored dependencies that are available in the repos (e.g. brotli), so you might want to make the package use those dependencies from the repos instead.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PR PATCH] [Updated] [NOMERGE] nodejs: update to 18.12.1.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
` (4 preceding siblings ...)
2023-03-23 10:13 ` mhmdanas
@ 2023-06-02 20:06 ` paper42
2023-06-03 19:35 ` nodejs: update to 18.16.0 paper42
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2023-06-02 20:06 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
There is an updated pull request by paper42 against master on the void-packages repository
https://github.com/paper42/void-packages nodejs-18
https://github.com/void-linux/void-packages/pull/41239
[NOMERGE] nodejs: update to 18.12.1.
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Blockers
- [ ] element-desktop - nodejs 18 not supported upstream
- [x] vscode - nodejs 18 not supported upstream
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/41239.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nodejs-18-41239.patch --]
[-- Type: text/x-diff, Size: 6493 bytes --]
From d45656ca5bdcd7e6cdfe8bd1dce681d919916557 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 22 Dec 2022 10:43:50 +0100
Subject: [PATCH 1/2] nodejs: update to 18.16.0.
---
...s-v8-src-trap-handler-trap-handler.h.patch | 31 ------------
srcpkgs/nodejs/patches/cross-aarch64.patch | 48 ++++++++++++-------
srcpkgs/nodejs/template | 8 ++--
3 files changed, 35 insertions(+), 52 deletions(-)
delete mode 100644 srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
diff --git a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch b/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
deleted file mode 100644
index 56529af97223..000000000000
--- a/srcpkgs/nodejs/patches/999-deps-v8-src-trap-handler-trap-handler.h.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/nxhack/openwrt-node-packages/blob/master/node/patches/v16.x/999-deps-v8-src-trap-handler-trap-handler.h.patch
-
---- a/deps/v8/src/trap-handler/trap-handler.h
-+++ b/deps/v8/src/trap-handler/trap-handler.h
-@@ -17,19 +17,16 @@ namespace v8 {
- namespace internal {
- namespace trap_handler {
-
--// X64 on Linux, Windows, MacOS, FreeBSD.
--#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
-- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_MACOSX || \
-- V8_OS_FREEBSD)
-+#if V8_TARGET_ARCH_X64 && V8_OS_LINUX && !V8_OS_ANDROID
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 (non-simulator) on Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_ARM64 && V8_OS_MACOSX
-+#elif V8_TARGET_ARCH_X64 && V8_OS_WIN
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Arm64 simulator on x64 on Linux or Mac.
--#elif V8_TARGET_ARCH_ARM64 && V8_HOST_ARCH_X64 && (V8_OS_LINUX || V8_OS_MACOSX)
--#define V8_TRAP_HANDLER_VIA_SIMULATOR
-+#elif V8_TARGET_ARCH_X64 && V8_OS_MACOSX
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_TARGET_ARCH_X64 && V8_OS_FREEBSD
-+#define V8_TRAP_HANDLER_SUPPORTED true
-+#elif V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX
- #define V8_TRAP_HANDLER_SUPPORTED true
--// Everything else is unsupported.
- #else
- #define V8_TRAP_HANDLER_SUPPORTED false
- #endif
diff --git a/srcpkgs/nodejs/patches/cross-aarch64.patch b/srcpkgs/nodejs/patches/cross-aarch64.patch
index 3b96c87f2fdb..fa05cb15813e 100644
--- a/srcpkgs/nodejs/patches/cross-aarch64.patch
+++ b/srcpkgs/nodejs/patches/cross-aarch64.patch
@@ -1,29 +1,43 @@
-From 4ac90c41065d338c4305cf6dc39e3084b21a7f79 Mon Sep 17 00:00:00 2001
-From: Michal Vasilek <michal@vasilek.cz>
-Date: Sun, 20 Nov 2022 19:22:03 +0100
-Subject: [PATCH] Revert "build: enable pointer authentication for branch
- protection on arm64"
+From 6bdf9dc3ec7dbff00acef081f4e3dd3e061fd744 Mon Sep 17 00:00:00 2001
+From: Ben Noordhuis <info@bnoordhuis.nl>
+Date: Tue, 6 Dec 2022 11:27:49 +0100
+Subject: [PATCH] build: fix arm64 cross-compilation
-This reverts commit 938212f3e74a74d0b436941aa24e71425ff666c5.
+Commit 938212f added -msign-return-address=all to _all_ cflags but that
+is wrong when cross-compiling, it should only be added to the target's
+cflags.
+
+Fixes: https://github.com/nodejs/node/issues/42888
---
- configure.py | 4 ----
- 1 file changed, 4 deletions(-)
+ configure.py | 2 --
+ node.gyp | 3 +++
+ 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.py b/configure.py
-index d3192ca04c..2d049eb938 100755
+index 40e0395e..9de3148f 100755
--- a/configure.py
+++ b/configure.py
-@@ -1241,10 +1241,6 @@ def configure_node(o):
+@@ -1294,9 +1294,7 @@ def configure_node(o):
o['variables']['want_separate_host_toolset'] = int(cross_compiling)
- # Enable branch protection for arm64
-- if target_arch == 'arm64':
+ if target_arch == 'arm64':
- o['cflags']+=['-msign-return-address=all']
--
+ o['variables']['arm_fpu'] = options.arm_fpu or 'neon'
+
if options.node_snapshot_main is not None:
- if options.shared:
- # This should be possible to fix, but we will need to refactor the
---
-2.38.1
-
+diff --git a/node.gyp b/node.gyp
+index cf52281b..5218d941 100644
+--- a/node.gyp
++++ b/node.gyp
+@@ -112,6 +112,9 @@
+ },
+
+ 'conditions': [
++ ['target_arch=="arm64"', {
++ 'cflags': ['-msign-return-address=all'], # Pointer authentication.
++ }],
+ ['OS in "aix os400"', {
+ 'ldflags': [
+ '-Wl,-bnoerrmsg',
diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template
index a53792a6544f..46364d382448 100644
--- a/srcpkgs/nodejs/template
+++ b/srcpkgs/nodejs/template
@@ -1,7 +1,7 @@
# Template file for 'nodejs'
pkgname=nodejs
-version=16.19.0
-revision=2
+version=18.16.0
+revision=1
# Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079
hostmakedepends="which pkg-config python3 libatomic-devel zlib-devel
$(vopt_if icu icu-devel) $(vopt_if ssl openssl-devel) $(vopt_if libuv libuv-devel)
@@ -15,7 +15,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT"
homepage="https://nodejs.org/"
distfiles="https://nodejs.org/dist/v${version}/node-v${version}.tar.gz"
-checksum=8b8a2939fa5f654ff61cae29b12118c24109273458ecbe6162ad8a8858309e0d
+checksum=6a4f5c5d76e5c50cef673099e56f19bc3266ae363f56ca0ab77dd2f3c5088c6d
python_version=3
build_options="ssl libuv icu nghttp2 cares"
@@ -41,7 +41,7 @@ fi
case "$XBPS_TARGET_MACHINE" in
ppc64*) ;;
- ppc*) broken="Node 16.x does not support 32-bit ppc" ;;
+ ppc*) broken="Node 18.x does not support 32-bit ppc" ;;
esac
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
From 18991356611d25c9f9fa0c2ff32d38263648e8c9 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Fri, 2 Jun 2023 21:44:36 +0200
Subject: [PATCH 2/2] Signal-Desktop: remove nodejs 16 workaround
---
srcpkgs/Signal-Desktop/template | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/srcpkgs/Signal-Desktop/template b/srcpkgs/Signal-Desktop/template
index 4c6722055987..ed9d4b94851e 100644
--- a/srcpkgs/Signal-Desktop/template
+++ b/srcpkgs/Signal-Desktop/template
@@ -21,8 +21,7 @@ post_extract() {
# git-lfs hook needs to be installed for one of the dependencies
git lfs install
- #vsed 's/"node": "/&>=/' -i package.json
- vsed 's/"node": "18.14.0"/"node": ">=16.19.0"/' -i package.json
+ vsed 's/"node": "/&>=/' -i package.json
# Dependencies have to be installed before applying patch
yarn install --ignore-engines --frozen-lockfile
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: nodejs: update to 18.16.0.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
` (5 preceding siblings ...)
2023-06-02 20:06 ` [PR PATCH] [Updated] " paper42
@ 2023-06-03 19:35 ` paper42
2023-06-03 19:47 ` paper42
2023-06-03 19:47 ` [PR PATCH] [Closed]: " paper42
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2023-06-03 19:35 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 588 bytes --]
New comment by paper42 on void-packages repository
https://github.com/void-linux/void-packages/pull/41239#issuecomment-1575150287
Comment:
> I was able to build Node 18.15.0 successfully with `--enable-lto` passed to `./configure`, so you may want to add that to the template @paper42. Additionally, the package uses some vendored dependencies that are available in the repos (e.g. brotli), so you might want to make the package use those dependencies from the repos instead.
hi, I think that moving this PR forward is more important than this for now, could you open a separate PR?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: nodejs: update to 18.16.0.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
` (6 preceding siblings ...)
2023-06-03 19:35 ` nodejs: update to 18.16.0 paper42
@ 2023-06-03 19:47 ` paper42
2023-06-03 19:47 ` [PR PATCH] [Closed]: " paper42
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2023-06-03 19:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 192 bytes --]
New comment by paper42 on void-packages repository
https://github.com/void-linux/void-packages/pull/41239#issuecomment-1575159131
Comment:
merged in c6d44d3f9a80dd5b5dc672b47fe28864a6af8a89
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PR PATCH] [Closed]: nodejs: update to 18.16.0.
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
` (7 preceding siblings ...)
2023-06-03 19:47 ` paper42
@ 2023-06-03 19:47 ` paper42
8 siblings, 0 replies; 10+ messages in thread
From: paper42 @ 2023-06-03 19:47 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]
There's a closed pull request on the void-packages repository
nodejs: update to 18.16.0.
https://github.com/void-linux/void-packages/pull/41239
Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **briefly**
#### Blockers
- [x] element-desktop - nodejs 18 not supported upstream
- [x] vscode - nodejs 18 not supported upstream
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-06-03 19:47 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-22 16:29 [PR PATCH] [NOMERGE] nodejs: update to 18.12.1 paper42
2022-12-22 16:44 ` [PR PATCH] [Updated] " paper42
2022-12-24 23:44 ` paper42
2023-03-02 20:45 ` paper42
2023-03-06 22:46 ` dkwo
2023-03-23 10:13 ` mhmdanas
2023-06-02 20:06 ` [PR PATCH] [Updated] " paper42
2023-06-03 19:35 ` nodejs: update to 18.16.0 paper42
2023-06-03 19:47 ` paper42
2023-06-03 19:47 ` [PR PATCH] [Closed]: " paper42
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).