mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
tools: update gyp-next to 0.19.0
PR-URL: https://github.com/nodejs/node/pull/56158 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
This commit is contained in:
1 parent
e48c5b2f03
commit
fdf225a7ec
11 files changed
+53
-36
No files matched your search
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## [0.19.0](https://github.com/nodejs/gyp-next/compare/v0.18.3...v0.19.0) (2024-12-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* provide escaped version of `PRODUCT_DIR_ABS` ([#271](https://github.com/nodejs/gyp-next/issues/271)) ([3bf3b1c](https://github.com/nodejs/gyp-next/commit/3bf3b1cda26f16c645e0fdd5582ffbf49d9a2580))
|
||||
|
||||
## [0.18.3](https://github.com/nodejs/gyp-next/compare/v0.18.2...v0.18.3) (2024-10-08)
|
||||
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class _Integer(_Type):
|
||||
int(value, self._msbuild_base)
|
||||
|
||||
def ConvertToMSBuild(self, value):
|
||||
msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x"
|
||||
msbuild_format = ((self._msbuild_base == 10) and "%d") or "0x%04x"
|
||||
return msbuild_format % int(value)
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class VisualStudioVersion:
|
||||
|
||||
def ProjectExtension(self):
|
||||
"""Returns the file extension for the project."""
|
||||
return self.uses_vcxproj and ".vcxproj" or ".vcproj"
|
||||
return (self.uses_vcxproj and ".vcxproj") or ".vcproj"
|
||||
|
||||
def Path(self):
|
||||
"""Returns the path to Visual Studio installation."""
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import copy
|
||||
import gyp.input
|
||||
import argparse
|
||||
@@ -24,6 +24,18 @@ DEBUG_GENERAL = "general"
|
||||
DEBUG_VARIABLES = "variables"
|
||||
DEBUG_INCLUDES = "includes"
|
||||
|
||||
def EscapeForCString(string: bytes | str) -> str:
|
||||
if isinstance(string, str):
|
||||
string = string.encode(encoding='utf8')
|
||||
|
||||
backslash_or_double_quote = {ord('\\'), ord('"')}
|
||||
result = []
|
||||
for char in string:
|
||||
if char in backslash_or_double_quote or not 32 <= char < 127:
|
||||
result += '\\%03o' % char
|
||||
else:
|
||||
result += chr(char)
|
||||
return result
|
||||
|
||||
def DebugOutput(mode, message, *args):
|
||||
if "all" in gyp.debug or mode in gyp.debug:
|
||||
@@ -106,18 +118,19 @@ def Load(
|
||||
|
||||
output_dir = params["options"].generator_output or params["options"].toplevel_dir
|
||||
if default_variables["GENERATOR"] == "ninja":
|
||||
default_variables.setdefault(
|
||||
"PRODUCT_DIR_ABS",
|
||||
os.path.join(
|
||||
output_dir, "out", default_variables.get("build_type", "default")
|
||||
),
|
||||
product_dir_abs = os.path.join(
|
||||
output_dir, "out", default_variables.get("build_type", "default")
|
||||
)
|
||||
else:
|
||||
default_variables.setdefault(
|
||||
"PRODUCT_DIR_ABS",
|
||||
os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]),
|
||||
product_dir_abs = os.path.join(
|
||||
output_dir, default_variables["CONFIGURATION_NAME"]
|
||||
)
|
||||
|
||||
default_variables.setdefault("PRODUCT_DIR_ABS", product_dir_abs)
|
||||
default_variables.setdefault(
|
||||
"PRODUCT_DIR_ABS_CSTR", EscapeForCString(product_dir_abs)
|
||||
)
|
||||
|
||||
# Give the generator the opportunity to set additional variables based on
|
||||
# the params it will receive in the output phase.
|
||||
if getattr(generator, "CalculateVariables", None):
|
||||
@@ -253,7 +266,7 @@ def RegenerateFlags(options):
|
||||
for name, metadata in options._regeneration_metadata.items():
|
||||
opt = metadata["opt"]
|
||||
value = getattr(options, name)
|
||||
value_predicate = metadata["type"] == "path" and FixPath or Noop
|
||||
value_predicate = (metadata["type"] == "path" and FixPath) or Noop
|
||||
action = metadata["action"]
|
||||
env_name = metadata["env_name"]
|
||||
if action == "append":
|
||||
|
||||
@@ -788,7 +788,7 @@ class MakefileWriter:
|
||||
self.suffix_rules_objdir2 = {}
|
||||
|
||||
# Generate suffix rules for all compilable extensions.
|
||||
for ext in COMPILABLE_EXTENSIONS:
|
||||
for ext, value in COMPILABLE_EXTENSIONS.items():
|
||||
# Suffix rules for source folder.
|
||||
self.suffix_rules_srcdir.update(
|
||||
{
|
||||
@@ -797,7 +797,7 @@ class MakefileWriter:
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD
|
||||
\t@$(call do_cmd,%s,1)
|
||||
"""
|
||||
% (ext, COMPILABLE_EXTENSIONS[ext])
|
||||
% (ext, value)
|
||||
)
|
||||
}
|
||||
)
|
||||
@@ -810,7 +810,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD
|
||||
\t@$(call do_cmd,%s,1)
|
||||
"""
|
||||
% (ext, COMPILABLE_EXTENSIONS[ext])
|
||||
% (ext, value)
|
||||
)
|
||||
}
|
||||
)
|
||||
@@ -821,7 +821,7 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD
|
||||
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
|
||||
\t@$(call do_cmd,%s,1)
|
||||
"""
|
||||
% (ext, COMPILABLE_EXTENSIONS[ext])
|
||||
% (ext, value)
|
||||
)
|
||||
}
|
||||
)
|
||||
@@ -1779,13 +1779,13 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
|
||||
# using ":=".
|
||||
self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv())
|
||||
|
||||
for configname in target_postbuilds:
|
||||
for configname, value in target_postbuilds.items():
|
||||
self.WriteLn(
|
||||
"%s: TARGET_POSTBUILDS_%s := %s"
|
||||
% (
|
||||
QuoteSpaces(self.output),
|
||||
configname,
|
||||
gyp.common.EncodePOSIXShellList(target_postbuilds[configname]),
|
||||
gyp.common.EncodePOSIXShellList(value),
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -2469,11 +2469,8 @@ def SetUpConfigurations(target, target_dict):
|
||||
merged_configurations[configuration] = new_configuration_dict
|
||||
|
||||
# Put the new configurations back into the target dict as a configuration.
|
||||
for configuration in merged_configurations:
|
||||
target_dict["configurations"][configuration] = merged_configurations[
|
||||
configuration
|
||||
]
|
||||
|
||||
for configuration, value in merged_configurations.items():
|
||||
target_dict["configurations"][configuration] = value
|
||||
# Now drop all the abstract ones.
|
||||
configs = target_dict["configurations"]
|
||||
target_dict["configurations"] = {
|
||||
@@ -3020,8 +3017,8 @@ def Load(
|
||||
del target_dict[key]
|
||||
ProcessListFiltersInDict(target_name, tmp_dict)
|
||||
# Write the results back to |target_dict|.
|
||||
for key in tmp_dict:
|
||||
target_dict[key] = tmp_dict[key]
|
||||
for key, value in tmp_dict.items():
|
||||
target_dict[key] = value
|
||||
|
||||
# Make sure every dependency appears at most once.
|
||||
RemoveDuplicateDependencies(targets)
|
||||
|
||||
@@ -1127,8 +1127,8 @@ class XcodeSettings:
|
||||
be deployed to a device. This should be run as the very last step of the
|
||||
build."""
|
||||
if not (
|
||||
self.isIOS
|
||||
and (self.spec["type"] == "executable" or self._IsXCTest())
|
||||
(self.isIOS
|
||||
and (self.spec["type"] == "executable" or self._IsXCTest()))
|
||||
or self.IsIosFramework()
|
||||
):
|
||||
return []
|
||||
|
||||
@@ -3017,10 +3017,10 @@ class PBXProject(XCContainerPortal):
|
||||
symroots = self._DefinedSymroots(target)
|
||||
for s in self._DefinedSymroots(target):
|
||||
if (
|
||||
s is not None
|
||||
and not self._IsUniqueSymrootForTarget(s)
|
||||
or s is None
|
||||
and not inherit_unique_symroot
|
||||
(s is not None
|
||||
and not self._IsUniqueSymrootForTarget(s))
|
||||
or (s is None
|
||||
and not inherit_unique_symroot)
|
||||
):
|
||||
return False
|
||||
return True if symroots else inherit_unique_symroot
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "gyp-next"
|
||||
version = "0.18.3"
|
||||
version = "0.19.0"
|
||||
authors = [
|
||||
{ name="Node.js contributors", email="ryzokuken@disroot.org" },
|
||||
]
|
||||
|
||||
@@ -93,10 +93,10 @@ def ParseSolution(solution_file):
|
||||
continue
|
||||
|
||||
# Change all dependencies clsid to name instead.
|
||||
for project in dependencies:
|
||||
for project, deps in dependencies.items():
|
||||
# For each dependencies in this project
|
||||
new_dep_array = []
|
||||
for dep in dependencies[project]:
|
||||
for dep in deps:
|
||||
# Look for the project name matching this cldis
|
||||
for project_info in projects:
|
||||
if projects[project_info][1] == dep:
|
||||
|
||||
@@ -118,8 +118,8 @@ def FixFilenames(filenames, current_directory):
|
||||
new_list = []
|
||||
for filename in filenames:
|
||||
if filename:
|
||||
for key in REPLACEMENTS:
|
||||
filename = filename.replace(key, REPLACEMENTS[key])
|
||||
for key, value in REPLACEMENTS.items():
|
||||
filename = filename.replace(key, value)
|
||||
os.chdir(current_directory)
|
||||
filename = filename.strip("\"' ")
|
||||
if filename.startswith("$"):
|
||||
|
||||
Reference in new issue
Block a user