Skip to content

Commit 7fd70fa

Browse files
committed
1 parent 7aeffff commit 7fd70fa

26 files changed

+202
-169
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "11.0.0"
2+
".": "11.1.0"
33
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.18.1"
2+
".": "0.19.1"
33
}

node_modules/node-gyp/gyp/docs/Hacking.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ See [Testing](Testing.md) for more details on the test framework.
3434
Note that it can be handy to look at the project files output by the tests
3535
to diagnose problems. The easiest way to do that is by kindly asking the
3636
test driver to leave the temporary directories it creates in-place.
37-
This is done by setting the enviroment variable "PRESERVE", e.g.
37+
This is done by setting the environment variable "PRESERVE", e.g.
3838

3939
```
4040
set PRESERVE=all # On Windows

node_modules/node-gyp/gyp/docs/LanguageSpecification.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ have structural meaning for target definitions:
157157
| `all_dependent_settings` | A dictionary of settings to be applied to all dependents of the target, transitively. This includes direct dependents and the entire set of their dependents, and so on. This section may contain anything found within a `target` dictionary, except `configurations`, `target_name`, and `type` sections. Compare `direct_dependent_settings` and `link_settings`. |
158158
| `configurations` | A list of dictionaries defining build configurations for the target. See the "Configurations" section below. |
159159
| `copies` | A list of copy actions to perform. See the "Copies" section below. |
160-
| `defines` | A list of preprocesor definitions to be passed on the command line to the C/C++ compiler (via `-D` or `/D` options). |
160+
| `defines` | A list of preprocessor definitions to be passed on the command line to the C/C++ compiler (via `-D` or `/D` options). |
161161
| `dependencies` | A list of targets on which this target depends. Targets in other `.gyp` files are specified as `../path/to/other.gyp:target_we_want`. |
162162
| `direct_dependent_settings` | A dictionary of settings to be applied to other targets that depend on this target. These settings will only be applied to direct dependents. This section may contain anything found within a `target` dictionary, except `configurations`, `target_name`, and `type` sections. Compare with `all_dependent_settings` and `link_settings`. |
163163
| `include_dirs` | A list of include directories to be passed on the command line to the C/C++ compiler (via `-I` or `/I` options). |
@@ -208,8 +208,8 @@ Configuration dictionaries may also contain these elements:
208208

209209
Conditionals may appear within any dictionary in a `.gyp` file. There
210210
are two tpes of conditionals, which differ only in the timing of their
211-
processing. `conditons` sections are processed shortly after loading
212-
`.gyp` files, and `target_conditons` sections are processed after all
211+
processing. `conditions` sections are processed shortly after loading
212+
`.gyp` files, and `target_conditions` sections are processed after all
213213
dependencies have been computed.
214214

215215
A conditional section is introduced with a `conditions` or

node_modules/node-gyp/gyp/docs/Testing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -392,15 +392,15 @@ fails the test if it does.
392392

393393
Verifies that the output string contains all of the "lines" in the specified
394394
list of lines. In practice, the lines can be any substring and need not be
395-
`\n`-terminaed lines per se. If any line is missing, the test fails.
395+
`\n`-terminated lines per se. If any line is missing, the test fails.
396396

397397
```
398398
test.must_not_contain_any_lines(output, lines)
399399
```
400400

401401
Verifies that the output string does _not_ contain any of the "lines" in the
402402
specified list of lines. In practice, the lines can be any substring and need
403-
not be `\n`-terminaed lines per se. If any line exists in the output string,
403+
not be `\n`-terminated lines per se. If any line exists in the output string,
404404
the test fails.
405405

406406
```
@@ -409,7 +409,7 @@ the test fails.
409409

410410
Verifies that the output string contains at least one of the "lines" in the
411411
specified list of lines. In practice, the lines can be any substring and need
412-
not be `\n`-terminaed lines per se. If none of the specified lines is present,
412+
not be `\n`-terminated lines per se. If none of the specified lines is present,
413413
the test fails.
414414

415415
### Reading file contents

node_modules/node-gyp/gyp/docs/UserDocumentation.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describing all the information necessary to build the target.
104104

105105
`'conditions'`: A list of condition specifications that can modify the
106106
contents of the items in the global dictionary defined by this `.gyp`
107-
file based on the values of different variablwes. As implied by the
107+
file based on the values of different variables. As implied by the
108108
above example, the most common use of a `conditions` section in the
109109
top-level dictionary is to add platform-specific targets to the
110110
`targets` list.
@@ -375,7 +375,7 @@ If your platform-specific file does not contain a
375375
already in the `conditions` for the target), and you can't change the
376376
file name, there are two patterns that can be used.
377377

