Skip to content

Commit

Permalink
Update to Node v17.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Dec 14, 2021
1 parent 9587596 commit 0db6caa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
17 changes: 10 additions & 7 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ let target_arch = host_arch
if (process.argv.length > 2)
target_arch = process.argv[2]

// Release or Debug.
const build_type = 'Release'

// Current version.
const version = commandResult('git describe --always --tags')

Expand Down Expand Up @@ -69,20 +72,20 @@ if (process.platform === 'darwin') {
config.variables.node_library_files = readNodeLibraryFiles()
fs.writeFileSync(path.join(__dirname, 'config.gypi'), JSON.stringify(config, null, ' '))

execSync(`${python} node/tools/gyp/gyp_main.py yode.gyp --no-parallel -f ninja -Iconfig.gypi -Icommon.gypi --depth .`)
execSync(`${python} node/tools/gyp/gyp_main.py yode.gyp --no-parallel -f ninja -Dbuild_type=${build_type} -Iconfig.gypi -Icommon.gypi --depth .`)

// Build.
const epath = `${path.join('deps', 'ninja')}${path.delimiter}${process.env.PATH}`
execSync(`ninja -j ${os.cpus().length} -C out/Release yode`, {env: {PATH: epath}})
execSync(`ninja -j ${os.cpus().length} -C out/${build_type} yode`, {env: {PATH: epath}})

if (process.platform === 'linux')
execSync('strip out/Release/yode')
execSync(`strip out/${build_type}/yode`)

// Remove old zip.
const files = fs.readdirSync('out/Release')
const files = fs.readdirSync(`out/${build_type}`)
for (let f of files) {
if (f.endsWith('.zip'))
fs.unlinkSync(`out/Release/${f}`)
fs.unlinkSync(`out/${build_type}/${f}`)
}

// Create zip.
Expand All @@ -91,8 +94,8 @@ const zip = new yazl.ZipFile()
const distname = `yode-${version}-${process.platform}-${target_arch}.zip`
const filename = process.platform == 'win32' ? 'yode.exe' : 'yode'
zip.addFile('node/LICENSE', 'LICENSE')
zip.addFile(`out/Release/${filename}`, filename)
zip.outputStream.pipe(fs.createWriteStream(`out/Release/${distname}`))
zip.addFile(`out/${build_type}/${filename}`, filename)
zip.outputStream.pipe(fs.createWriteStream(`out/${build_type}/${distname}`))
zip.end()

function readNodeLibraryFiles() {
Expand Down
7 changes: 4 additions & 3 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'node_byteorder': '<!(node -e "console.log(require(\'os\').endianness() === \'BE\' ? \'big\' : \'little\')")',
'node_target_type': 'static_library',
'node_lib_target_name': 'libnode',
'node_fipsinstall': 'false',
'node_install_npm': 'false',
'node_prefix': '',
'node_shared': 'false',
Expand Down Expand Up @@ -69,15 +70,15 @@
'v8_trace_maps': 0,
'v8_use_siphash': 1,
'v8_use_snapshot': 1,
'icu_data_file': 'icudt69l.dat',
'icu_data_in': '../../deps/icu-tmp/icudt69l.dat',
'icu_data_file': 'icudt70l.dat',
'icu_data_in': '../../deps/icu-tmp/icudt70l.dat',
'icu_default_data': '',
'icu_endianness': 'l',
'icu_gyp_path': 'node/tools/icu/icu-generic.gyp',
'icu_locales': 'en,root',
'icu_path': '../../deps/icu-small',
'icu_small': 'true',
'icu_ver_major': '69',
'icu_ver_major': '70',
},
'target_defaults': {
'includes': [
Expand Down
2 changes: 1 addition & 1 deletion node
Submodule node updated 13104 files
1 change: 1 addition & 0 deletions yode.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'include_dirs': [
'.',
'node/deps/cares/include', # for ares.h
'node/deps/openssl/openssl/include', # for openssl/opensslv.h
'node/deps/uv/include', # for uv.h
'node/src', # for node things
],
Expand Down

0 comments on commit 0db6caa

Please sign in to comment.