Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix IBM i build with Python 3.9 #48056

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/openssl/openssl-cl_asm.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/asm/openssl-cl.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/asm/openssl-cl.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl-cl_asm_avx2.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/asm_avx2/openssl-cl.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/asm_avx2/openssl-cl.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl-cl_no_asm.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/no-asm/openssl-cl.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/no-asm/openssl-cl.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl-fips_asm.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/asm/openssl-fips.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/asm/openssl-fips.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl-fips_asm_avx2.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/asm_avx2/openssl-fips.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/asm_avx2/openssl-fips.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl-fips_no_asm.gypi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
'defines': ['OPENSSL_NO_ASM'],
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/no-asm/openssl-fips.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/no-asm/openssl-fips.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl_asm.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/asm/openssl.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/asm/openssl.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl_asm_avx2.gypi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/asm_avx2/openssl.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/asm_avx2/openssl.gypi'],
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl_common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
# build options specific to OS
'conditions': [
[ 'OS=="aix"', {
[ 'OS in ("aix", "os400")', {
# AIX is missing /usr/include/endian.h
'defines': [
'__LITTLE_ENDIAN=1234',
Expand Down
2 changes: 1 addition & 1 deletion deps/openssl/openssl_no_asm.gypi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
'defines': ['OPENSSL_NO_ASM'],
'conditions': [
['target_arch=="ppc64" and OS=="aix"', {
['target_arch=="ppc64" and OS in ("aix", "os400")', {
'includes': ['config/archs/aix64-gcc-as/no-asm/openssl.gypi'],
}, 'target_arch=="ppc64" and OS=="linux" and node_byteorder =="little"', {
'includes': ['config/archs/linux-ppc64le/no-asm/openssl.gypi'],
Expand Down
1 change: 1 addition & 0 deletions test/abort/test-addon-uv-handle-leak.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ if (process.argv[2] === 'child') {

if (!(common.isFreeBSD ||
common.isAIX ||
common.isIBMi ||
(common.isLinux && !isGlibc()) ||
common.isWindows)) {
assert(stderr.includes('ExampleOwnerClass'), stderr);
Expand Down
9 changes: 6 additions & 3 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ if (process.argv.length === 2 &&
}

const isWindows = process.platform === 'win32';
const isAIX = process.platform === 'aix';
const isSunOS = process.platform === 'sunos';
const isFreeBSD = process.platform === 'freebsd';
const isOpenBSD = process.platform === 'openbsd';
Expand Down Expand Up @@ -274,7 +273,7 @@ function platformTimeout(ms) {
if (process.features.debug)
ms = multipliers.two * ms;

if (isAIX)
if (exports.isAIX || exports.isIBMi)
return multipliers.two * ms; // Default localhost speed is slower on AIX

if (isPi)
Expand Down Expand Up @@ -925,7 +924,6 @@ const common = {
hasQuic,
hasMultiLocalhost,
invalidArgTypeHelper,
isAIX,
isAlive,
isAsan,
isDumbTerminal,
Expand Down Expand Up @@ -996,7 +994,12 @@ const common = {
},

// On IBMi, process.platform and os.platform() both return 'aix',
// when built with Python versions earlier than 3.9.
// It is not enough to differentiate between IBMi and real AIX system.
get isAIX() {
return require('os').type() === 'AIX';
},

get isIBMi() {
return require('os').type() === 'OS400';
},
Expand Down
2 changes: 1 addition & 1 deletion test/known_issues/test-cwd-enoent-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
const common = require('../common');
const assert = require('assert');

if (common.isSunOS || common.isWindows || common.isAIX) {
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi) {
// The current working directory cannot be removed on these platforms.
// Change this to common.skip() when this is no longer a known issue test.
assert.fail('cannot rmdir current working directory');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cwd-enoent-preload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../common');
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAIX)
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi)
common.skip('cannot rmdir current working directory');
if (!common.isMainThread)
common.skip('process.chdir is not available in Workers');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cwd-enoent-repl.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../common');
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAIX)
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi)
common.skip('cannot rmdir current working directory');
if (!common.isMainThread)
common.skip('process.chdir is not available in Workers');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cwd-enoent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const common = require('../common');
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAIX)
if (common.isSunOS || common.isWindows || common.isAIX || common.isIBMi)
common.skip('cannot rmdir current working directory');
if (!common.isMainThread)
common.skip('process.chdir is not available in Workers');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfile-pipe-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const common = require('../common');

// Simulate `cat readfile.js | node readfile.js`

if (common.isWindows || common.isAIX)
if (common.isWindows || common.isAIX || common.isIBMi)
common.skip(`No /dev/stdin on ${process.platform}.`);

const assert = require('assert');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfile-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const common = require('../common');

// Simulate `cat readfile.js | node readfile.js`

if (common.isWindows || common.isAIX)
if (common.isWindows || common.isAIX || common.isIBMi)
common.skip(`No /dev/stdin on ${process.platform}.`);

const assert = require('assert');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfilesync-pipe-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const common = require('../common');

// Simulate `cat readfile.js | node readfile.js`

if (common.isWindows || common.isAIX)
if (common.isWindows || common.isAIX || common.isIBMi)
common.skip(`No /dev/stdin on ${process.platform}.`);

const assert = require('assert');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-realpath-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const common = require('../common');

if (common.isWindows || common.isAIX)
if (common.isWindows || common.isAIX || common.isIBMi)
common.skip(`No /dev/stdin on ${process.platform}.`);

const assert = require('assert');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-utimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function stat_resource(resource, statSync = fs.statSync) {
const stats = fs.fstatSync(resource);
// Ensure mtime has been written to disk
// except for directories on AIX where it cannot be synced
if (common.isAIX && stats.isDirectory())
if ((common.isAIX || common.isIBMi) && stats.isDirectory())
return stats;
fs.fsyncSync(resource);
return fs.fstatSync(resource);
Expand Down
13 changes: 8 additions & 5 deletions test/parallel/test-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ const hostname = os.hostname();
is.string(hostname);
assert.ok(hostname.length > 0);

const DUMMY_PRIORITY = 10;
os.setPriority(DUMMY_PRIORITY);
const priority = os.getPriority();
is.number(priority);
assert.strictEqual(priority, DUMMY_PRIORITY);
// IBMi process priority is different.
if (!common.isIBMi) {
const DUMMY_PRIORITY = 10;
os.setPriority(DUMMY_PRIORITY);
const priority = os.getPriority();
is.number(priority);
assert.strictEqual(priority, DUMMY_PRIORITY);
}

// On IBMi, os.uptime() returns 'undefined'
if (!common.isIBMi) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-process-dlopen-error-message-crash.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ assert.throws(() => {
}, ({ name, code, message }) => {
assert.strictEqual(name, 'Error');
assert.strictEqual(code, 'ERR_DLOPEN_FAILED');
if (!common.isAIX) {
if (!common.isAIX && !common.isIBMi) {
assert.match(message, /foo-%s\.node/);
}
return true;
Expand Down