378-
**Prefererred**: Add the file to the `sources` list of the appropriate
378+
**Preferred**: Add the file to the `sources` list of the appropriate
379379
dictionary within the `targets` list. Add an appropriate `conditions`
380380
section to exclude the specific files name:
381381

@@ -807,7 +807,7 @@ directory:
807807
```
808808

809809
Adding a library often involves updating multiple `.gyp` files, adding
810-
the target to the approprate `.gyp` file (possibly a newly-added `.gyp`
810+
the target to the appropriate `.gyp` file (possibly a newly-added `.gyp`
811811
file), and updating targets in the other `.gyp` files that depend on
812812
(link with) the new library.
813813

@@ -858,7 +858,7 @@ because of those settings' being listed in the
858858
`direct_dependent_settings` block.
859859

860860
Note that these settings will likely need to be replicated in the
861-
settings for the library target itsef, so that the library will build
861+
settings for the library target itself, so that the library will build
862862
with the same options. This does not prevent the target from defining
863863
additional options for its "internal" use when compiling its own source
864864
files. (In the above example, these are the `LOCAL_DEFINE_FOR_LIBBAR`

node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def ValidateMSBuild(self, value):
171171
int(value, self._msbuild_base)
172172

173173
def ConvertToMSBuild(self, value):
174-
msbuild_format = (self._msbuild_base == 10) and "%d" or "0x%04x"
174+
msbuild_format = ((self._msbuild_base == 10) and "%d") or "0x%04x"
175175
return msbuild_format % int(value)
176176

177177

node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def UsesVcxproj(self):
6969

7070
def ProjectExtension(self):
7171
"""Returns the file extension for the project."""
72-
return self.uses_vcxproj and ".vcxproj" or ".vcproj"
72+
return (self.uses_vcxproj and ".vcxproj") or ".vcproj"
7373

7474
def Path(self):
7575
"""Returns the path to Visual Studio installation."""

node_modules/node-gyp/gyp/pylib/gyp/__init__.py

+23-10
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Use of this source code is governed by a BSD-style license that can be
55
# found in the LICENSE file.
66

7-
7+
from __future__ import annotations
88
import copy
99
import gyp.input
1010
import argparse
@@ -24,6 +24,18 @@
2424
DEBUG_VARIABLES = "variables"
2525
DEBUG_INCLUDES = "includes"
2626

27+
def EscapeForCString(string: bytes | str) -> str:
28+
if isinstance(string, str):
29+
string = string.encode(encoding='utf8')
30+
31+
backslash_or_double_quote = {ord('\\'), ord('"')}
32+
result = ''
33+
for char in string:
34+
if char in backslash_or_double_quote or not 32 <= char < 127:
35+
result += '\\%03o' % char
36+
else:
37+
result += chr(char)
38+
return result
2739

2840
def DebugOutput(mode, message, *args):
2941
if "all" in gyp.debug or mode in gyp.debug:
@@ -106,18 +118,19 @@ def Load(
106118

107119
output_dir = params["options"].generator_output or params["options"].toplevel_dir
108120
if default_variables["GENERATOR"] == "ninja":
109-
default_variables.setdefault(
110-
"PRODUCT_DIR_ABS",
111-
os.path.join(
112-
output_dir, "out", default_variables.get("build_type", "default")
113-
),
121+
product_dir_abs = os.path.join(
122+
output_dir, "out", default_variables.get("build_type", "default")
114123
)
115124
else:
116-
default_variables.setdefault(
117-
"PRODUCT_DIR_ABS",
118-
os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]),
125+
product_dir_abs = os.path.join(
126+
output_dir, default_variables["CONFIGURATION_NAME"]
119127
)
120128

129+
default_variables.setdefault("PRODUCT_DIR_ABS", product_dir_abs)
130+
default_variables.setdefault(
131+
"PRODUCT_DIR_ABS_CSTR", EscapeForCString(product_dir_abs)
132+
)
133+
121134
# Give the generator the opportunity to set additional variables based on
122135
# the params it will receive in the output phase.
123136
if getattr(generator, "CalculateVariables", None):
@@ -253,7 +266,7 @@ def Noop(value):
253266
for name, metadata in options._regeneration_metadata.items():
254267
opt = metadata["opt"]
255268
value = getattr(options, name)
256-
value_predicate = metadata["type"] == "path" and FixPath or Noop
269+
value_predicate = (metadata["type"] == "path" and FixPath) or Noop
257270
action = metadata["action"]
258271
env_name = metadata["env_name"]
259272
if action == "append":

node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ def find_matching_test_target_names(self):
699699
) & set(self._root_targets)
700700
if matching_test_targets_contains_all:
701701
# Remove any of the targets for all that were not explicitly supplied,
702-
# 'all' is subsequentely added to the matching names below.
702+
# 'all' is subsequently added to the matching names below.
703703
matching_test_targets = list(
704704
set(matching_test_targets) & set(test_targets_no_all)
705705
)

node_modules/node-gyp/gyp/pylib/gyp/generator/android.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def ExtractIncludesFromCFlags(self, cflags):
769769
Args:
770770
cflags: A list of compiler flags, which may be mixed with "-I.."
771771
Returns:
772-
A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed.
772+
A tuple of lists: (clean_cflags, include_paths). "-I.." is trimmed.
773773
"""
774774
clean_cflags = []
775775
include_paths = []

node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def WriteActions(target_name, actions, extra_sources, extra_deps, path_to_gyp, o
251251
target_name: the name of the CMake target being generated.
252252
actions: the Gyp 'actions' dict for this target.
253253
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
254-
extra_deps: [<cmake_taget>] to append with generated targets.
254+
extra_deps: [<cmake_target>] to append with generated targets.
255255
path_to_gyp: relative path from CMakeLists.txt being generated to
256256
the Gyp file in which the target being generated is defined.
257257
"""
@@ -340,7 +340,7 @@ def WriteRules(target_name, rules, extra_sources, extra_deps, path_to_gyp, outpu
340340
target_name: the name of the CMake target being generated.
341341
actions: the Gyp 'actions' dict for this target.
342342
extra_sources: [(<cmake_src>, <src>)] to append with generated source files.
343-
extra_deps: [<cmake_taget>] to append with generated targets.
343+
extra_deps: [<cmake_target>] to append with generated targets.
344344
path_to_gyp: relative path from CMakeLists.txt being generated to
345345
the Gyp file in which the target being generated is defined.
346346
"""
@@ -457,7 +457,7 @@ def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output):
457457
Args:
458458
target_name: the name of the CMake target being generated.
459459
actions: the Gyp 'actions' dict for this target.
460-
extra_deps: [<cmake_taget>] to append with generated targets.
460+
extra_deps: [<cmake_target>] to append with generated targets.
461461
path_to_gyp: relative path from CMakeLists.txt being generated to
462462
the Gyp file in which the target being generated is defined.
463463
"""
@@ -603,7 +603,7 @@ class CMakeNamer:
603603
"""
604604

605605
def __init__(self, target_list):
606-
self.cmake_target_base_names_conficting = set()
606+
self.cmake_target_base_names_conflicting = set()
607607

608608
cmake_target_base_names_seen = set()
609609
for qualified_target in target_list:
@@ -612,11 +612,11 @@ def __init__(self, target_list):
612612
if cmake_target_base_name not in cmake_target_base_names_seen:
613613
cmake_target_base_names_seen.add(cmake_target_base_name)
614614
else:
615-
self.cmake_target_base_names_conficting.add(cmake_target_base_name)
615+
self.cmake_target_base_names_conflicting.add(cmake_target_base_name)
616616

617617
def CreateCMakeTargetName(self, qualified_target):
618618
base_name = CreateCMakeTargetBaseName(qualified_target)
619-
if base_name in self.cmake_target_base_names_conficting:
619+
if base_name in self.cmake_target_base_names_conflicting:
620620
return CreateCMakeTargetFullName(qualified_target)
621621
return base_name
622622

node_modules/node-gyp/gyp/pylib/gyp/generator/make.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def CalculateGeneratorInputInfo(params):
208208

209209
LINK_COMMANDS_MAC = """\
210210
quiet_cmd_alink = LIBTOOL-STATIC $@
211-
cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
211+
cmd_alink = rm -f $@ && %(python)s gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %%.o,$^)
212212
213213
quiet_cmd_link = LINK($(TOOLSET)) $@
214214
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
@@ -218,7 +218,7 @@ def CalculateGeneratorInputInfo(params):
218218
219219
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
220220
cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
221-
""" # noqa: E501
221+
""" % {'python': sys.executable} # noqa: E501
222222

223223
LINK_COMMANDS_ANDROID = """\
224224
quiet_cmd_alink = AR($(TOOLSET)) $@
@@ -609,14 +609,14 @@ def CalculateGeneratorInputInfo(params):
609609
# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd
610610
# already.
611611
quiet_cmd_mac_tool = MACTOOL $(4) $<
612-
cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@"
612+
cmd_mac_tool = %(python)s gyp-mac-tool $(4) $< "$@"
613613
614614
quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@
615-
cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4)
615+
cmd_mac_package_framework = %(python)s gyp-mac-tool package-framework "$@" $(4)
616616
617617
quiet_cmd_infoplist = INFOPLIST $@
618618
cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@"
619-
""" # noqa: E501
619+
""" % {'python': sys.executable} # noqa: E501
620620

621621

622622
def WriteRootHeaderSuffixRules(writer):
@@ -788,7 +788,7 @@ def __init__(self, generator_flags, flavor):
788788
self.suffix_rules_objdir2 = {}
789789

790790
# Generate suffix rules for all compilable extensions.
791-
for ext in COMPILABLE_EXTENSIONS:
791+
for ext, value in COMPILABLE_EXTENSIONS.items():
792792
# Suffix rules for source folder.
793793
self.suffix_rules_srcdir.update(
794794
{
@@ -797,7 +797,7 @@ def __init__(self, generator_flags, flavor):
797797
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD
798798
\t@$(call do_cmd,%s,1)
799799
"""
800-
% (ext, COMPILABLE_EXTENSIONS[ext])
800+
% (ext, value)
801801
)
802802
}
803803
)
@@ -810,7 +810,7 @@ def __init__(self, generator_flags, flavor):
810810
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD
811811
\t@$(call do_cmd,%s,1)
812812
"""
813-
% (ext, COMPILABLE_EXTENSIONS[ext])
813+
% (ext, value)
814814
)
815815
}
816816
)
@@ -821,7 +821,7 @@ def __init__(self, generator_flags, flavor):
821821
$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
822822
\t@$(call do_cmd,%s,1)
823823
"""
824-
% (ext, COMPILABLE_EXTENSIONS[ext])
824+
% (ext, value)
825825
)
826826
}
827827
)
@@ -1779,13 +1779,13 @@ def WriteTarget(
17791779
# using ":=".
17801780
self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv())
17811781

1782-
for configname in target_postbuilds:
1782+
for configname, value in target_postbuilds.items():
17831783
self.WriteLn(
17841784
"%s: TARGET_POSTBUILDS_%s := %s"
17851785
% (
17861786
QuoteSpaces(self.output),
17871787
configname,
1788-
gyp.common.EncodePOSIXShellList(target_postbuilds[configname]),
1788+
gyp.common.EncodePOSIXShellList(value),
17891789
)
17901790
)
17911791

@@ -1834,7 +1834,7 @@ def WriteTarget(
18341834
# Since this target depends on binary and resources which are in
18351835
# nested subfolders, the framework directory will be older than
18361836
# its dependencies usually. To prevent this rule from executing
1837-
# on every build (expensive, especially with postbuilds), expliclity
1837+
# on every build (expensive, especially with postbuilds), explicitly
18381838
# update the time on the framework directory.
18391839
self.WriteLn("\t@touch -c %s" % QuoteSpaces(self.output))
18401840

@@ -2498,7 +2498,7 @@ def CalculateMakefilePath(build_file, base_name):
24982498
"PLI.host": PLI_host,
24992499
}
25002500
if flavor == "mac":
2501-
flock_command = "./gyp-mac-tool flock"
2501+
flock_command = "%s gyp-mac-tool flock" % sys.executable
25022502
header_params.update(
25032503
{
25042504
"flock": flock_command,
@@ -2548,7 +2548,7 @@ def CalculateMakefilePath(build_file, base_name):
25482548
header_params.update(
25492549
{
25502550
"copy_archive_args": copy_archive_arguments,
2551-
"flock": "./gyp-flock-tool flock",
2551+
"flock": "%s gyp-flock-tool flock" % sys.executable,
25522552
"flock_index": 2,
25532553
}
25542554
)
@@ -2564,7 +2564,7 @@ def CalculateMakefilePath(build_file, base_name):
25642564
{
25652565
"copy_archive_args": copy_archive_arguments,
25662566
"link_commands": LINK_COMMANDS_AIX,
2567-
"flock": "./gyp-flock-tool flock",
2567+
"flock": "%s gyp-flock-tool flock" % sys.executable,
25682568
"flock_index": 2,
25692569
}
25702570
)
@@ -2574,7 +2574,7 @@ def CalculateMakefilePath(build_file, base_name):
25742574
{
25752575
"copy_archive_args": copy_archive_arguments,
25762576
"link_commands": LINK_COMMANDS_OS400,
2577-
"flock": "./gyp-flock-tool flock",
2577+
"flock": "%s gyp-flock-tool flock" % sys.executable,
25782578
"flock_index": 2,
25792579
}
25802580
)

0 commit comments

Comments
 (0)