| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ec5a359 commit b99bb57
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ jobs: | |||
| 15 | 15 | steps: | |
| 16 | 16 | - uses: actions/checkout@v2 | |
| 17 | 17 | - name: Set up Python ${{ matrix.python-version }} | |
| 18 | - uses: actions/setup-python@v2 | ||
| 18 | + uses: actions/setup-python@v3 | ||
| 19 | 19 | with: | |
| 20 | 20 | python-version: ${{ matrix.python-version }} | |
| 21 | 21 | - name: Install dependencies | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,10 +21,10 @@ jobs: | |||
| 21 | 21 | with: | |
| 22 | 22 | repository: nodejs/node-gyp | |
| 23 | 23 | path: node-gyp | |
| 24 | - - uses: actions/setup-node@v2 | ||
| 24 | + - uses: actions/setup-node@v3 | ||
| 25 | 25 | with: | |
| 26 | 26 | node-version: 14.x | |
| 27 | - - uses: actions/setup-python@v2 | ||
| 27 | + - uses: actions/setup-python@v3 | ||
| 28 | 28 | with: | |
| 29 | 29 | python-version: ${{ matrix.python }} | |
| 30 | 30 | - name: Install dependencies | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,26 @@ | |||
| 1 | 1 | # Changelog | |
| 2 | 2 | ||
| 3 | + ### [0.12.1](https://www.github.com/nodejs/gyp-next/compare/v0.12.0...v0.12.1) (2022-04-06) | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + ### Bug Fixes | ||
| 7 | + | ||
| 8 | + * **msvs:** avoid fixing path for arguments with "=" ([#143](https://www.github.com/nodejs/gyp-next/issues/143)) ([7e8f16e](https://www.github.com/nodejs/gyp-next/commit/7e8f16eb165e042e64bec98fa6c2a0232a42c26b)) | ||
| 9 | + | ||
| 10 | + ## [0.12.0](https://www.github.com/nodejs/gyp-next/compare/v0.11.0...v0.12.0) (2022-04-04) | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + ### Features | ||
| 14 | + | ||
| 15 | + * support building shared libraries on z/OS ([#137](https://www.github.com/nodejs/gyp-next/issues/137)) ([293bcfa](https://www.github.com/nodejs/gyp-next/commit/293bcfa4c25c6adb743377adafc45a80fee492c6)) | ||
| 16 | + | ||
| 17 | + ## [0.11.0](https://www.github.com/nodejs/gyp-next/compare/v0.10.1...v0.11.0) (2022-03-04) | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + ### Features | ||
| 21 | + | ||
| 22 | + * Add proper support for IBM i ([#140](https://www.github.com/nodejs/gyp-next/issues/140)) ([fdda4a3](https://www.github.com/nodejs/gyp-next/commit/fdda4a3038b8a7042ad960ce7a223687c24a21b1)) | ||
| 23 | + | ||
| 3 | 24 | ### [0.10.1](https://www.github.com/nodejs/gyp-next/compare/v0.10.0...v0.10.1) (2021-11-24) | |
| 4 | 25 | ||
| 5 | 26 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -454,6 +454,8 @@ def GetFlavor(params): | |||
| 454 | 454 | return "aix" | |
| 455 | 455 | if sys.platform.startswith(("os390", "zos")): | |
| 456 | 456 | return "zos" | |
| 457 | + if sys.platform == "os400": | ||
| 458 | + return "os400" | ||
| 457 | 459 | ||
| 458 | 460 | return "linux" | |
| 459 | 461 | ||
@@ -463,9 +465,13 @@ def CopyTool(flavor, out_path, generator_flags={}): | |||
| 463 | 465 | to |out_path|.""" | |
| 464 | 466 | # aix and solaris just need flock emulation. mac and win use more complicated | |
| 465 | 467 | # support scripts. | |
| 466 | - prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get( | ||
| 467 | - flavor, None | ||
| 468 | - ) | ||
| 468 | + prefix = { | ||
| 469 | + "aix": "flock", | ||
| 470 | + "os400": "flock", | ||
| 471 | + "solaris": "flock", | ||
| 472 | + "mac": "mac", | ||
| 473 | + "win": "win", | ||
| 474 | + }.get(flavor, None) | ||
| 469 | 475 | if not prefix: | |
| 470 | 476 | return | |
| 471 | 477 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,7 @@ def ExecFlock(self, lockfile, *cmd_list): | |||
| 41 | 41 | # with EBADF, that's why we use this F_SETLK | |
| 42 | 42 | # hack instead. | |
| 43 | 43 | fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) | |
| 44 | - if sys.platform.startswith("aix"): | ||
| 44 | + if sys.platform.startswith("aix") or sys.platform == "os400": | ||
| 45 | 45 | # Python on AIX is compiled with LARGEFILE support, which changes the | |
| 46 | 46 | # struct size. | |
| 47 | 47 | op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,6 +99,8 @@ def CalculateVariables(default_variables, params): | |||
| 99 | 99 | default_variables.setdefault("OS", operating_system) | |
| 100 | 100 | if flavor == "aix": | |
| 101 | 101 | default_variables.setdefault("SHARED_LIB_SUFFIX", ".a") | |
| 102 | + elif flavor == "zos": | ||
| 103 | + default_variables.setdefault("SHARED_LIB_SUFFIX", ".x") | ||
| 102 | 104 | else: | |
| 103 | 105 | default_variables.setdefault("SHARED_LIB_SUFFIX", ".so") | |
| 104 | 106 | default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") | |
@@ -286,6 +288,24 @@ def CalculateGeneratorInputInfo(params): | |||
| 286 | 288 | """ # noqa: E501 | |
| 287 | 289 | ||
| 288 | 290 | ||
| 291 | + LINK_COMMANDS_OS400 = """\ | ||
| 292 | + quiet_cmd_alink = AR($(TOOLSET)) $@ | ||
| 293 | + cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) | ||
| 294 | + | ||
| 295 | + quiet_cmd_alink_thin = AR($(TOOLSET)) $@ | ||
| 296 | + cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) | ||
| 297 | + | ||
| 298 | + quiet_cmd_link = LINK($(TOOLSET)) $@ | ||
| 299 | + cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) | ||
| 300 | + | ||
| 301 | + quiet_cmd_solink = SOLINK($(TOOLSET)) $@ | ||
| 302 | + cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) | ||
| 303 | + | ||
| 304 | + quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ | ||
| 305 | + cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) | ||
| 306 | + """ # noqa: E501 | ||
| 307 | + | ||
| 308 | + | ||
| 289 | 309 | LINK_COMMANDS_OS390 = """\ | |
| 290 | 310 | quiet_cmd_alink = AR($(TOOLSET)) $@ | |
| 291 | 311 | cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) | |
@@ -297,10 +317,10 @@ def CalculateGeneratorInputInfo(params): | |||
| 297 | 317 | cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) | |
| 298 | 318 | ||
| 299 | 319 | quiet_cmd_solink = SOLINK($(TOOLSET)) $@ | |
| 300 | - cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) -Wl,DLL | ||
| 320 | + cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,DLL -o $(patsubst %.x,%.so,$@) $(LD_INPUTS) $(LIBS) && if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi | ||
| 301 | 321 | ||
| 302 | 322 | quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ | |
| 303 | - cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) -Wl,DLL | ||
| 323 | + cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) | ||
| 304 | 324 | """ # noqa: E501 | |
| 305 | 325 | ||
| 306 | 326 | ||
@@ -449,6 +469,9 @@ def CalculateGeneratorInputInfo(params): | |||
| 449 | 469 | # send stderr to /dev/null to ignore messages when linking directories. | |
| 450 | 470 | cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") | |
| 451 | 471 | ||
| 472 | + quiet_cmd_symlink = SYMLINK $@ | ||
| 473 | + cmd_symlink = ln -sf "$<" "$@" | ||
| 474 | + | ||
| 452 | 475 | %(link_commands)s | |
| 453 | 476 | """ # noqa: E501 | |
| 454 | 477 | r""" | |
@@ -1030,12 +1053,20 @@ def WriteActions( | |||
| 1030 | 1053 | # libraries, but until everything is made cross-compile safe, also use | |
| 1031 | 1054 | # target libraries. | |
| 1032 | 1055 | # TODO(piman): when everything is cross-compile safe, remove lib.target | |
| 1033 | - self.WriteLn( | ||
| 1034 | - "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" | ||
| 1035 | - "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " | ||
| 1036 | - "export LD_LIBRARY_PATH; " | ||
| 1037 | - "%s%s" % (name, cd_action, command) | ||
| 1038 | - ) | ||
| 1056 | + if self.flavor == "zos" or self.flavor == "aix": | ||
| 1057 | + self.WriteLn( | ||
| 1058 | + "cmd_%s = LIBPATH=$(builddir)/lib.host:" | ||
| 1059 | + "$(builddir)/lib.target:$$LIBPATH; " | ||
| 1060 | + "export LIBPATH; " | ||
| 1061 | + "%s%s" % (name, cd_action, command) | ||
| 1062 | + ) | ||
| 1063 | + else: | ||
| 1064 | + self.WriteLn( | ||
| 1065 | + "cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:" | ||
| 1066 | + "$(builddir)/lib.target:$$LD_LIBRARY_PATH; " | ||
| 1067 | + "export LD_LIBRARY_PATH; " | ||
| 1068 | + "%s%s" % (name, cd_action, command) | ||
| 1069 | + ) | ||
| 1039 | 1070 | self.WriteLn() | |
| 1040 | 1071 | outputs = [self.Absolutify(o) for o in outputs] | |
| 1041 | 1072 | # The makefile rules are all relative to the top dir, but the gyp actions | |
@@ -1529,6 +1560,8 @@ def ComputeOutputBasename(self, spec): | |||
| 1529 | 1560 | target_prefix = "lib" | |
| 1530 | 1561 | if self.flavor == "aix": | |
| 1531 | 1562 | target_ext = ".a" | |
| 1563 | + elif self.flavor == "zos": | ||
| 1564 | + target_ext = ".x" | ||
| 1532 | 1565 | else: | |
| 1533 | 1566 | target_ext = ".so" | |
| 1534 | 1567 | elif self.type == "none": | |
@@ -1609,6 +1642,14 @@ def ComputeDeps(self, spec): | |||
| 1609 | 1642 | # link_deps.extend(spec.get('libraries', [])) | |
| 1610 | 1643 | return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) | |
| 1611 | 1644 | ||
| 1645 | + def GetSharedObjectFromSidedeck(self, sidedeck): | ||
| 1646 | + """Return the shared object files based on sidedeck""" | ||
| 1647 | + return re.sub(r"\.x$", ".so", sidedeck) | ||
| 1648 | + | ||
| 1649 | + def GetUnversionedSidedeckFromSidedeck(self, sidedeck): | ||
| 1650 | + """Return the shared object files based on sidedeck""" | ||
| 1651 | + return re.sub(r"\.\d+\.x$", ".x", sidedeck) | ||
| 1652 | + | ||
| 1612 | 1653 | def WriteDependencyOnExtraOutputs(self, target, extra_outputs): | |
| 1613 | 1654 | self.WriteMakeRule( | |
| 1614 | 1655 | [self.output_binary], | |
@@ -1861,6 +1902,11 @@ def WriteTarget( | |||
| 1861 | 1902 | part_of_all, | |
| 1862 | 1903 | postbuilds=postbuilds, | |
| 1863 | 1904 | ) | |
| 1905 | + # z/OS has a .so target as well as a sidedeck .x target | ||
| 1906 | + if self.flavor == "zos": | ||
| 1907 | + self.WriteLn('%s: %s' % ( | ||
| 1908 | + QuoteSpaces(self.GetSharedObjectFromSidedeck(self.output_binary)), | ||
| 1909 | + QuoteSpaces(self.output_binary))) | ||
| 1864 | 1910 | elif self.type == "loadable_module": | |
| 1865 | 1911 | for link_dep in link_deps: | |
| 1866 | 1912 | assert " " not in link_dep, ( | |
@@ -1918,7 +1964,9 @@ def WriteTarget( | |||
| 1918 | 1964 | else: | |
| 1919 | 1965 | file_desc = "executable" | |
| 1920 | 1966 | install_path = self._InstallableTargetInstallPath() | |
| 1921 | - installable_deps = [self.output] | ||
| 1967 | + installable_deps = [] | ||
| 1968 | + if self.flavor != "zos": | ||
| 1969 | + installable_deps.append(self.output) | ||
| 1922 | 1970 | if ( | |
| 1923 | 1971 | self.flavor == "mac" | |
| 1924 | 1972 | and "product_dir" not in spec | |
@@ -1943,15 +1991,42 @@ def WriteTarget( | |||
| 1943 | 1991 | comment="Copy this to the %s output path." % file_desc, | |
| 1944 | 1992 | part_of_all=part_of_all, | |
| 1945 | 1993 | ) | |
| 1946 | - installable_deps.append(install_path) | ||
| 1994 | + if self.flavor != "zos": | ||
| 1995 | + installable_deps.append(install_path) | ||
| 1996 | + if self.flavor == 'zos' and self.type == 'shared_library': | ||
| 1997 | + # lib.target/libnode.so has a dependency on $(obj).target/libnode.so | ||
| 1998 | + self.WriteDoCmd([self.GetSharedObjectFromSidedeck(install_path)], | ||
| 1999 | + [self.GetSharedObjectFromSidedeck(self.output)], 'copy', | ||
| 2000 | + comment='Copy this to the %s output path.' % | ||
| 2001 | + file_desc, part_of_all=part_of_all) | ||
| 2002 | + # Create a symlink of libnode.x to libnode.version.x | ||
| 2003 | + self.WriteDoCmd([self.GetUnversionedSidedeckFromSidedeck(install_path)], | ||
| 2004 | + [install_path], 'symlink', | ||
| 2005 | + comment='Symlnk this to the %s output path.' % | ||
| 2006 | + file_desc, part_of_all=part_of_all) | ||
| 2007 | + # Place libnode.version.so and libnode.x symlink in lib.target dir | ||
| 2008 | + installable_deps.append(self.GetSharedObjectFromSidedeck(install_path)) | ||
| 2009 | + installable_deps.append( | ||
| 2010 | + self.GetUnversionedSidedeckFromSidedeck(install_path)) | ||
| 1947 | 2011 | if self.output != self.alias and self.alias != self.target: | |
| 1948 | 2012 | self.WriteMakeRule( | |
| 1949 | 2013 | [self.alias], | |
| 1950 | 2014 | installable_deps, | |
| 1951 | 2015 | comment="Short alias for building this %s." % file_desc, | |
| 1952 | 2016 | phony=True, | |
| 1953 | 2017 | ) | |
| 1954 | - if part_of_all: | ||
| 2018 | + if self.flavor == 'zos' and self.type == 'shared_library': | ||
| 2019 | + # Make sure that .x symlink target is run | ||
| 2020 | + self.WriteMakeRule( | ||
| 2021 | + ['all'], | ||
| 2022 | + [ | ||
| 2023 | + self.GetUnversionedSidedeckFromSidedeck(install_path), | ||
| 2024 | + self.GetSharedObjectFromSidedeck(install_path) | ||
| 2025 | + ], | ||
| 2026 | + comment='Add %s to "all" target.' % file_desc, | ||
| 2027 | + phony=True, | ||
| 2028 | + ) | ||
| 2029 | + elif part_of_all: | ||
| 1955 | 2030 | self.WriteMakeRule( | |
| 1956 | 2031 | ["all"], | |
| 1957 | 2032 | [install_path], | |
@@ -2247,6 +2322,9 @@ def _InstallableTargetInstallPath(self): | |||
| 2247 | 2322 | # # Install all shared libs into a common directory (per toolset) for | |
| 2248 | 2323 | # # convenient access with LD_LIBRARY_PATH. | |
| 2249 | 2324 | # return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) | |
| 2325 | + if self.flavor == "zos" and self.type == "shared_library": | ||
| 2326 | + return "$(builddir)/lib.%s/%s" % (self.toolset, self.alias) | ||
| 2327 | + | ||
| 2250 | 2328 | return "$(builddir)/" + self.alias | |
| 2251 | 2329 | ||
| 2252 | 2330 | ||
@@ -2414,6 +2492,16 @@ def CalculateMakefilePath(build_file, base_name): | |||
| 2414 | 2492 | "flock_index": 2, | |
| 2415 | 2493 | } | |
| 2416 | 2494 | ) | |
| 2495 | + elif flavor == "os400": | ||
| 2496 | + copy_archive_arguments = "-pPRf" | ||
| 2497 | + header_params.update( | ||
| 2498 | + { | ||
| 2499 | + "copy_archive_args": copy_archive_arguments, | ||
| 2500 | + "link_commands": LINK_COMMANDS_OS400, | ||
| 2501 | + "flock": "./gyp-flock-tool flock", | ||
| 2502 | + "flock_index": 2, | ||
| 2503 | + } | ||
| 2504 | + ) | ||
| 2417 | 2505 | ||
| 2418 | 2506 | build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) | |
| 2419 | 2507 | make_global_settings_array = data[build_file].get("make_global_settings", []) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -423,12 +423,15 @@ def _BuildCommandLineForRuleRaw( | |||
| 423 | 423 | command.insert(0, "call") | |
| 424 | 424 | # Fix the paths | |
| 425 | 425 | # TODO(quote): This is a really ugly heuristic, and will miss path fixing | |
| 426 | - # for arguments like "--arg=path" or "/opt:path". | ||
| 427 | - # If the argument starts with a slash or dash, it's probably a command line | ||
| 428 | - # switch | ||
| 426 | + # for arguments like "--arg=path", arg=path, or "/opt:path". | ||
| 427 | + # If the argument starts with a slash or dash, or contains an equal sign, | ||
| 428 | + # it's probably a command line switch. | ||
| 429 | 429 | # Return the path with forward slashes because the command using it might | |
| 430 | 430 | # not support backslashes. | |
| 431 | - arguments = [i if (i[:1] in "/-") else _FixPath(i, "/") for i in cmd[1:]] | ||
| 431 | + arguments = [ | ||
| 432 | + i if (i[:1] in "/-" or "=" in i) else _FixPath(i, "/") | ||
| 433 | + for i in cmd[1:] | ||
| 434 | + ] | ||
| 432 | 435 | arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments] | |
| 433 | 436 | arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] | |
| 434 | 437 | if quote_cmd: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | setup( | |
| 17 | 17 | name="gyp-next", | |
| 18 | - version="0.10.1", | ||
| 18 | + version="0.12.1", | ||
| 19 | 19 | description="A fork of the GYP build system for use in the Node.js projects", | |
| 20 | 20 | long_description=long_description, | |
| 21 | 21 | long_description_content_type="text/markdown", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -116,6 +116,7 @@ def main(argv=None): | |||
| 116 | 116 | else: | |
| 117 | 117 | format_list = { | |
| 118 | 118 | "aix5": ["make"], | |
| 119 | + "os400": ["make"], | ||
| 119 | 120 | "freebsd7": ["make"], | |
| 120 | 121 | "freebsd8": ["make"], | |
| 121 | 122 | "openbsd5": ["make"], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -90,7 +90,7 @@ def count_braces(line): | |||
| 90 | 90 | """ | |
| 91 | 91 | open_braces = ["[", "(", "{"] | |
| 92 | 92 | close_braces = ["]", ")", "}"] | |
| 93 | - closing_prefix_re = re.compile(r"(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$") | ||
| 93 | + closing_prefix_re = re.compile(r"[^\s\]\}\)]\s*[\]\}\)]+,?\s*$") | ||
| 94 | 94 | cnt = 0 | |
| 95 | 95 | stripline = COMMENT_RE.sub(r"", line) | |
| 96 | 96 | stripline = QUOTE_RE.sub(r"''", stripline) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments