Uh oh!
There was an error while loading. Please reload this page.
zos: support platform - #1276
Conversation
jasnell
commented
Aug 24, 2017
@nodejs/build ... thoughts on this? |
richardlau
commented
Aug 25, 2017
Are the gyp changes being upstreamed? |
jBarz
commented
Aug 25, 2017
Yes. I am in the process of doing that. |
refack
commented
Aug 25, 2017
I don't think that upstream GYP has a zos try-bot, but at least we could get some regression testing. |
| if sys.platform.startswith('aix'): | ||
| return 'aix' | ||
| if sys.platform.startswith('os390'): | ||
| return 'os390' |
There was a problem hiding this comment.
if the platform is named zos why use os390?
There was a problem hiding this comment.
Pretty sure that's what uname -m prints on z/OS machines.
There was a problem hiding this comment.
Ack. So that's the input (L432), I'm wondering is we should keep it as the internal alias?
We could do something similar to:
node-gyp/gyp/pylib/gyp/common.py
Lines 422 to 423 in 2ed26fb
if that's more congruent with the IBM's future plans.
There was a problem hiding this comment.
A lot of z/OS projects built using gyp already expect 'os390'. So that would require a major change across multiple z/OS projects.
There was a problem hiding this comment.
I meant the other way around, i.e.:
ifsys.platform.startswith('os390'): return'zos'since the return os390 (a.k.a. flavor) is only used as an internal alias to map to
node-gyp/gyp/pylib/gyp/generator/make.py
Line 2060 in 2ed26fb
But in anycase, you IBM people know best. I'm just asking...
There was a problem hiding this comment.
@jBarz we could just alias it inside the node build scripts I guess.
However I think os390 is the standard "technical" name for the ARCH, like x86_64 is for Intel, so it's probably be less surprising to stick with that.
refack
commented
Aug 28, 2017
gibfahn
commented
Aug 28, 2017
@jBarz you mentioned that other z/OS projects are using GYP, are there plans to upstream the gyp related changes? |
refack
left a comment
There was a problem hiding this comment.
Need to fix some python syntax
| 'copy', | ||
| description='COPY $in $out', | ||
| command='rm -rf $out && cp -af $in $out') | ||
| if sys.platform in ('os390'): |
There was a problem hiding this comment.
This is a python syntax error:
gypinfospawnargs'-Goutput_dir=.' ]
Traceback (mostrecentcalllast):
File"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\gyp_main.py", line16, in<module>sys.exit(gyp.script_main())
File"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\pylib\gyp\__init__.py", line545, inscript_mainreturnmain(sys.argv[1:])
File"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\pylib\gyp\__init__.py", line538, inmainreturngyp_main(args)
File"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\pylib\gyp\__init__.py", line514, ingyp_mainoptions.duplicate_basename_check)
File"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\pylib\gyp\__init__.py", line91, inLoadgenerator=__import__(generator_name, globals(), locals(), generator_name)
File"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\pylib\gyp\generator\msvs.py", line15, in<module>importgyp.generator.ninjaasninja_generatorFile"c:\workspace\nodegyp-test-commit\nodes\win2012r2\gyp\pylib\gyp\generator\ninja.py", line2253ifsys.platformin ('os390'):
^SyntaxError: invalidsyntaxYou could do the if before hand near L2167, or use the python ternary
| return callback(new Error(msg)) | ||
| } | ||
| } | ||
| else if (process.platform === 'os390') { |
There was a problem hiding this comment.
usually else if should be on the same line as the previous }
| fs.accessSync(node_exp_file, fs.R_OK) | ||
| // exp file found, stop looking | ||
| break | ||
| } catch (exception) { |
There was a problem hiding this comment.
Should rename exception to _ to indicate it's intentionally ignored
| reload(sys) | ||
| def main(): | ||
| if sys.platform.startswith('os390'): |
There was a problem hiding this comment.
Could you replace this with
ifnotencoding:
returnFalseafter L10
jBarz
commented
Aug 29, 2017
Fixed issues. |
jBarz
commented
Aug 29, 2017
Yes, these changes will go upstream. |
Thanks for following up. |
refack
commented
Aug 29, 2017
jBarz
commented
Aug 29, 2017
No urgency :-). We can wait |
| for (var next = 0; next < candidates.length; next++) { | ||
| node_exp_file = path.resolve(node_root_dir, candidates[next]) | ||
| try { | ||
| fs.accessSync(node_exp_file, fs.R_OK) |
There was a problem hiding this comment.
fs.accessSync() does not exist in v0.10 and v0.12 (see also #955) but since this is a z/OS-only code path, I guess that's alright. That said, can't this be merged with the AIX code path above?
There was a problem hiding this comment.
Yes it can be merged with AIX code. Will do
jBarz
commented
Aug 29, 2017
Merged the AIX and z/OS code paths to find the export file |
gyp changes have been pushed upstream. |
refack
commented
Aug 31, 2017
Wow Dirk was quick :) |
saper
commented
Sep 2, 2017
@jBarz Is there any way a mere mortal can try this? For example using Hercules? (I only have ancient MVS running there). |
| var candidates = ['include/node/node', | ||
| 'out/Release/node', | ||
| 'out/Debug/node', | ||
| 'node'].map((file) => { |
There was a problem hiding this comment.
You can't use arrow functions just yet, they don't parse in old node.js versions.
| log.verbose(logprefix, 'Found exports file: %s', node_exp_file) | ||
| } else { | ||
| var msg = msgFormat('Could not find node.exp file in %s', node_root_dir) | ||
| var msg = msgFormat(`Could not find node.${ext} file in %s`, node_root_dir) |
| 'out/Release/node', | ||
| 'out/Debug/node', | ||
| 'node'].map(function(file) { | ||
| return `${file}.${ext}` |
There was a problem hiding this comment.
Why no backticks? node-gyp@4 is node>=4.
Lines 38 to 40 in 7245415
There was a problem hiding this comment.
Well, that was a surreptitious change. I wouldn't have hidden that in an otherwise unrelated commit. (I'm talking about 5f924ce.)
At any rate, this way we can do another 3.x release and include this change.
There was a problem hiding this comment.
Sure, no harm in keeping compatibility.
| 'out/Release/node', | ||
| 'out/Debug/node', | ||
| 'node'].map(function(file) { | ||
| return '' + file + '.' + ext |
There was a problem hiding this comment.
First (empty) concatenation isn't necessary but LGTM apart from that.
* recognize a zos system * use correct cp arguments for zos * add zos compile options * add zos makedep arguments * use export file in link step on zos
refack
commented
Sep 7, 2017
@refack Do you know approx when this could be landed and released? |
I think this is good to go, given that the GYP changes have been upstreamed. CI: https://ci.nodejs.org/view/Node.js/job/nodegyp-test-pull-request/40/ EDIT: CI is green. |
Checklist
npm install && npm testpassesDescription of change