Skip to content

Commit

Permalink
Update to Node 22.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Jan 7, 2025
1 parent 2648a7f commit 8a7655b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 102 deletions.
8 changes: 5 additions & 3 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ if (process.platform == 'darwin') {
// Copy fields from config.gypi of node.
const configGypiPath = fs.readFileSync(path.join(__dirname, 'node', 'config.gypi')).toString()
const configGypi = JSON.parse(configGypiPath.split('\n').slice(1).join('\n').replace(/'/g, '"'))
for (const key of ['clang', 'node_builtin_shareable_builtins']) {
config.variables[key] = configGypi.variables[key]
for (const key in configGypi.variables) {
if (!(key in config.variables))
config.variables[key] = configGypi.variables[key]
}
// Read node_library_files from config.gypi.
// Map node_library_files from config.gypi.
config.variables.node_library_files = configGypi.variables.node_library_files.map(l => 'node/' + l)
// Write our own config.gypi file.
fs.writeFileSync(`${__dirname}/config.gypi`, JSON.stringify(config, null, ' '))

await $`${python} node/tools/gyp/gyp_main.py yode.gyp --no-parallel -f ninja -Dbuild_type=${buildType} -Iconfig.gypi -Icommon.gypi --depth .`
Expand Down
78 changes: 0 additions & 78 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,8 @@
'node/common.gypi',
],
'variables': {
# Reflects node's config.gypi.
'library%': 'static_library',
'component': 'static_library',
'coverage': 'false',
'llvm_version': '3.3',
'debug_nghttp2': 'false',
'debug_node': 'false',
'enable_lto': 'false',
'enable_pgo_generate': 'false',
'enable_pgo_use': 'false',
'force_dynamic_crt': 0,
'openssl_fips': '',
'openssl_is_fips': 'false',
'openssl_no_asm': 1,
'openssl_quic': 'true',
'OPENSSL_PRODUCT': 'libopenssl.a',
'node_release_urlbase': '',
'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',
'node_shared_brotli': 'false',
'node_shared_cares': 'false',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_nghttp2': 'false',
'node_shared_nghttp3': 'false',
'node_shared_ngtcp2': 'false',
'node_shared_openssl': 'false',
'node_shared_v8': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_mdb': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'node_use_v8_platform': 'true',
'node_use_bundled_v8': 'false',
'node_enable_d8': 'false',
'node_use_large_pages': 'false',
'node_debug_lib': 'false',
'node_with_ltcg': 'false',
'node_report': 'false',
'node_use_node_code_cache': 'false',
'node_write_snapshot_as_array_literals': 'false',
'uv_library': 'static_library',
'uv_parent_path': 'node/deps/uv',
'uv_use_dtrace': 'false',
'V8_BASE': '',
'v8_enable_31bit_smis_on_64bit_arch': 0,
'v8_enable_gdbjit': 0,
'v8_enable_hugepage': 0,
'v8_enable_i18n_support': 1,
'v8_enable_inspector': 1,
'v8_enable_javascript_promise_hooks': 1,
'v8_enable_lite_mode': 0,
'v8_enable_object_print': 1,
'v8_enable_pointer_compression': 0,
'v8_enable_shared_ro_heap': 1,
'v8_enable_short_builtin_calls': 1,
'v8_enable_webassembly': 1,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_promise_internal_field_count': 1,
'v8_random_seed': 0,
'v8_trace_maps': 0,
'v8_use_siphash': 1,
'icu_data_file': 'icudt75l.dat',
'icu_data_in': '../../deps/icu-tmp/icudt75l.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': '75',
},
'target_defaults': {
'includes': [
Expand Down
2 changes: 1 addition & 1 deletion node
Submodule node updated 13093 files
31 changes: 12 additions & 19 deletions src/asar_monkey_patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,32 +464,25 @@ exports.wrapFsWithAsar = function(fs) {
return files
}

const {internalModuleReadJSON} = process.binding('fs')
process.binding('fs').internalModuleReadJSON = function(p) {
const modulesBinding = internalBinding('modules')
const {readPackageJSON} = modulesBinding
modulesBinding.readPackageJSON = function(p, isESM, base, specifier) {
const [isAsar, filePath] = splitPath(p)
if (!isAsar)
return internalModuleReadJSON(p)
return readPackageJSON(p, isESM, base, specifier)
const info = process.asarArchive.getFileInfo(filePath)
if (!info)
return []
if (info.size === 0)
return []
if (info.unpacked) {
const realPath = process.asarArchive.copyFileOut(info)
return [fs.readFileSync(realPath, {encoding: 'utf8'}), true]
}
const buffer = process.asarArchive.readFile(info)
if (!buffer)
return []
const str = buffer.toString('utf8')
return [str, str.length > 0]
if (!info || info.size === 0)
return undefined
const realPath = process.asarArchive.copyFileOut(info)
return readPackageJSON(realPath, isESM, base, specifier)
}

const {internalModuleStat} = process.binding('fs')
process.binding('fs').internalModuleStat = function(p) {
const internalFsBinding = internalBinding('fs')
const {internalModuleStat} = internalFsBinding
internalFsBinding.internalModuleStat = function(b, p) {
const [isAsar, filePath] = splitPath(p)
if (!isAsar)
return internalModuleStat(p)
return internalModuleStat(b, p)
const stats = process.asarArchive.stat(filePath)
if (!stats)
return -34 // -ENOENT
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function wrapWithActivateUvLoop(func) {
if (this.loaded || this.loading)
return this.exports
const filename = this.id + '.js'
const {function: compiledWrapper} = compileFunctionForCJSLoader(this.source, filename)
const {function: compiledWrapper} = compileFunctionForCJSLoader(this.source, filename, false, false)
compiledWrapper.call(this.exports, this.exports, require, this, filename, dirname);
return this.exports
}
Expand Down
1 change: 1 addition & 0 deletions yode.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'.',
'node/deps/cares/include', # for ares.h
'node/deps/openssl/openssl/include', # for openssl/opensslv.h
'node/deps/simdjson', # for simdjson.h
'node/deps/uv/include', # for uv.h
'node/src', # for node things
],
Expand Down

0 comments on commit 8a7655b

Please sign in to comment.