Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGar <gar+gh@danger.computer>2022-11-01 23:47:32 +0300
committerGar <wraithgar@github.com>2022-11-02 20:38:44 +0300
commit2fef570caf00bd92a3a4cf0b2bc4ce56fd8bd594 (patch)
tree001d6c3a9c735e16b75afe0db5d0790774728e3e
parent1f5382dada181cda41f1504974de1e69a6c1ad7f (diff)
deps: node-gyp@9.3.0
-rw-r--r--node_modules/.gitignore1
-rw-r--r--node_modules/node-gyp/addon.gypi43
-rwxr-xr-xnode_modules/node-gyp/gyp/pylib/gyp/__init__.py24
-rw-r--r--node_modules/node-gyp/gyp/pylib/gyp/common.py13
-rwxr-xr-xnode_modules/node-gyp/gyp/pylib/gyp/flock_tool.py2
-rw-r--r--node_modules/node-gyp/gyp/pylib/gyp/generator/make.py261
-rw-r--r--node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py11
-rw-r--r--node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py8
-rw-r--r--node_modules/node-gyp/gyp/pylib/gyp/input.py21
-rw-r--r--node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py2
-rw-r--r--node_modules/node-gyp/gyp/pyproject.toml41
-rw-r--r--node_modules/node-gyp/gyp/requirements_dev.txt2
-rw-r--r--node_modules/node-gyp/gyp/setup.py42
-rwxr-xr-xnode_modules/node-gyp/gyp/test_gyp.py1
-rwxr-xr-xnode_modules/node-gyp/gyp/tools/pretty_gyp.py2
-rw-r--r--node_modules/node-gyp/lib/build.js2
-rw-r--r--node_modules/node-gyp/lib/configure.js49
-rw-r--r--node_modules/node-gyp/lib/find-visualstudio.js5
-rw-r--r--node_modules/node-gyp/node_modules/nopt/LICENSE15
-rwxr-xr-xnode_modules/node-gyp/node_modules/nopt/bin/nopt.js54
-rw-r--r--node_modules/node-gyp/node_modules/nopt/lib/nopt.js441
-rw-r--r--node_modules/node-gyp/node_modules/nopt/package.json34
-rw-r--r--node_modules/node-gyp/package.json4
-rw-r--r--node_modules/node-gyp/test/test-find-node-directory.js2
-rwxr-xr-xnode_modules/node-gyp/update-gyp.py20
-rw-r--r--package-lock.json23
-rw-r--r--package.json2
27 files changed, 438 insertions, 687 deletions
diff --git a/node_modules/.gitignore b/node_modules/.gitignore
index 92d5c9cce..f4e8be555 100644
--- a/node_modules/.gitignore
+++ b/node_modules/.gitignore
@@ -170,7 +170,6 @@
!/node-gyp/node_modules/make-fetch-happen
!/node-gyp/node_modules/minimatch
!/node-gyp/node_modules/minipass-fetch
-!/node-gyp/node_modules/nopt
!/node-gyp/node_modules/npmlog
!/node-gyp/node_modules/ssri
!/node-gyp/node_modules/unique-filename
diff --git a/node_modules/node-gyp/addon.gypi b/node_modules/node-gyp/addon.gypi
index 9327b0d72..b4ac369ac 100644
--- a/node_modules/node-gyp/addon.gypi
+++ b/node_modules/node-gyp/addon.gypi
@@ -103,22 +103,41 @@
'-Wl,-bimport:<(node_exp_file)'
],
}],
+ [ 'OS=="os400"', {
+ 'ldflags': [
+ '-Wl,-bimport:<(node_exp_file)'
+ ],
+ }],
[ 'OS=="zos"', {
- 'cflags': [
- '-q64',
- '-Wc,DLL',
- '-qlonglong',
- '-qenum=int',
- '-qxclang=-fexec-charset=ISO8859-1'
+ 'conditions': [
+ [ '"<!(echo $CC)" != "clang" and \
+ "<!(echo $CC)" != "ibm-clang64" and \
+ "<!(echo $CC)" != "ibm-clang"', {
+ 'cflags': [
+ '-q64',
+ '-Wc,DLL',
+ '-qlonglong',
+ '-qenum=int',
+ '-qxclang=-fexec-charset=ISO8859-1'
+ ],
+ 'ldflags': [
+ '-q64',
+ '<(node_exp_file)',
+ ],
+ }, {
+ 'cflags': [
+ '-m64',
+ ],
+ 'ldflags': [
+ '-m64',
+ '<(node_exp_file)',
+ ],
+ }],
],
'defines': [
- '_ALL_SOURCE=1',
+ '_ALL_SOURCE',
'MAP_FAILED=-1',
- '_UNIX03_SOURCE=1'
- ],
- 'ldflags': [
- '-q64',
- '<(node_exp_file)'
+ '_UNIX03_SOURCE',
],
}],
[ 'OS=="win"', {
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
index 6790ef96a..2aa39d031 100755
--- a/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
@@ -15,6 +15,7 @@ import sys
import traceback
from gyp.common import GypError
+
# Default debug modes for GYP
debug = {}
@@ -103,6 +104,18 @@ def Load(
for (key, val) in generator.generator_default_variables.items():
default_variables.setdefault(key, val)
+ 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["build_type"]),
+ )
+ else:
+ default_variables.setdefault(
+ "PRODUCT_DIR_ABS",
+ os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]),
+ )
+
# 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):
@@ -451,8 +464,19 @@ def gyp_main(args):
metavar="TARGET",
help="include only TARGET and its deep dependencies",
)
+ parser.add_argument(
+ "-V",
+ "--version",
+ dest="version",
+ action="store_true",
+ help="Show the version and exit.",
+ )
options, build_files_arg = parser.parse_args(args)
+ if options.version:
+ import pkg_resources
+ print(f"v{pkg_resources.get_distribution('gyp-next').version}")
+ return 0
build_files = build_files_arg
# Set up the configuration directory (defaults to ~/.gyp)
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/common.py b/node_modules/node-gyp/gyp/pylib/gyp/common.py
index 9213fcc5e..d77adee8a 100644
--- a/node_modules/node-gyp/gyp/pylib/gyp/common.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/common.py
@@ -454,6 +454,8 @@ def GetFlavor(params):
return "aix"
if sys.platform.startswith(("os390", "zos")):
return "zos"
+ if sys.platform == "os400":
+ return "os400"
return "linux"
@@ -463,9 +465,14 @@ def CopyTool(flavor, out_path, generator_flags={}):
to |out_path|."""
# aix and solaris just need flock emulation. mac and win use more complicated
# support scripts.
- prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get(
- flavor, None
- )
+ prefix = {
+ "aix": "flock",
+ "os400": "flock",
+ "solaris": "flock",
+ "mac": "mac",
+ "ios": "mac",
+ "win": "win",
+ }.get(flavor, None)
if not prefix:
return
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py b/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
index 1cb981526..0754aff26 100755
--- a/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py
@@ -41,7 +41,7 @@ class FlockTool:
# with EBADF, that's why we use this F_SETLK
# hack instead.
fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666)
- if sys.platform.startswith("aix"):
+ if sys.platform.startswith("aix") or sys.platform == "os400":
# Python on AIX is compiled with LARGEFILE support, which changes the
# struct size.
op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
index c595f20fe..f1d01a629 100644
--- a/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
@@ -50,7 +50,7 @@ generator_default_variables = {
}
# Make supports multiple toolsets
-generator_supports_multiple_toolsets = True
+generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()
# Request sorted dependencies in the order from dependents to dependencies.
generator_wants_sorted_dependencies = False
@@ -99,6 +99,9 @@ def CalculateVariables(default_variables, params):
default_variables.setdefault("OS", operating_system)
if flavor == "aix":
default_variables.setdefault("SHARED_LIB_SUFFIX", ".a")
+ elif flavor == "zos":
+ default_variables.setdefault("SHARED_LIB_SUFFIX", ".x")
+ COMPILABLE_EXTENSIONS.update({".pli": "pli"})
else:
default_variables.setdefault("SHARED_LIB_SUFFIX", ".so")
default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)")
@@ -154,6 +157,31 @@ cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
+# Note: this does not handle spaces in paths
+define xargs
+ $(1) $(word 1,$(2))
+$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2))))
+endef
+
+define write-to-file
+ @: >$(1)
+$(call xargs,@printf "%s\\n" >>$(1),$(2))
+endef
+
+OBJ_FILE_LIST := ar-file-list
+
+define create_archive
+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
+define create_thin_archive
+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
# We support two kinds of shared objects (.so):
# 1) shared_library, which is just bundling together many dependent libraries
# into a link line.
@@ -198,6 +226,31 @@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
+# Note: this does not handle spaces in paths
+define xargs
+ $(1) $(word 1,$(2))
+$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2))))
+endef
+
+define write-to-file
+ @: >$(1)
+$(call xargs,@printf "%s\\n" >>$(1),$(2))
+endef
+
+OBJ_FILE_LIST := ar-file-list
+
+define create_archive
+ rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+ $(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
+define create_thin_archive
+ rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
+ $(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
+ $(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
+endef
+
# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
# input list during linking.
@@ -237,6 +290,24 @@ cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSE
""" # noqa: E501
+LINK_COMMANDS_OS400 = """\
+quiet_cmd_alink = AR($(TOOLSET)) $@
+cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^)
+
+quiet_cmd_alink_thin = AR($(TOOLSET)) $@
+cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^)
+
+quiet_cmd_link = LINK($(TOOLSET)) $@
+cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
+
+quiet_cmd_solink = SOLINK($(TOOLSET)) $@
+cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
+
+quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
+cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
+""" # noqa: E501
+
+
LINK_COMMANDS_OS390 = """\
quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
@@ -248,10 +319,10 @@ quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
-cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL
+cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
-cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL
+cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
""" # noqa: E501
@@ -308,6 +379,7 @@ CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= %(LINK.target)s
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
+PLI.target ?= %(PLI.target)s
# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)
@@ -321,6 +393,7 @@ CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= %(LINK.host)s
LDFLAGS.host ?= $(LDFLAGS_host)
AR.host ?= %(AR.host)s
+PLI.host ?= %(PLI.host)s
# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
@@ -400,6 +473,9 @@ quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@")
+quiet_cmd_symlink = SYMLINK $@
+cmd_symlink = ln -sf "$<" "$@"
+
%(link_commands)s
""" # noqa: E501
r"""
@@ -555,6 +631,15 @@ def WriteRootHeaderSuffixRules(writer):
writer.write("\n")
+SHARED_HEADER_OS390_COMMANDS = """
+PLIFLAGS.target ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS)
+PLIFLAGS.host ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS)
+
+quiet_cmd_pli = PLI($(TOOLSET)) $@
+cmd_pli = $(PLI.$(TOOLSET)) $(GYP_PLIFLAGS) $(PLIFLAGS.$(TOOLSET)) -c $< && \
+ if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi
+"""
+
SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\
# Suffix rules, putting all outputs into $(obj).
"""
@@ -981,12 +1066,20 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
# libraries, but until everything is made cross-compile safe, also use
# target libraries.
# TODO(piman): when everything is cross-compile safe, remove lib.target
- self.WriteLn(
- "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:"
- "$(builddir)/lib.target:$$LD_LIBRARY_PATH; "
- "export LD_LIBRARY_PATH; "
- "%s%s" % (name, cd_action, command)
- )
+ if self.flavor == "zos" or self.flavor == "aix":
+ self.WriteLn(
+ "cmd_%s = LIBPATH=$(builddir)/lib.host:"
+ "$(builddir)/lib.target:$$LIBPATH; "
+ "export LIBPATH; "
+ "%s%s" % (name, cd_action, command)
+ )
+ else:
+ self.WriteLn(
+ "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:"
+ "$(builddir)/lib.target:$$LD_LIBRARY_PATH; "
+ "export LD_LIBRARY_PATH; "
+ "%s%s" % (name, cd_action, command)
+ )
self.WriteLn()
outputs = [self.Absolutify(o) for o in outputs]
# The makefile rules are all relative to the top dir, but the gyp actions
@@ -1480,6 +1573,8 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
target_prefix = "lib"
if self.flavor == "aix":
target_ext = ".a"
+ elif self.flavor == "zos":
+ target_ext = ".x"
else:
target_ext = ".so"
elif self.type == "none":
@@ -1560,6 +1655,14 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
# link_deps.extend(spec.get('libraries', []))
return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps))
+ def GetSharedObjectFromSidedeck(self, sidedeck):
+ """Return the shared object files based on sidedeck"""
+ return re.sub(r"\.x$", ".so", sidedeck)
+
+ def GetUnversionedSidedeckFromSidedeck(self, sidedeck):
+ """Return the shared object files based on sidedeck"""
+ return re.sub(r"\.\d+\.x$", ".x", sidedeck)
+
def WriteDependencyOnExtraOutputs(self, target, extra_outputs):
self.WriteMakeRule(
[self.output_binary],
@@ -1768,21 +1871,35 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
self.flavor not in ("mac", "openbsd", "netbsd", "win")
and not self.is_standalone_static_library
):
- self.WriteDoCmd(
- [self.output_binary],
- link_deps,
- "alink_thin",
- part_of_all,
- postbuilds=postbuilds,
- )
+ if self.flavor in ("linux", "android"):
+ self.WriteMakeRule(
+ [self.output_binary],
+ link_deps,
+ actions=["$(call create_thin_archive,$@,$^)"],
+ )
+ else:
+ self.WriteDoCmd(
+ [self.output_binary],
+ link_deps,
+ "alink_thin",
+ part_of_all,
+ postbuilds=postbuilds,
+ )
else:
- self.WriteDoCmd(
- [self.output_binary],
- link_deps,
- "alink",
- part_of_all,
- postbuilds=postbuilds,
- )
+ if self.flavor in ("linux", "android"):
+ self.WriteMakeRule(
+ [self.output_binary],
+ link_deps,
+ actions=["$(call create_archive,$@,$^)"],
+ )
+ else:
+ self.WriteDoCmd(
+ [self.output_binary],
+ link_deps,
+ "alink",
+ part_of_all,
+ postbuilds=postbuilds,
+ )
elif self.type == "shared_library":
self.WriteLn(
"%s: LD_INPUTS := %s"
@@ -1798,6 +1915,17 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
part_of_all,
postbuilds=postbuilds,
)
+ # z/OS has a .so target as well as a sidedeck .x target
+ if self.flavor == "zos":
+ self.WriteLn(
+ "%s: %s"
+ % (
+ QuoteSpaces(
+ self.GetSharedObjectFromSidedeck(self.output_binary)
+ ),
+ QuoteSpaces(self.output_binary),
+ )
+ )
elif self.type == "loadable_module":
for link_dep in link_deps:
assert " " not in link_dep, (
@@ -1855,7 +1983,9 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
else:
file_desc = "executable"
install_path = self._InstallableTargetInstallPath()
- installable_deps = [self.output]
+ installable_deps = []
+ if self.flavor != "zos":
+ installable_deps.append(self.output)
if (
self.flavor == "mac"
and "product_dir" not in spec
@@ -1880,7 +2010,30 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
comment="Copy this to the %s output path." % file_desc,
part_of_all=part_of_all,
)
- installable_deps.append(install_path)
+ if self.flavor != "zos":
+ installable_deps.append(install_path)
+ if self.flavor == "zos" and self.type == "shared_library":
+ # lib.target/libnode.so has a dependency on $(obj).target/libnode.so
+ self.WriteDoCmd(
+ [self.GetSharedObjectFromSidedeck(install_path)],
+ [self.GetSharedObjectFromSidedeck(self.output)],
+ "copy",
+ comment="Copy this to the %s output path." % file_desc,
+ part_of_all=part_of_all,
+ )
+ # Create a symlink of libnode.x to libnode.version.x
+ self.WriteDoCmd(
+ [self.GetUnversionedSidedeckFromSidedeck(install_path)],
+ [install_path],
+ "symlink",
+ comment="Symlnk this to the %s output path." % file_desc,
+ part_of_all=part_of_all,
+ )
+ # Place libnode.version.so and libnode.x symlink in lib.target dir
+ installable_deps.append(self.GetSharedObjectFromSidedeck(install_path))
+ installable_deps.append(
+ self.GetUnversionedSidedeckFromSidedeck(install_path)
+ )
if self.output != self.alias and self.alias != self.target:
self.WriteMakeRule(
[self.alias],
@@ -1888,7 +2041,18 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
comment="Short alias for building this %s." % file_desc,
phony=True,
)
- if part_of_all:
+ if self.flavor == "zos" and self.type == "shared_library":
+ # Make sure that .x symlink target is run
+ self.WriteMakeRule(
+ ["all"],
+ [
+ self.GetUnversionedSidedeckFromSidedeck(install_path),
+ self.GetSharedObjectFromSidedeck(install_path),
+ ],
+ comment='Add %s to "all" target.' % file_desc,
+ phony=True,
+ )
+ elif part_of_all:
self.WriteMakeRule(
["all"],
[install_path],
@@ -2184,6 +2348,9 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
# # Install all shared libs into a common directory (per toolset) for
# # convenient access with LD_LIBRARY_PATH.
# return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias)
+ if self.flavor == "zos" and self.type == "shared_library":
+ return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias)
+
return "$(builddir)/" + self.alias
@@ -2295,10 +2462,12 @@ def GenerateOutput(target_list, target_dicts, data, params):
"AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"),
"CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"),
"LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"),
+ "PLI.target": GetEnvironFallback(("PLI_target", "PLI"), "pli"),
"CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"),
"AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"),
"CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"),
"LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"),
+ "PLI.host": GetEnvironFallback(("PLI_host", "PLI"), "pli"),
}
if flavor == "mac":
flock_command = "./gyp-mac-tool flock"
@@ -2314,16 +2483,36 @@ def GenerateOutput(target_list, target_dicts, data, params):
header_params.update({"link_commands": LINK_COMMANDS_ANDROID})
elif flavor == "zos":
copy_archive_arguments = "-fPR"
- makedep_arguments = "-qmakedep=gcc"
+ CC_target = GetEnvironFallback(("CC_target", "CC"), "njsc")
+ makedep_arguments = "-MMD"
+ if CC_target == "clang":
+ CC_host = GetEnvironFallback(("CC_host", "CC"), "clang")
+ CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "clang++")
+ CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "clang++")
+ elif CC_target == "ibm-clang64":
+ CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang64")
+ CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++64")
+ CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++64")
+ elif CC_target == "ibm-clang":
+ CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang")
+ CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++")
+ CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++")
+ else:
+ # Node.js versions prior to v18:
+ makedep_arguments = "-qmakedep=gcc"
+ CC_host = GetEnvironFallback(("CC_host", "CC"), "njsc")
+ CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "njsc++")
+ CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "njsc++")
header_params.update(
{
"copy_archive_args": copy_archive_arguments,
"makedep_args": makedep_arguments,
"link_commands": LINK_COMMANDS_OS390,
- "CC.target": GetEnvironFallback(("CC_target", "CC"), "njsc"),
- "CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "njsc++"),
- "CC.host": GetEnvironFallback(("CC_host", "CC"), "njsc"),
- "CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "njsc++"),
+ "extra_commands": SHARED_HEADER_OS390_COMMANDS,
+ "CC.target": CC_target,
+ "CXX.target": CXX_target,
+ "CC.host": CC_host,
+ "CXX.host": CXX_host,
}
)
elif flavor == "solaris":
@@ -2351,6 +2540,16 @@ def GenerateOutput(target_list, target_dicts, data, params):
"flock_index": 2,
}
)
+ elif flavor == "os400":
+ copy_archive_arguments = "-pPRf"
+ header_params.update(
+ {
+ "copy_archive_args": copy_archive_arguments,
+ "link_commands": LINK_COMMANDS_OS400,
+ "flock": "./gyp-flock-tool flock",
+ "flock_index": 2,
+ }
+ )
build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])
make_global_settings_array = data[build_file].get("make_global_settings", [])
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
index 8308fa843..fd9500578 100644
--- a/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
@@ -423,12 +423,15 @@ def _BuildCommandLineForRuleRaw(
command.insert(0, "call")
# Fix the paths
# TODO(quote): This is a really ugly heuristic, and will miss path fixing
- # for arguments like "--arg=path" or "/opt:path".
- # If the argument starts with a slash or dash, it's probably a command line
- # switch
+ # for arguments like "--arg=path", arg=path, or "/opt:path".
+ # If the argument starts with a slash or dash, or contains an equal sign,
+ # it's probably a command line switch.
# Return the path with forward slashes because the command using it might
# not support backslashes.
- arguments = [i if (i[:1] in "/-") else _FixPath(i, "/") for i in cmd[1:]]
+ arguments = [
+ i if (i[:1] in "/-" or "=" in i) else _FixPath(i, "/")
+ for i in cmd[1:]
+ ]
arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments]
arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
if quote_cmd:
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
index d173bf229..ca04ee13a 100644
--- a/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
@@ -1583,7 +1583,7 @@ class NinjaWriter:
elif spec["type"] == "static_library":
self.target.binary = self.ComputeOutput(spec)
if (
- self.flavor not in ("mac", "openbsd", "netbsd", "win")
+ self.flavor not in ("ios", "mac", "netbsd", "openbsd", "win")
and not self.is_standalone_static_library
):
self.ninja.build(
@@ -2112,8 +2112,8 @@ def GetDefaultConcurrentLinks():
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
# VS 2015 uses 20% more working set than VS 2013 and can consume all RAM
- # on a 64 GB machine.
- mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GB
+ # on a 64 GiB machine.
+ mem_limit = max(1, stat.ullTotalPhys // (5 * (2 ** 30))) # total / 5GiB
hard_cap = max(1, int(os.environ.get("GYP_LINK_CONCURRENCY_MAX", 2 ** 32)))
return min(mem_limit, hard_cap)
elif sys.platform.startswith("linux"):
@@ -2496,7 +2496,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
),
)
- if flavor != "mac" and flavor != "win":
+ if flavor not in ("ios", "mac", "win"):
master_ninja.rule(
"alink",
description="AR $out",
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/input.py b/node_modules/node-gyp/gyp/pylib/gyp/input.py
index 354958bfb..d9699a0a5 100644
--- a/node_modules/node-gyp/gyp/pylib/gyp/input.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/input.py
@@ -961,13 +961,13 @@ def ExpandVariables(input, phase, variables, build_file):
# Fix up command with platform specific workarounds.
contents = FixupPlatformCommand(contents)
try:
- p = subprocess.Popen(
+ # stderr will be printed no matter what
+ result = subprocess.run(
contents,
- shell=use_shell,
stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- stdin=subprocess.PIPE,
+ shell=use_shell,
cwd=build_file_dir,
+ check=False
)
except Exception as e:
raise GypError(
@@ -975,19 +975,12 @@ def ExpandVariables(input, phase, variables, build_file):
% (e, contents, build_file)
)
- p_stdout, p_stderr = p.communicate("")
- p_stdout = p_stdout.decode("utf-8")
- p_stderr = p_stderr.decode("utf-8")
-
- if p.wait() != 0 or p_stderr:
- sys.stderr.write(p_stderr)
- # Simulate check_call behavior, since check_call only exists
- # in python 2.5 and later.
+ if result.returncode > 0:
raise GypError(
"Call to '%s' returned exit status %d while in %s."
- % (contents, p.returncode, build_file)
+ % (contents, result.returncode, build_file)
)
- replacement = p_stdout.rstrip()
+ replacement = result.stdout.decode("utf-8").rstrip()
cached_command_results[cache_key] = replacement
else:
diff --git a/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
index 076eea372..0e941eb47 100644
--- a/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
+++ b/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
@@ -2990,7 +2990,7 @@ class PBXProject(XCContainerPortal):
# Xcode seems to sort this list case-insensitively
self._properties["projectReferences"] = sorted(
self._properties["projectReferences"],
- key=lambda x: x["ProjectRef"].Name().lower
+ key=lambda x: x["ProjectRef"].Name().lower()
)
else:
# The link already exists. Pull out the relevnt data.
diff --git a/node_modules/node-gyp/gyp/pyproject.toml b/node_modules/node-gyp/gyp/pyproject.toml
new file mode 100644
index 000000000..d8a545152
--- /dev/null
+++ b/node_modules/node-gyp/gyp/pyproject.toml
@@ -0,0 +1,41 @@
+[build-system]
+requires = ["setuptools>=61.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "gyp-next"
+version = "0.14.0"
+authors = [
+ { name="Node.js contributors", email="ryzokuken@disroot.org" },
+]
+description = "A fork of the GYP build system for use in the Node.js projects"
+readme = "README.md"
+license = { file="LICENSE" }
+requires-python = ">=3.6"
+classifiers = [
+ "Development Status :: 3 - Alpha",
+ "Environment :: Console",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: BSD License",
+ "Natural Language :: English",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+]
+
+[project.optional-dependencies]
+dev = ["flake8", "pytest"]
+
+[project.scripts]
+gyp = "gyp:script_main"
+
+[project.urls]
+"Homepage" = "https://github.com/nodejs/gyp-next"
+
+[tool.setuptools]
+package-dir = {"" = "pylib"}
+packages = ["gyp", "gyp.generator"]
diff --git a/node_modules/node-gyp/gyp/requirements_dev.txt b/node_modules/node-gyp/gyp/requirements_dev.txt
deleted file mode 100644
index 28ecacab6..000000000
--- a/node_modules/node-gyp/gyp/requirements_dev.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-flake8
-pytest
diff --git a/node_modules/node-gyp/gyp/setup.py b/node_modules/node-gyp/gyp/setup.py
deleted file mode 100644
index cf9d7d2e5..000000000
--- a/node_modules/node-gyp/gyp/setup.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env python3
-
-# Copyright (c) 2009 Google Inc. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from os import path
-
-from setuptools import setup
-
-here = path.abspath(path.dirname(__file__))
-# Get the long description from the README file
-with open(path.join(here, "README.md")) as in_file:
- long_description = in_file.read()
-
-setup(
- name="gyp-next",
- version="0.10.0",
- description="A fork of the GYP build system for use in the Node.js projects",
- long_description=long_description,
- long_description_content_type="text/markdown",
- author="Node.js contributors",
- author_email="ryzokuken@disroot.org",
- url="https://github.com/nodejs/gyp-next",
- package_dir={"": "pylib"},
- packages=["gyp", "gyp.generator"],
- entry_points={"console_scripts": ["gyp=gyp:script_main"]},
- python_requires=">=3.6",
- classifiers=[
- "Development Status :: 3 - Alpha",
- "Environment :: Console",
- "Intended Audience :: Developers",
- "License :: OSI Approved :: BSD License",
- "Natural Language :: English",
- "Programming Language :: Python",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.6",
- "Programming Language :: Python :: 3.7",
- "Programming Language :: Python :: 3.8",
- "Programming Language :: Python :: 3.9",
- ],
-)
diff --git a/node_modules/node-gyp/gyp/test_gyp.py b/node_modules/node-gyp/gyp/test_gyp.py
index 9ba264170..b7bb956b8 100755
--- a/node_modules/node-gyp/gyp/test_gyp.py
+++ b/node_modules/node-gyp/gyp/test_gyp.py
@@ -116,6 +116,7 @@ def main(argv=None):
else:
format_list = {
"aix5": ["make"],
+ "os400": ["make"],
"freebsd7": ["make"],
"freebsd8": ["make"],
"openbsd5": ["make"],
diff --git a/node_modules/node-gyp/gyp/tools/pretty_gyp.py b/node_modules/node-gyp/gyp/tools/pretty_gyp.py
index 4ffa44455..6eef3a1bb 100755
--- a/node_modules/node-gyp/gyp/tools/pretty_gyp.py
+++ b/node_modules/node-gyp/gyp/tools/pretty_gyp.py
@@ -90,7 +90,7 @@ def count_braces(line):
"""
open_braces = ["[", "(", "{"]
close_braces = ["]", ")", "}"]
- closing_prefix_re = re.compile(r"(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$")
+ closing_prefix_re = re.compile(r"[^\s\]\}\)]\s*[\]\}\)]+,?\s*$")
cnt = 0
stripline = COMMENT_RE.sub(r"", line)
stripline = QUOTE_RE.sub(r"''", stripline)
diff --git a/node_modules/node-gyp/lib/build.js b/node_modules/node-gyp/lib/build.js
index 3baba4140..ea1f90652 100644
--- a/node_modules/node-gyp/lib/build.js
+++ b/node_modules/node-gyp/lib/build.js
@@ -11,6 +11,8 @@ function build (gyp, argv, callback) {
var platformMake = 'make'
if (process.platform === 'aix') {
platformMake = 'gmake'
+ } else if (process.platform === 'os400') {
+ platformMake = 'gmake'
} else if (process.platform.indexOf('bsd') !== -1) {
platformMake = 'gmake'
} else if (win && argv.length > 0) {
diff --git a/node_modules/node-gyp/lib/configure.js b/node_modules/node-gyp/lib/configure.js
index c7010385b..1ca3ade70 100644
--- a/node_modules/node-gyp/lib/configure.js
+++ b/node_modules/node-gyp/lib/configure.js
@@ -176,12 +176,12 @@ function configure (gyp, argv, callback) {
// For AIX and z/OS we need to set up the path to the exports file
// which contains the symbols needed for linking.
var nodeExpFile
- if (process.platform === 'aix' || process.platform === 'os390') {
- var ext = process.platform === 'aix' ? 'exp' : 'x'
+ if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') {
+ var ext = process.platform === 'os390' ? 'x' : 'exp'
var nodeRootDir = findNodeDirectory()
var candidates
- if (process.platform === 'aix') {
+ if (process.platform === 'aix' || process.platform === 'os400') {
candidates = [
'include/node/node',
'out/Release/node',
@@ -213,6 +213,44 @@ function configure (gyp, argv, callback) {
}
}
+ // For z/OS we need to set up the path to zoslib include directory,
+ // which contains headers included in v8config.h.
+ var zoslibIncDir
+ if (process.platform === 'os390') {
+ logprefix = "find zoslib's zos-base.h:"
+ let msg
+ var zoslibIncPath = process.env.ZOSLIB_INCLUDES
+ if (zoslibIncPath) {
+ zoslibIncPath = findAccessibleSync(logprefix, zoslibIncPath, ['zos-base.h'])
+ if (zoslibIncPath === undefined) {
+ msg = msgFormat('Could not find zos-base.h file in the directory set ' +
+ 'in ZOSLIB_INCLUDES environment variable: %s; set it ' +
+ 'to the correct path, or unset it to search %s', process.env.ZOSLIB_INCLUDES, nodeRootDir)
+ }
+ } else {
+ candidates = [
+ 'include/node/zoslib/zos-base.h',
+ 'include/zoslib/zos-base.h',
+ 'zoslib/include/zos-base.h',
+ 'install/include/node/zoslib/zos-base.h'
+ ]
+ zoslibIncPath = findAccessibleSync(logprefix, nodeRootDir, candidates)
+ if (zoslibIncPath === undefined) {
+ msg = msgFormat('Could not find any of %s in directory %s; set ' +
+ 'environmant variable ZOSLIB_INCLUDES to the path ' +
+ 'that contains zos-base.h', candidates.toString(), nodeRootDir)
+ }
+ }
+ if (zoslibIncPath !== undefined) {
+ zoslibIncDir = path.dirname(zoslibIncPath)
+ log.verbose(logprefix, "Found zoslib's zos-base.h in: %s", zoslibIncDir)
+ } else if (release.version.split('.')[0] >= 16) {
+ // zoslib is only shipped in Node v16 and above.
+ log.error(logprefix, msg)
+ return callback(new Error(msg))
+ }
+ }
+
// this logic ported from the old `gyp_addon` python file
var gypScript = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
var addonGypi = path.resolve(__dirname, '..', 'addon.gypi')
@@ -238,8 +276,11 @@ function configure (gyp, argv, callback) {
argv.push('-Dlibrary=shared_library')
argv.push('-Dvisibility=default')
argv.push('-Dnode_root_dir=' + nodeDir)
- if (process.platform === 'aix' || process.platform === 'os390') {
+ if (process.platform === 'aix' || process.platform === 'os390' || process.platform === 'os400') {
argv.push('-Dnode_exp_file=' + nodeExpFile)
+ if (process.platform === 'os390' && zoslibIncDir) {
+ argv.push('-Dzoslib_include_dir=' + zoslibIncDir)
+ }
}
argv.push('-Dnode_gyp_dir=' + nodeGypDir)
diff --git a/node_modules/node-gyp/lib/find-visualstudio.js b/node_modules/node-gyp/lib/find-visualstudio.js
index 8a5cfc1ea..d3815112e 100644
--- a/node_modules/node-gyp/lib/find-visualstudio.js
+++ b/node_modules/node-gyp/lib/find-visualstudio.js
@@ -347,6 +347,11 @@ VisualStudioFinder.prototype = {
// Find an installation of Visual Studio 2015 to use
findVisualStudio2015: function findVisualStudio2015 (cb) {
+ if (this.nodeSemver.major >= 19) {
+ this.addLog(
+ 'not looking for VS2015 as it is only supported up to Node.js 18')
+ return cb(null)
+ }
return this.findOldVS({
version: '14.0',
versionMajor: 14,
diff --git a/node_modules/node-gyp/node_modules/nopt/LICENSE b/node_modules/node-gyp/node_modules/nopt/LICENSE
deleted file mode 100644
index 19129e315..000000000
--- a/node_modules/node-gyp/node_modules/nopt/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-The ISC License
-
-Copyright (c) Isaac Z. Schlueter and Contributors
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
-IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/node-gyp/node_modules/nopt/bin/nopt.js b/node_modules/node-gyp/node_modules/nopt/bin/nopt.js
deleted file mode 100755
index 3232d4c57..000000000
--- a/node_modules/node-gyp/node_modules/nopt/bin/nopt.js
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env node
-var nopt = require("../lib/nopt")
- , path = require("path")
- , types = { num: Number
- , bool: Boolean
- , help: Boolean
- , list: Array
- , "num-list": [Number, Array]
- , "str-list": [String, Array]
- , "bool-list": [Boolean, Array]
- , str: String
- , clear: Boolean
- , config: Boolean
- , length: Number
- , file: path
- }
- , shorthands = { s: [ "--str", "astring" ]
- , b: [ "--bool" ]
- , nb: [ "--no-bool" ]
- , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ]
- , "?": ["--help"]
- , h: ["--help"]
- , H: ["--help"]
- , n: [ "--num", "125" ]
- , c: ["--config"]
- , l: ["--length"]
- , f: ["--file"]
- }
- , parsed = nopt( types
- , shorthands
- , process.argv
- , 2 )
-
-console.log("parsed", parsed)
-
-if (parsed.help) {
- console.log("")
- console.log("nopt cli tester")
- console.log("")
- console.log("types")
- console.log(Object.keys(types).map(function M (t) {
- var type = types[t]
- if (Array.isArray(type)) {
- return [t, type.map(function (type) { return type.name })]
- }
- return [t, type && type.name]
- }).reduce(function (s, i) {
- s[i[0]] = i[1]
- return s
- }, {}))
- console.log("")
- console.log("shorthands")
- console.log(shorthands)
-}
diff --git a/node_modules/node-gyp/node_modules/nopt/lib/nopt.js b/node_modules/node-gyp/node_modules/nopt/lib/nopt.js
deleted file mode 100644
index ecfa5da93..000000000
--- a/node_modules/node-gyp/node_modules/nopt/lib/nopt.js
+++ /dev/null
@@ -1,441 +0,0 @@
-// info about each config option.
-
-var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
- ? function () { console.error.apply(console, arguments) }
- : function () {}
-
-var url = require("url")
- , path = require("path")
- , Stream = require("stream").Stream
- , abbrev = require("abbrev")
- , os = require("os")
-
-module.exports = exports = nopt
-exports.clean = clean
-
-exports.typeDefs =
- { String : { type: String, validate: validateString }
- , Boolean : { type: Boolean, validate: validateBoolean }
- , url : { type: url, validate: validateUrl }
- , Number : { type: Number, validate: validateNumber }
- , path : { type: path, validate: validatePath }
- , Stream : { type: Stream, validate: validateStream }
- , Date : { type: Date, validate: validateDate }
- }
-
-function nopt (types, shorthands, args, slice) {
- args = args || process.argv
- types = types || {}
- shorthands = shorthands || {}
- if (typeof slice !== "number") slice = 2
-
- debug(types, shorthands, args, slice)
-
- args = args.slice(slice)
- var data = {}
- , key
- , argv = {
- remain: [],
- cooked: args,
- original: args.slice(0)
- }
-
- parse(args, data, argv.remain, types, shorthands)
- // now data is full
- clean(data, types, exports.typeDefs)
- data.argv = argv
- Object.defineProperty(data.argv, 'toString', { value: function () {
- return this.original.map(JSON.stringify).join(" ")
- }, enumerable: false })
- return data
-}
-
-function clean (data, types, typeDefs) {
- typeDefs = typeDefs || exports.typeDefs
- var remove = {}
- , typeDefault = [false, true, null, String, Array]
-
- Object.keys(data).forEach(function (k) {
- if (k === "argv") return
- var val = data[k]
- , isArray = Array.isArray(val)
- , type = types[k]
- if (!isArray) val = [val]
- if (!type) type = typeDefault
- if (type === Array) type = typeDefault.concat(Array)
- if (!Array.isArray(type)) type = [type]
-
- debug("val=%j", val)
- debug("types=", type)
- val = val.map(function (val) {
- // if it's an unknown value, then parse false/true/null/numbers/dates
- if (typeof val === "string") {
- debug("string %j", val)
- val = val.trim()
- if ((val === "null" && ~type.indexOf(null))
- || (val === "true" &&
- (~type.indexOf(true) || ~type.indexOf(Boolean)))
- || (val === "false" &&
- (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
- val = JSON.parse(val)
- debug("jsonable %j", val)
- } else if (~type.indexOf(Number) && !isNaN(val)) {
- debug("convert to number", val)
- val = +val
- } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
- debug("convert to date", val)
- val = new Date(val)
- }
- }
-
- if (!types.hasOwnProperty(k)) {
- return val
- }
-
- // allow `--no-blah` to set 'blah' to null if null is allowed
- if (val === false && ~type.indexOf(null) &&
- !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
- val = null
- }
-
- var d = {}
- d[k] = val
- debug("prevalidated val", d, val, types[k])
- if (!validate(d, k, val, types[k], typeDefs)) {
- if (exports.invalidHandler) {
- exports.invalidHandler(k, val, types[k], data)
- } else if (exports.invalidHandler !== false) {
- debug("invalid: "+k+"="+val, types[k])
- }
- return remove
- }
- debug("validated val", d, val, types[k])
- return d[k]
- }).filter(function (val) { return val !== remove })
-
- // if we allow Array specifically, then an empty array is how we
- // express 'no value here', not null. Allow it.
- if (!val.length && type.indexOf(Array) === -1) {
- debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array))
- delete data[k]
- }
- else if (isArray) {
- debug(isArray, data[k], val)
- data[k] = val
- } else data[k] = val[0]
-
- debug("k=%s val=%j", k, val, data[k])
- })
-}
-
-function validateString (data, k, val) {
- data[k] = String(val)
-}
-
-function validatePath (data, k, val) {
- if (val === true) return false
- if (val === null) return true
-
- val = String(val)
-
- var isWin = process.platform === 'win32'
- , homePattern = isWin ? /^~(\/|\\)/ : /^~\//
- , home = os.homedir()
-
- if (home && val.match(homePattern)) {
- data[k] = path.resolve(home, val.substr(2))
- } else {
- data[k] = path.resolve(val)
- }
- return true
-}
-
-function validateNumber (data, k, val) {
- debug("validate Number %j %j %j", k, val, isNaN(val))
- if (isNaN(val)) return false
- data[k] = +val
-}
-
-function validateDate (data, k, val) {
- var s = Date.parse(val)
- debug("validate Date %j %j %j", k, val, s)
- if (isNaN(s)) return false
- data[k] = new Date(val)
-}
-
-function validateBoolean (data, k, val) {
- if (val instanceof Boolean) val = val.valueOf()
- else if (typeof val === "string") {
- if (!isNaN(val)) val = !!(+val)
- else if (val === "null" || val === "false") val = false
- else val = true
- } else val = !!val
- data[k] = val
-}
-
-function validateUrl (data, k, val) {
- val = url.parse(String(val))
- if (!val.host) return false
- data[k] = val.href
-}
-
-function validateStream (data, k, val) {
- if (!(val instanceof Stream)) return false
- data[k] = val
-}
-
-function validate (data, k, val, type, typeDefs) {
- // arrays are lists of types.
- if (Array.isArray(type)) {
- for (var i = 0, l = type.length; i < l; i ++) {
- if (type[i] === Array) continue
- if (validate(data, k, val, type[i], typeDefs)) return true
- }
- delete data[k]
- return false
- }
-
- // an array of anything?
- if (type === Array) return true
-
- // NaN is poisonous. Means that something is not allowed.
- if (type !== type) {
- debug("Poison NaN", k, val, type)
- delete data[k]
- return false
- }
-
- // explicit list of values
- if (val === type) {
- debug("Explicitly allowed %j", val)
- // if (isArray) (data[k] = data[k] || []).push(val)
- // else data[k] = val
- data[k] = val
- return true
- }
-
- // now go through the list of typeDefs, validate against each one.
- var ok = false
- , types = Object.keys(typeDefs)
- for (var i = 0, l = types.length; i < l; i ++) {
- debug("test type %j %j %j", k, val, types[i])
- var t = typeDefs[types[i]]
- if (t &&
- ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) {
- var d = {}
- ok = false !== t.validate(d, k, val)
- val = d[k]
- if (ok) {
- // if (isArray) (data[k] = data[k] || []).push(val)
- // else data[k] = val
- data[k] = val
- break
- }
- }
- }
- debug("OK? %j (%j %j %j)", ok, k, val, types[i])
-
- if (!ok) delete data[k]
- return ok
-}
-
-function parse (args, data, remain, types, shorthands) {
- debug("parse", args, data, remain)
-
- var key = null
- , abbrevs = abbrev(Object.keys(types))
- , shortAbbr = abbrev(Object.keys(shorthands))
-
- for (var i = 0; i < args.length; i ++) {
- var arg = args[i]
- debug("arg", arg)
-
- if (arg.match(/^-{2,}$/)) {
- // done with keys.
- // the rest are args.
- remain.push.apply(remain, args.slice(i + 1))
- args[i] = "--"
- break
- }
- var hadEq = false
- if (arg.charAt(0) === "-" && arg.length > 1) {
- var at = arg.indexOf('=')
- if (at > -1) {
- hadEq = true
- var v = arg.substr(at + 1)
- arg = arg.substr(0, at)
- args.splice(i, 1, arg, v)
- }
-
- // see if it's a shorthand
- // if so, splice and back up to re-parse it.
- var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
- debug("arg=%j shRes=%j", arg, shRes)
- if (shRes) {
- debug(arg, shRes)
- args.splice.apply(args, [i, 1].concat(shRes))
- if (arg !== shRes[0]) {
- i --
- continue
- }
- }
- arg = arg.replace(/^-+/, "")
- var no = null
- while (arg.toLowerCase().indexOf("no-") === 0) {
- no = !no
- arg = arg.substr(3)
- }
-
- if (abbrevs[arg]) arg = abbrevs[arg]
-
- var argType = types[arg]
- var isTypeArray = Array.isArray(argType)
- if (isTypeArray && argType.length === 1) {
- isTypeArray = false
- argType = argType[0]
- }
-
- var isArray = argType === Array ||
- isTypeArray && argType.indexOf(Array) !== -1
-
- // allow unknown things to be arrays if specified multiple times.
- if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
- if (!Array.isArray(data[arg]))
- data[arg] = [data[arg]]
- isArray = true
- }
-
- var val
- , la = args[i + 1]
-
- var isBool = typeof no === 'boolean' ||
- argType === Boolean ||
- isTypeArray && argType.indexOf(Boolean) !== -1 ||
- (typeof argType === 'undefined' && !hadEq) ||
- (la === "false" &&
- (argType === null ||
- isTypeArray && ~argType.indexOf(null)))
-
- if (isBool) {
- // just set and move along
- val = !no
- // however, also support --bool true or --bool false
- if (la === "true" || la === "false") {
- val = JSON.parse(la)
- la = null
- if (no) val = !val
- i ++
- }
-
- // also support "foo":[Boolean, "bar"] and "--foo bar"
- if (isTypeArray && la) {
- if (~argType.indexOf(la)) {
- // an explicit type
- val = la
- i ++
- } else if ( la === "null" && ~argType.indexOf(null) ) {
- // null allowed
- val = null
- i ++
- } else if ( !la.match(/^-{2,}[^-]/) &&
- !isNaN(la) &&
- ~argType.indexOf(Number) ) {
- // number
- val = +la
- i ++
- } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) {
- // string
- val = la
- i ++
- }
- }
-
- if (isArray) (data[arg] = data[arg] || []).push(val)
- else data[arg] = val
-
- continue
- }
-
- if (argType === String) {
- if (la === undefined) {
- la = ""
- } else if (la.match(/^-{1,2}[^-]+/)) {
- la = ""
- i --
- }
- }
-
- if (la && la.match(/^-{2,}$/)) {
- la = undefined
- i --
- }
-
- val = la === undefined ? true : la
- if (isArray) (data[arg] = data[arg] || []).push(val)
- else data[arg] = val
-
- i ++
- continue
- }
- remain.push(arg)
- }
-}
-
-function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
- // handle single-char shorthands glommed together, like
- // npm ls -glp, but only if there is one dash, and only if
- // all of the chars are single-char shorthands, and it's
- // not a match to some other abbrev.
- arg = arg.replace(/^-+/, '')
-
- // if it's an exact known option, then don't go any further
- if (abbrevs[arg] === arg)
- return null
-
- // if it's an exact known shortopt, same deal
- if (shorthands[arg]) {
- // make it an array, if it's a list of words
- if (shorthands[arg] && !Array.isArray(shorthands[arg]))
- shorthands[arg] = shorthands[arg].split(/\s+/)
-
- return shorthands[arg]
- }
-
- // first check to see if this arg is a set of single-char shorthands
- var singles = shorthands.___singles
- if (!singles) {
- singles = Object.keys(shorthands).filter(function (s) {
- return s.length === 1
- }).reduce(function (l,r) {
- l[r] = true
- return l
- }, {})
- shorthands.___singles = singles
- debug('shorthand singles', singles)
- }
-
- var chrs = arg.split("").filter(function (c) {
- return singles[c]
- })
-
- if (chrs.join("") === arg) return chrs.map(function (c) {
- return shorthands[c]
- }).reduce(function (l, r) {
- return l.concat(r)
- }, [])
-
-
- // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
- if (abbrevs[arg] && !shorthands[arg])
- return null
-
- // if it's an abbr for a shorthand, then use that
- if (shortAbbr[arg])
- arg = shortAbbr[arg]
-
- // make it an array, if it's a list of words
- if (shorthands[arg] && !Array.isArray(shorthands[arg]))
- shorthands[arg] = shorthands[arg].split(/\s+/)
-
- return shorthands[arg]
-}
diff --git a/node_modules/node-gyp/node_modules/nopt/package.json b/node_modules/node-gyp/node_modules/nopt/package.json
deleted file mode 100644
index 12ed02da5..000000000
--- a/node_modules/node-gyp/node_modules/nopt/package.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "name": "nopt",
- "version": "5.0.0",
- "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
- "main": "lib/nopt.js",
- "scripts": {
- "preversion": "npm test",
- "postversion": "npm publish",
- "prepublishOnly": "git push origin --follow-tags",
- "test": "tap test/*.js"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/npm/nopt.git"
- },
- "bin": {
- "nopt": "bin/nopt.js"
- },
- "license": "ISC",
- "dependencies": {
- "abbrev": "1"
- },
- "devDependencies": {
- "tap": "^14.10.6"
- },
- "files": [
- "bin",
- "lib"
- ],
- "engines": {
- "node": ">=6"
- }
-}
diff --git a/node_modules/node-gyp/package.json b/node_modules/node-gyp/package.json
index ecf4d8ae8..932e8cb3b 100644
--- a/node_modules/node-gyp/package.json
+++ b/node_modules/node-gyp/package.json
@@ -11,7 +11,7 @@
"bindings",
"gyp"
],
- "version": "9.1.0",
+ "version": "9.3.0",
"installVersion": 9,
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
"repository": {
@@ -26,7 +26,7 @@
"glob": "^7.1.4",
"graceful-fs": "^4.2.6",
"make-fetch-happen": "^10.0.3",
- "nopt": "^5.0.0",
+ "nopt": "^6.0.0",
"npmlog": "^6.0.0",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
diff --git a/node_modules/node-gyp/test/test-find-node-directory.js b/node_modules/node-gyp/test/test-find-node-directory.js
index f1380d162..fa6223c65 100644
--- a/node_modules/node-gyp/test/test-find-node-directory.js
+++ b/node_modules/node-gyp/test/test-find-node-directory.js
@@ -4,7 +4,7 @@ const test = require('tap').test
const path = require('path')
const findNodeDirectory = require('../lib/find-node-directory')
-const platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix']
+const platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix', 'os400']
// we should find the directory based on the directory
// the script is running in and it should match the layout
diff --git a/node_modules/node-gyp/update-gyp.py b/node_modules/node-gyp/update-gyp.py
index bb84f071a..19524bd6a 100755
--- a/node_modules/node-gyp/update-gyp.py
+++ b/node_modules/node-gyp/update-gyp.py
@@ -33,7 +33,25 @@ with tempfile.TemporaryDirectory() as tmp_dir:
print("Unzipping...")
with tarfile.open(tar_file, "r:gz") as tar_ref:
- tar_ref.extractall(unzip_target)
+ def is_within_directory(directory, target):
+
+ abs_directory = os.path.abspath(directory)
+ abs_target = os.path.abspath(target)
+
+ prefix = os.path.commonprefix([abs_directory, abs_target])
+
+ return prefix == abs_directory
+
+ def safe_extract(tar, path=".", members=None, *, numeric_owner=False):
+
+ for member in tar.getmembers():
+ member_path = os.path.join(path, member.name)
+ if not is_within_directory(path, member_path):
+ raise Exception("Attempted Path Traversal in Tar File")
+
+ tar.extractall(path, members, numeric_owner)
+
+ safe_extract(tar_ref, unzip_target)
print("Moving to current checkout (" + CHECKOUT_PATH + ")...")
if os.path.exists(CHECKOUT_GYP_PATH):
diff --git a/package-lock.json b/package-lock.json
index 5a7377cfc..1ee8562af 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -125,7 +125,7 @@
"minipass-pipeline": "^1.2.4",
"mkdirp": "^1.0.4",
"ms": "^2.1.2",
- "node-gyp": "^9.1.0",
+ "node-gyp": "^9.3.0",
"nopt": "^6.0.0",
"npm-audit-report": "^4.0.0",
"npm-install-checks": "^6.0.0",
@@ -8208,15 +8208,16 @@
}
},
"node_modules/node-gyp": {
- "version": "9.1.0",
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.3.0.tgz",
+ "integrity": "sha512-A6rJWfXFz7TQNjpldJ915WFb1LnhO4lIve3ANPbWreuEoLoKlFT3sxIepPBkLhM27crW8YmN+pjlgbasH6cH/Q==",
"inBundle": true,
- "license": "MIT",
"dependencies": {
"env-paths": "^2.2.0",
"glob": "^7.1.4",
"graceful-fs": "^4.2.6",
"make-fetch-happen": "^10.0.3",
- "nopt": "^5.0.0",
+ "nopt": "^6.0.0",
"npmlog": "^6.0.0",
"rimraf": "^3.0.2",
"semver": "^7.3.5",
@@ -8440,20 +8441,6 @@
"encoding": "^0.1.13"
}
},
- "node_modules/node-gyp/node_modules/nopt": {
- "version": "5.0.0",
- "inBundle": true,
- "license": "ISC",
- "dependencies": {
- "abbrev": "1"
- },
- "bin": {
- "nopt": "bin/nopt.js"
- },
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/node-gyp/node_modules/npmlog": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz",
diff --git a/package.json b/package.json
index 30a5e2481..509aba504 100644
--- a/package.json
+++ b/package.json
@@ -95,7 +95,7 @@
"minipass-pipeline": "^1.2.4",
"mkdirp": "^1.0.4",
"ms": "^2.1.2",
- "node-gyp": "^9.1.0",
+ "node-gyp": "^9.3.0",
"nopt": "^6.0.0",
"npm-audit-report": "^4.0.0",
"npm-install-checks": "^6.0.0",