From 99fcf84a12146fccca3a4cba378d83e6ab4e42af Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 10 Dec 2024 14:06:31 -0500 Subject: [PATCH 1/2] tools: update gyp-next to 0.19.1 --- tools/gyp/CHANGELOG.md | 7 +++++++ tools/gyp/pylib/gyp/__init__.py | 2 +- tools/gyp/pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/gyp/CHANGELOG.md b/tools/gyp/CHANGELOG.md index 2bec1383e698f9..22257ab93d8929 100644 --- a/tools/gyp/CHANGELOG.md +++ b/tools/gyp/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.19.1](https://github.com/nodejs/gyp-next/compare/v0.19.0...v0.19.1) (2024-12-09) + + +### Bug Fixes + +* fixup for break in EscapeForCString ([#274](https://github.com/nodejs/gyp-next/issues/274)) ([610f661](https://github.com/nodejs/gyp-next/commit/610f661da877a358c8b3cbc106b528fb1d0b8095)) + ## [0.19.0](https://github.com/nodejs/gyp-next/compare/v0.18.3...v0.19.0) (2024-12-03) diff --git a/tools/gyp/pylib/gyp/__init__.py b/tools/gyp/pylib/gyp/__init__.py index 5b16e0b9a02f5b..8933d0c4f707c9 100755 --- a/tools/gyp/pylib/gyp/__init__.py +++ b/tools/gyp/pylib/gyp/__init__.py @@ -29,7 +29,7 @@ def EscapeForCString(string: bytes | str) -> str: string = string.encode(encoding='utf8') backslash_or_double_quote = {ord('\\'), ord('"')} - result = [] + result = '' for char in string: if char in backslash_or_double_quote or not 32 <= char < 127: result += '\\%03o' % char diff --git a/tools/gyp/pyproject.toml b/tools/gyp/pyproject.toml index 7fbd609554bde2..4b0c88c8a22c43 100644 --- a/tools/gyp/pyproject.toml +++ b/tools/gyp/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "gyp-next" -version = "0.19.0" +version = "0.19.1" authors = [ { name="Node.js contributors", email="ryzokuken@disroot.org" }, ] From 486ff15c01959f40b2ec8c5a6a658bd2494d6877 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 2 Dec 2024 14:23:49 +0100 Subject: [PATCH 2/2] build: fix C string encoding for `PRODUCT_DIR_ABS` Since the `PRODUCT_DIR_ABS` gyp variable is meant to be used in a C string in the OpenSSL config, provide a version of it that actually provides it in a way that is always usable as a C string. Otherwise, unescaped characters in the path can mess with the string definitions; for example, building in paths on Windows whose directories start with valid or invalid escape sequences (e.g.: `C:\...\x61foobar\...` or `C:\...\456789\...`) can result in failing builds or incorrect paths provided to OpenSSL. --- deps/openssl/openssl.gyp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp index f6b157f8d60813..ea3a2dc09ef29b 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -5,19 +5,13 @@ 'nasm_version%': '0.0', 'openssl-cli': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)openssl-cli<(EXECUTABLE_SUFFIX)', 'conditions': [ - ['OS == "win"', { - 'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj', - }], ['GENERATOR == "ninja"', { - 'obj_dir_abs': '<(PRODUCT_DIR_ABS)/obj', - 'modules_dir': '<(PRODUCT_DIR_ABS)/obj/lib/openssl-modules', + 'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj/lib/openssl-modules', }, { - 'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target', - 'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules', + 'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj.target/deps/openssl/lib/openssl-modules', }], ['OS=="mac"', { - 'obj_dir_abs%': '<(PRODUCT_DIR_ABS)/obj.target', - 'modules_dir': '<(PRODUCT_DIR_ABS)/obj.target/deps/openssl/lib/openssl-modules', + 'modules_dir': '<(PRODUCT_DIR_ABS_CSTR)/obj.target/deps/openssl/lib/openssl-modules', }], ], },