diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index eb10935828722f..84193a6b32181c 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -21,12 +21,10 @@ jobs: subsystem: tools label: tools run: | - NEW_VERSION=$(npm view eslint dist-tags.latest) - CURRENT_VERSION=$(node -p "require('./tools/node_modules/eslint/package.json').version") - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/dep_updaters/update-eslint.sh - fi + ./tools/dep_updaters/update-eslint.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: corepack subsystem: deps label: dependencies @@ -81,12 +79,10 @@ jobs: subsystem: deps,test label: test run: | - NEW_VERSION=$(npm view postject dist-tags.latest) - CURRENT_VERSION=$(node -p "require('./test/fixtures/postject-copy/node_modules/postject/package.json').version") - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/dep_updaters/update-postject.sh - fi + ./tools/dep_updaters/update-postject.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: base64 subsystem: deps label: dependencies @@ -122,28 +118,18 @@ jobs: subsystem: deps label: dependencies run: | - NEW_VERSION=$(gh api repos/libuv/libuv/releases/latest -q '.tag_name|ltrimstr("v")') - VERSION_H="./deps/uv/include/uv/version.h" - CURRENT_MAJOR_VERSION=$(grep "#define UV_VERSION_MAJOR" $VERSION_H | sed -n "s/^.*MAJOR \(.*\)/\1/p") - CURRENT_MINOR_VERSION=$(grep "#define UV_VERSION_MINOR" $VERSION_H | sed -n "s/^.*MINOR \(.*\)/\1/p") - CURRENT_PATCH_VERSION=$(grep "#define UV_VERSION_PATCH" $VERSION_H | sed -n "s/^.*PATCH \(.*\)/\1/p") - CURRENT_SUFFIX_VERSION=$(grep "#define UV_VERSION_SUFFIX" $VERSION_H | sed -n "s/^.*SUFFIX \"\(.*\)\"/\1/p") - SUFFIX_STRING=$([[ -z "$CURRENT_SUFFIX_VERSION" ]] && echo "" || echo "-$CURRENT_SUFFIX_VERSION") - CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION$SUFFIX_STRING" - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/dep_updaters/update-libuv.sh "$NEW_VERSION" - fi + ./tools/dep_updaters/update-libuv.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: simdutf subsystem: deps label: dependencies run: | - NEW_VERSION=$(gh api repos/simdutf/simdutf/releases/latest -q '.tag_name|ltrimstr("v")') - CURRENT_VERSION=$(grep "#define SIMDUTF_VERSION" ./deps/simdutf/simdutf.h | sed -n "s/^.*VERSION \(.*\)/\1/p") - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - ./tools/dep_updaters/update-simdutf.sh "$NEW_VERSION" - fi + ./tools/dep_updaters/update-simdutf.sh > temp-output + cat temp-output + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true + rm temp-output - id: ada subsystem: deps label: dependencies diff --git a/.gitignore b/.gitignore index 9881176886826b..b3399fa0df2655 100644 --- a/.gitignore +++ b/.gitignore @@ -65,12 +65,12 @@ _UpgradeReport_Files/ /tools/msvs/genfiles/ /npm.wxs /corepack.wxs -/tools/msvs/msi/Release/ -/tools/msvs/msi/obj/ -/tools/msvs/msi/x64/ +/tools/msvs/msi/**/Release/ +/tools/msvs/msi/**/obj/ +/tools/msvs/msi/**/x64/ # Exclude MSVS files used for .msi file generation -!tools/msvs/msi/custom_actions.vcxproj -!tools/msvs/msi/nodemsi.sln +!tools/msvs/msi/**/custom_actions.vcxproj +!tools/msvs/msi/**/nodemsi.sln # === Rules for GYP artifacts === *-nodegyp* diff --git a/BUILDING.md b/BUILDING.md index 3e519343a3cbf9..82a01ac0aeeef1 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -586,10 +586,7 @@ to run it again before invoking `make -j4`. Optional requirements to build the MSI installer package: -* The [WiX Toolset v3.11](https://wixtoolset.org/releases/) and the - [Wix Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2019Extension) -* The [WiX Toolset v3.14](https://wixtoolset.org/releases/) if - building for Windows 10 on ARM (ARM64) +* The .NET SDK component from [Visual Studio 2019](https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products) Optional requirements for compiling for Windows 10 on ARM (ARM64): diff --git a/deps/simdutf/simdutf.cpp b/deps/simdutf/simdutf.cpp index f7916d6814f08a..d3100c1561d350 100644 --- a/deps/simdutf/simdutf.cpp +++ b/deps/simdutf/simdutf.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2023-02-23 11:36:05 -0500. Do not edit! */ +/* auto-generated on 2023-02-24 17:01:43 -0500. Do not edit! */ // dofile: invoked with prepath=/Users/dlemire/CVS/github/simdutf/src, filename=simdutf.cpp /* begin file src/simdutf.cpp */ #include "simdutf.h" diff --git a/deps/simdutf/simdutf.h b/deps/simdutf/simdutf.h index 30600aaca49390..80189d316cba8c 100644 --- a/deps/simdutf/simdutf.h +++ b/deps/simdutf/simdutf.h @@ -1,4 +1,4 @@ -/* auto-generated on 2023-02-23 11:36:05 -0500. Do not edit! */ +/* auto-generated on 2023-02-24 17:01:43 -0500. Do not edit! */ // dofile: invoked with prepath=/Users/dlemire/CVS/github/simdutf/include, filename=simdutf.h /* begin file include/simdutf.h */ #ifndef SIMDUTF_H @@ -572,7 +572,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS #define SIMDUTF_SIMDUTF_VERSION_H /** The version of simdutf being used (major.minor.revision) */ -#define SIMDUTF_VERSION "3.2.1" +#define SIMDUTF_VERSION "3.2.2" namespace simdutf { enum { @@ -587,7 +587,7 @@ enum { /** * The revision (major.minor.REVISION) of simdutf being used. */ - SIMDUTF_VERSION_REVISION = 1 + SIMDUTF_VERSION_REVISION = 2 }; } // namespace simdutf diff --git a/lib/internal/main/embedding.js b/lib/internal/main/embedding.js new file mode 100644 index 00000000000000..aa3f06cca10f99 --- /dev/null +++ b/lib/internal/main/embedding.js @@ -0,0 +1,18 @@ +'use strict'; +const { + prepareMainThreadExecution, + markBootstrapComplete, +} = require('internal/process/pre_execution'); +const { isSea } = internalBinding('sea'); +const { emitExperimentalWarning } = require('internal/util'); +const { embedderRequire, embedderRunCjs } = require('internal/util/embedding'); +const { getEmbedderEntryFunction } = internalBinding('mksnapshot'); + +prepareMainThreadExecution(false, true); +markBootstrapComplete(); + +if (isSea()) { + emitExperimentalWarning('Single executable application'); +} + +return getEmbedderEntryFunction()(embedderRequire, embedderRunCjs); diff --git a/lib/internal/main/environment.js b/lib/internal/main/environment.js deleted file mode 100644 index 0be982bfb6d25d..00000000000000 --- a/lib/internal/main/environment.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -// This runs necessary preparations to prepare a complete Node.js context -// that depends on run time states. -// It is currently only intended for preparing contexts for embedders. - -const { - prepareMainThreadExecution, - markBootstrapComplete -} = require('internal/process/pre_execution'); - -prepareMainThreadExecution(); -markBootstrapComplete(); diff --git a/lib/internal/main/mksnapshot.js b/lib/internal/main/mksnapshot.js index 928b3fd13f91d4..08d483dcff4e76 100644 --- a/lib/internal/main/mksnapshot.js +++ b/lib/internal/main/mksnapshot.js @@ -119,16 +119,25 @@ function main() { const { prepareMainThreadExecution } = require('internal/process/pre_execution'); + const path = require('path'); let serializeMainFunction = getEmbedderEntryFunction(); const serializeMainArgs = [requireForUserSnapshot]; if (serializeMainFunction) { // embedded case prepareMainThreadExecution(false, false); + // TODO(addaleax): Make this `embedderRunCjs` once require('module') + // is supported in snapshots. + const filename = process.execPath; + const dirname = path.dirname(filename); + function minimalRunCjs(source) { + const fn = compileSerializeMain(filename, source); + return fn(requireForUserSnapshot, filename, dirname); + } + serializeMainArgs.push(minimalRunCjs); } else { prepareMainThreadExecution(true, false); const file = process.argv[1]; - const path = require('path'); const filename = path.resolve(file); const dirname = path.dirname(filename); const source = readFileSync(file, 'utf-8'); diff --git a/lib/internal/main/single_executable_application.js b/lib/internal/main/single_executable_application.js deleted file mode 100644 index d9604cff720d2f..00000000000000 --- a/lib/internal/main/single_executable_application.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; -const { - prepareMainThreadExecution, - markBootstrapComplete, -} = require('internal/process/pre_execution'); -const { getSingleExecutableCode } = internalBinding('sea'); -const { emitExperimentalWarning } = require('internal/util'); -const { Module, wrapSafe } = require('internal/modules/cjs/loader'); -const { codes: { ERR_UNKNOWN_BUILTIN_MODULE } } = require('internal/errors'); - -prepareMainThreadExecution(false, true); -markBootstrapComplete(); - -emitExperimentalWarning('Single executable application'); - -// This is roughly the same as: -// -// const mod = new Module(filename); -// mod._compile(contents, filename); -// -// but the code has been duplicated because currently there is no way to set the -// value of require.main to module. -// -// TODO(RaisinTen): Find a way to deduplicate this. - -const filename = process.execPath; -const contents = getSingleExecutableCode(); -const compiledWrapper = wrapSafe(filename, contents); - -const customModule = new Module(filename, null); -customModule.filename = filename; -customModule.paths = Module._nodeModulePaths(customModule.path); - -const customExports = customModule.exports; - -function customRequire(path) { - if (!Module.isBuiltin(path)) { - throw new ERR_UNKNOWN_BUILTIN_MODULE(path); - } - - return require(path); -} - -customRequire.main = customModule; - -const customFilename = customModule.filename; - -const customDirname = customModule.path; - -compiledWrapper( - customExports, - customRequire, - customModule, - customFilename, - customDirname); diff --git a/lib/internal/test_runner/reporter/tap.js b/lib/internal/test_runner/reporter/tap.js index c2de32000f8c7e..a5402b4a6084ac 100644 --- a/lib/internal/test_runner/reporter/tap.js +++ b/lib/internal/test_runner/reporter/tap.js @@ -195,8 +195,10 @@ function jsToYaml(indent, name, value) { actual, operator, stack, + name, } = value; let errMsg = message ?? ''; + let errName = name; let errStack = stack; let errCode = code; let errExpected = expected; @@ -209,6 +211,7 @@ function jsToYaml(indent, name, value) { if (code === 'ERR_TEST_FAILURE' && kUnwrapErrors.has(failureType)) { errStack = cause?.stack ?? errStack; errCode = cause?.code ?? errCode; + errName = cause?.name ?? errName; if (isAssertionLike(cause)) { errExpected = cause.expected; errActual = cause.actual; @@ -225,6 +228,9 @@ function jsToYaml(indent, name, value) { if (errCode) { result += jsToYaml(indent, 'code', errCode); } + if (errName && errName !== 'Error') { + result += jsToYaml(indent, 'name', errName); + } if (errIsAssertion) { result += jsToYaml(indent, 'expected', errExpected); diff --git a/lib/internal/test_runner/yaml_to_js.js b/lib/internal/test_runner/yaml_to_js.js index 3aa28f9bc2cbfb..6eb193f4afd36e 100644 --- a/lib/internal/test_runner/yaml_to_js.js +++ b/lib/internal/test_runner/yaml_to_js.js @@ -42,9 +42,13 @@ function reConstructError(parsedYaml) { } else { // eslint-disable-next-line no-restricted-syntax cause = new Error(parsedYaml.error); + } + const name = parsedYaml.name ?? 'Error'; + cause.stack = `${name}: ${parsedYaml.error}\n${stack}`; + + if (!isAssertionError && !isTestFailure) { cause.code = parsedYaml.code; } - cause.stack = stack; if (isTestFailure) { error = new ERR_TEST_FAILURE(cause, parsedYaml.failureType); diff --git a/lib/internal/url.js b/lib/internal/url.js index 3d36f320f11f1e..193965b76d346d 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -7,7 +7,6 @@ const { ArrayPrototypePush, ArrayPrototypeReduce, ArrayPrototypeSlice, - FunctionPrototypeBind, Int8Array, IteratorPrototype, Number, @@ -544,7 +543,6 @@ class URL { // toUSVString is not needed. input = `${input}`; this[context] = new URLContext(); - this.#onParseComplete = FunctionPrototypeBind(this.#onParseComplete, this); if (base !== undefined) { base = `${base}`; diff --git a/lib/internal/util/embedding.js b/lib/internal/util/embedding.js new file mode 100644 index 00000000000000..139d4c7a25fb7c --- /dev/null +++ b/lib/internal/util/embedding.js @@ -0,0 +1,47 @@ +'use strict'; +const { codes: { ERR_UNKNOWN_BUILTIN_MODULE } } = require('internal/errors'); +const { Module, wrapSafe } = require('internal/modules/cjs/loader'); + +// This is roughly the same as: +// +// const mod = new Module(filename); +// mod._compile(contents, filename); +// +// but the code has been duplicated because currently there is no way to set the +// value of require.main to module. +// +// TODO(RaisinTen): Find a way to deduplicate this. + +function embedderRunCjs(contents) { + const filename = process.execPath; + const compiledWrapper = wrapSafe(filename, contents); + + const customModule = new Module(filename, null); + customModule.filename = filename; + customModule.paths = Module._nodeModulePaths(customModule.path); + + const customExports = customModule.exports; + + embedderRequire.main = customModule; + + const customFilename = customModule.filename; + + const customDirname = customModule.path; + + return compiledWrapper( + customExports, + embedderRequire, + customModule, + customFilename, + customDirname); +} + +function embedderRequire(path) { + if (!Module.isBuiltin(path)) { + throw new ERR_UNKNOWN_BUILTIN_MODULE(path); + } + + return require(path); +} + +module.exports = { embedderRequire, embedderRunCjs }; diff --git a/src/api/environment.cc b/src/api/environment.cc index 8aa1385f548c4d..2f4d7a5c7fe3f1 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -528,17 +528,15 @@ MaybeLocal LoadEnvironment( return StartExecution(env, cb); } -MaybeLocal LoadEnvironment( - Environment* env, - const char* main_script_source_utf8) { - CHECK_NOT_NULL(main_script_source_utf8); +MaybeLocal LoadEnvironment(Environment* env, + std::string_view main_script_source_utf8) { + CHECK_NOT_NULL(main_script_source_utf8.data()); return LoadEnvironment( env, [&](const StartExecutionCallbackInfo& info) -> MaybeLocal { - std::string name = "embedder_main_" + std::to_string(env->thread_id()); - env->builtin_loader()->Add(name.c_str(), main_script_source_utf8); - Realm* realm = env->principal_realm(); - - return realm->ExecuteBootstrapper(name.c_str()); + Local main_script = + ToV8Value(env->context(), main_script_source_utf8).ToLocalChecked(); + return info.run_cjs->Call( + env->context(), Null(env->isolate()), 1, &main_script); }); } diff --git a/src/env-inl.h b/src/env-inl.h index 1d7a502b35aafd..68dfb3a4d57113 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -406,14 +406,12 @@ inline builtins::BuiltinLoader* Environment::builtin_loader() { return &builtin_loader_; } -inline const StartExecutionCallback& -Environment::embedder_mksnapshot_entry_point() const { - return embedder_mksnapshot_entry_point_; +inline const StartExecutionCallback& Environment::embedder_entry_point() const { + return embedder_entry_point_; } -inline void Environment::set_embedder_mksnapshot_entry_point( - StartExecutionCallback&& fn) { - embedder_mksnapshot_entry_point_ = std::move(fn); +inline void Environment::set_embedder_entry_point(StartExecutionCallback&& fn) { + embedder_entry_point_ = std::move(fn); } inline double Environment::new_async_id() { diff --git a/src/env.h b/src/env.h index 95ffa357ab05b4..c0e28d6c2ee751 100644 --- a/src/env.h +++ b/src/env.h @@ -948,8 +948,8 @@ class Environment : public MemoryRetainer { #endif // HAVE_INSPECTOR - inline const StartExecutionCallback& embedder_mksnapshot_entry_point() const; - inline void set_embedder_mksnapshot_entry_point(StartExecutionCallback&& fn); + inline const StartExecutionCallback& embedder_entry_point() const; + inline void set_embedder_entry_point(StartExecutionCallback&& fn); inline void set_process_exit_handler( std::function&& handler); @@ -1133,7 +1133,7 @@ class Environment : public MemoryRetainer { std::unique_ptr principal_realm_ = nullptr; builtins::BuiltinLoader builtin_loader_; - StartExecutionCallback embedder_mksnapshot_entry_point_; + StartExecutionCallback embedder_entry_point_; // Used by allocate_managed_buffer() and release_managed_buffer() to keep // track of the BackingStore for a given pointer. diff --git a/src/node.cc b/src/node.cc index 3f1b28a8a1815f..2aba7333d92513 100644 --- a/src/node.cc +++ b/src/node.cc @@ -277,22 +277,17 @@ MaybeLocal StartExecution(Environment* env, StartExecutionCallback cb) { if (cb != nullptr) { EscapableHandleScope scope(env->isolate()); + // TODO(addaleax): pass the callback to the main script more directly, + // e.g. by making StartExecution(env, builtin) parametrizable + env->set_embedder_entry_point(std::move(cb)); + auto reset_entry_point = + OnScopeLeave([&]() { env->set_embedder_entry_point({}); }); - if (env->isolate_data()->options()->build_snapshot) { - // TODO(addaleax): pass the callback to the main script more directly, - // e.g. by making StartExecution(env, builtin) parametrizable - env->set_embedder_mksnapshot_entry_point(std::move(cb)); - auto reset_entry_point = - OnScopeLeave([&]() { env->set_embedder_mksnapshot_entry_point({}); }); + const char* entry = env->isolate_data()->options()->build_snapshot + ? "internal/main/mksnapshot" + : "internal/main/embedding"; - return StartExecution(env, "internal/main/mksnapshot"); - } - - if (StartExecution(env, "internal/main/environment").IsEmpty()) return {}; - return scope.EscapeMaybe(cb({ - env->process_object(), - env->builtin_module_require(), - })); + return scope.EscapeMaybe(StartExecution(env, entry)); } // TODO(joyeecheung): move these conditions into JS land and let the @@ -312,18 +307,6 @@ MaybeLocal StartExecution(Environment* env, StartExecutionCallback cb) { first_argv = env->argv()[1]; } -#ifndef DISABLE_SINGLE_EXECUTABLE_APPLICATION - if (sea::IsSingleExecutable()) { - // TODO(addaleax): Find a way to reuse: - // - // LoadEnvironment(Environment*, const char*) - // - // instead and not add yet another main entry point here because this - // already duplicates existing code. - return StartExecution(env, "internal/main/single_executable_application"); - } -#endif - if (first_argv == "inspect") { return StartExecution(env, "internal/main/inspect"); } diff --git a/src/node.h b/src/node.h index 635e5349f4ee88..c3a81076d54ed6 100644 --- a/src/node.h +++ b/src/node.h @@ -682,6 +682,7 @@ NODE_EXTERN std::unique_ptr GetInspectorParentHandle( struct StartExecutionCallbackInfo { v8::Local process_object; v8::Local native_require; + v8::Local run_cjs; }; using StartExecutionCallback = @@ -691,8 +692,7 @@ NODE_EXTERN v8::MaybeLocal LoadEnvironment( Environment* env, StartExecutionCallback cb); NODE_EXTERN v8::MaybeLocal LoadEnvironment( - Environment* env, - const char* main_script_source_utf8); + Environment* env, std::string_view main_script_source_utf8); NODE_EXTERN void FreeEnvironment(Environment* env); // Set a callback that is called when process.exit() is called from JS, diff --git a/src/node_builtins.cc b/src/node_builtins.cc index e9bf8a5a0e0b7e..0439fff5115bd9 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -185,17 +185,14 @@ static std::string OnDiskFileName(const char* id) { MaybeLocal BuiltinLoader::LoadBuiltinSource(Isolate* isolate, const char* id) const { auto source = source_.read(); -#ifdef NODE_BUILTIN_MODULES_PATH - if (strncmp(id, "embedder_main_", strlen("embedder_main_")) == 0) { -#endif // NODE_BUILTIN_MODULES_PATH - const auto source_it = source->find(id); - if (UNLIKELY(source_it == source->end())) { - fprintf(stderr, "Cannot find native builtin: \"%s\".\n", id); - ABORT(); - } - return source_it->second.ToStringChecked(isolate); -#ifdef NODE_BUILTIN_MODULES_PATH +#ifndef NODE_BUILTIN_MODULES_PATH + const auto source_it = source->find(id); + if (UNLIKELY(source_it == source->end())) { + fprintf(stderr, "Cannot find native builtin: \"%s\".\n", id); + ABORT(); } + return source_it->second.ToStringChecked(isolate); +#else // !NODE_BUILTIN_MODULES_PATH std::string filename = OnDiskFileName(id); std::string contents; @@ -395,12 +392,6 @@ MaybeLocal BuiltinLoader::LookupAndCompile(Local context, FIXED_ONE_BYTE_STRING(isolate, "internalBinding"), FIXED_ONE_BYTE_STRING(isolate, "primordials"), }; - } else if (strncmp(id, "embedder_main_", strlen("embedder_main_")) == 0) { - // Synthetic embedder main scripts from LoadEnvironment(): process, require - parameters = { - FIXED_ONE_BYTE_STRING(isolate, "process"), - FIXED_ONE_BYTE_STRING(isolate, "require"), - }; } else { // others: exports, require, module, process, internalBinding, primordials parameters = { @@ -457,12 +448,6 @@ MaybeLocal BuiltinLoader::CompileAndCall(Local context, realm->builtin_module_require(), realm->internal_binding_loader(), realm->primordials()}; - } else if (strncmp(id, "embedder_main_", strlen("embedder_main_")) == 0) { - // Synthetic embedder main scripts from LoadEnvironment(): process, require - arguments = { - realm->process_object(), - realm->builtin_module_require(), - }; } else { // This should be invoked with the other CompileAndCall() methods, as // we are unable to generate the arguments. diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index 5a4d127ffe3e43..f0dc6ca275b007 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -9,6 +9,7 @@ #include "node_internals.h" #include "node_options-inl.h" #include "node_realm.h" +#include "node_sea.h" #include "node_snapshot_builder.h" #include "node_snapshotable.h" #include "node_v8_platform-inl.h" @@ -86,7 +87,16 @@ ExitCode NodeMainInstance::Run() { void NodeMainInstance::Run(ExitCode* exit_code, Environment* env) { if (*exit_code == ExitCode::kNoFailure) { - LoadEnvironment(env, StartExecutionCallback{}); + bool is_sea = false; +#ifndef DISABLE_SINGLE_EXECUTABLE_APPLICATION + if (sea::IsSingleExecutable()) { + is_sea = true; + LoadEnvironment(env, sea::FindSingleExecutableCode()); + } +#endif + if (!is_sea) { + LoadEnvironment(env, StartExecutionCallback{}); + } *exit_code = SpinEventLoopInternal(env).FromMaybe(ExitCode::kGenericUserError); diff --git a/src/node_sea.cc b/src/node_sea.cc index 18b661ce4ff31d..b65620d1ff9684 100644 --- a/src/node_sea.cc +++ b/src/node_sea.cc @@ -4,8 +4,6 @@ #include "node_external_reference.h" #include "node_internals.h" #include "node_union_bytes.h" -#include "simdutf.h" -#include "v8.h" // The POSTJECT_SENTINEL_FUSE macro is a string of random characters selected by // the Node.js project that is present only once in the entire binary. It is @@ -19,7 +17,6 @@ #include #include #include -#include #if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) @@ -29,9 +26,11 @@ using v8::Local; using v8::Object; using v8::Value; -namespace { +namespace node { +namespace sea { -const std::string_view FindSingleExecutableCode() { +std::string_view FindSingleExecutableCode() { + CHECK(IsSingleExecutable()); static const std::string_view sea_code = []() -> std::string_view { size_t size; #ifdef __APPLE__ @@ -49,44 +48,14 @@ const std::string_view FindSingleExecutableCode() { return sea_code; } -void GetSingleExecutableCode(const FunctionCallbackInfo& args) { - node::Environment* env = node::Environment::GetCurrent(args); - - static const std::string_view sea_code = FindSingleExecutableCode(); - - if (sea_code.empty()) { - return; - } - - // TODO(joyeecheung): Use one-byte strings for ASCII-only source to save - // memory/binary size - using UTF16 by default results in twice of the size - // than necessary. - static const node::UnionBytes sea_code_union_bytes = - []() -> node::UnionBytes { - size_t expected_u16_length = - simdutf::utf16_length_from_utf8(sea_code.data(), sea_code.size()); - auto out = std::make_shared>(expected_u16_length); - size_t u16_length = simdutf::convert_utf8_to_utf16( - sea_code.data(), - sea_code.size(), - reinterpret_cast(out->data())); - out->resize(u16_length); - return node::UnionBytes{out}; - }(); - - args.GetReturnValue().Set( - sea_code_union_bytes.ToStringChecked(env->isolate())); -} - -} // namespace - -namespace node { -namespace sea { - bool IsSingleExecutable() { return postject_has_resource(); } +void IsSingleExecutable(const FunctionCallbackInfo& args) { + args.GetReturnValue().Set(IsSingleExecutable()); +} + std::tuple FixupArgsForSEA(int argc, char** argv) { // Repeats argv[0] at position 1 on argv as a replacement for the missing // entry point file path. @@ -113,12 +82,11 @@ void Initialize(Local target, Local unused, Local context, void* priv) { - SetMethod( - context, target, "getSingleExecutableCode", GetSingleExecutableCode); + SetMethod(context, target, "isSea", IsSingleExecutable); } void RegisterExternalReferences(ExternalReferenceRegistry* registry) { - registry->Register(GetSingleExecutableCode); + registry->Register(IsSingleExecutable); } } // namespace sea diff --git a/src/node_sea.h b/src/node_sea.h index 97bf0115e0f0d4..aa0f20204743c0 100644 --- a/src/node_sea.h +++ b/src/node_sea.h @@ -5,12 +5,14 @@ #if !defined(DISABLE_SINGLE_EXECUTABLE_APPLICATION) +#include #include namespace node { namespace sea { bool IsSingleExecutable(); +std::string_view FindSingleExecutableCode(); std::tuple FixupArgsForSEA(int argc, char** argv); } // namespace sea diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index e6323a128f5ba4..ee327867378952 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -1444,19 +1444,25 @@ void SerializeSnapshotableObjects(Realm* realm, namespace mksnapshot { +// NB: This is also used by the regular embedding codepath. void GetEmbedderEntryFunction(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Isolate* isolate = env->isolate(); - if (!env->embedder_mksnapshot_entry_point()) return; + if (!env->embedder_entry_point()) return; MaybeLocal jsfn = Function::New(isolate->GetCurrentContext(), [](const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local require_fn = args[0]; + Local runcjs_fn = args[1]; CHECK(require_fn->IsFunction()); - CHECK(env->embedder_mksnapshot_entry_point()); - env->embedder_mksnapshot_entry_point()( - {env->process_object(), require_fn.As()}); + CHECK(runcjs_fn->IsFunction()); + MaybeLocal retval = env->embedder_entry_point()( + {env->process_object(), + require_fn.As(), + runcjs_fn.As()}); + if (!retval.IsEmpty()) + args.GetReturnValue().Set(retval.ToLocalChecked()); }); if (!jsfn.IsEmpty()) args.GetReturnValue().Set(jsfn.ToLocalChecked()); } diff --git a/src/node_url.cc b/src/node_url.cc index 1e8f6772fb8e6e..014a758b7df258 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -313,7 +313,7 @@ void Initialize(Local target, void* priv) { SetMethod(context, target, "parse", Parse); SetMethod(context, target, "updateUrl", UpdateUrl); - SetMethod(context, target, "formatUrl", FormatUrl); + SetMethodNoSideEffect(context, target, "formatUrl", FormatUrl); SetMethodNoSideEffect(context, target, "domainToASCII", DomainToASCII); SetMethodNoSideEffect(context, target, "domainToUnicode", DomainToUnicode); diff --git a/test/embedding/test-embedding.js b/test/embedding/test-embedding.js index 498c05fdebf377..9dfaad6c2ab27f 100644 --- a/test/embedding/test-embedding.js +++ b/test/embedding/test-embedding.js @@ -40,6 +40,11 @@ assert.strictEqual( child_process.spawnSync(binary, ['throw new Error()']).status, 1); +// Cannot require internals anymore: +assert.strictEqual( + child_process.spawnSync(binary, ['require("lib/internal/test/binding")']).status, + 1); + assert.strictEqual( child_process.spawnSync(binary, ['process.exitCode = 8']).status, 8); diff --git a/test/message/test_runner_abort.out b/test/message/test_runner_abort.out index 3f1a3c2b7703f1..95a78243e729bf 100644 --- a/test/message/test_runner_abort.out +++ b/test/message/test_runner_abort.out @@ -43,6 +43,7 @@ TAP version 13 failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -62,6 +63,7 @@ TAP version 13 failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -81,6 +83,7 @@ TAP version 13 failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -100,6 +103,7 @@ not ok 1 - promise timeout signal failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 + name: 'TimeoutError' stack: |- * * @@ -113,6 +117,7 @@ not ok 2 - promise abort signal failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -168,6 +173,7 @@ not ok 2 - promise abort signal failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -187,6 +193,7 @@ not ok 2 - promise abort signal failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -206,6 +213,7 @@ not ok 2 - promise abort signal failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * @@ -225,6 +233,7 @@ not ok 3 - callback timeout signal failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 + name: 'TimeoutError' stack: |- * * @@ -238,6 +247,7 @@ not ok 4 - callback abort signal failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * diff --git a/test/message/test_runner_abort_suite.out b/test/message/test_runner_abort_suite.out index 4dc71da99a766f..06a70bdf012196 100644 --- a/test/message/test_runner_abort_suite.out +++ b/test/message/test_runner_abort_suite.out @@ -67,6 +67,7 @@ not ok 1 - describe timeout signal failureType: 'testAborted' error: 'The operation was aborted due to timeout' code: 23 + name: 'TimeoutError' stack: |- * * @@ -80,6 +81,7 @@ not ok 2 - describe abort signal failureType: 'testAborted' error: 'This operation was aborted' code: 20 + name: 'AbortError' stack: |- * * diff --git a/test/message/test_runner_describe_it.out b/test/message/test_runner_describe_it.out index 2de7664bd24d1a..4502c89fdae086 100644 --- a/test/message/test_runner_describe_it.out +++ b/test/message/test_runner_describe_it.out @@ -122,6 +122,7 @@ not ok 14 - async assertion fail true !== false code: 'ERR_ASSERTION' + name: 'AssertionError' expected: false actual: true operator: 'strictEqual' diff --git a/test/message/test_runner_output.out b/test/message/test_runner_output.out index 1a165c33264e32..2609833304e246 100644 --- a/test/message/test_runner_output.out +++ b/test/message/test_runner_output.out @@ -126,6 +126,7 @@ not ok 13 - async assertion fail true !== false code: 'ERR_ASSERTION' + name: 'AssertionError' expected: false actual: true operator: 'strictEqual' diff --git a/test/message/test_runner_output_cli.out b/test/message/test_runner_output_cli.out index c351b1fa26fc83..72957397c05454 100644 --- a/test/message/test_runner_output_cli.out +++ b/test/message/test_runner_output_cli.out @@ -126,6 +126,7 @@ not ok 13 - async assertion fail true !== false code: 'ERR_ASSERTION' + name: 'AssertionError' expected: false actual: true operator: 'strictEqual' diff --git a/test/parallel/test-cluster-bind-privileged-port.js b/test/parallel/test-cluster-bind-privileged-port.js index 11a8aa6659335e..c971b7656f1221 100644 --- a/test/parallel/test-cluster-bind-privileged-port.js +++ b/test/parallel/test-cluster-bind-privileged-port.js @@ -27,9 +27,14 @@ const net = require('net'); const { readFileSync } = require('fs'); if (common.isLinux) { - const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start')); - if (unprivilegedPortStart <= 42) { - common.skip('Port 42 is unprivileged'); + try { + const unprivilegedPortStart = parseInt(readFileSync('/proc/sys/net/ipv4/ip_unprivileged_port_start')); + if (unprivilegedPortStart <= 42) { + common.skip('Port 42 is unprivileged'); + } + } catch { + // Do nothing, feature doesn't exist, minimum is 1024 so 42 is usable. + // Continue... } } diff --git a/tools/dep_updaters/update-eslint.sh b/tools/dep_updaters/update-eslint.sh index 7d536ef50212ab..b3025bb8ff9e7e 100755 --- a/tools/dep_updaters/update-eslint.sh +++ b/tools/dep_updaters/update-eslint.sh @@ -7,6 +7,20 @@ set -ex +ROOT=$(cd "$(dirname "$0")/../.." && pwd) + +[ -z "$NODE" ] && NODE="$ROOT/out/Release/node" +[ -x "$NODE" ] || NODE=$(command -v node) +NPM="$ROOT/deps/npm/bin/npm-cli.js" + +NEW_VERSION=$("$NODE" "$NPM" view eslint dist-tags.latest) +CURRENT_VERSION=$("$NODE" -p "require('./tools/node_modules/eslint/package.json').version") + +if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then + echo "Skipped because ESlint is on the latest version." + exit 0 +fi + cd "$( dirname "$0" )" || exit rm -rf ../node_modules/eslint ( @@ -14,11 +28,6 @@ rm -rf ../node_modules/eslint mkdir eslint-tmp cd eslint-tmp || exit - ROOT="$PWD/../../.." - [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" - [ -x "$NODE" ] || NODE=$(command -v node) - NPM="$ROOT/deps/npm/bin/npm-cli.js" - "$NODE" "$NPM" init --yes "$NODE" "$NPM" install \ @@ -63,3 +72,7 @@ rm -rf ../node_modules/eslint mv eslint-tmp/node_modules/eslint ../node_modules/eslint rm -rf eslint-tmp/ + +# The last line of the script should always print the new version, +# as we need to add it to $GITHUB_ENV variable. +echo "NEW_VERSION=$NEW_VERSION" diff --git a/tools/dep_updaters/update-libuv.sh b/tools/dep_updaters/update-libuv.sh index ae7fe9a76cac4e..a7ab4de930fc41 100755 --- a/tools/dep_updaters/update-libuv.sh +++ b/tools/dep_updaters/update-libuv.sh @@ -4,12 +4,29 @@ set -e BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) DEPS_DIR="$BASE_DIR/deps" -LIBUV_VERSION=$1 +[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" +[ -x "$NODE" ] || NODE=$(command -v node) -if [ "$#" -le 0 ]; then - echo "Error: please provide an libuv version to update to" - echo " e.g. $0 1.44.2" - exit 1 +NEW_VERSION="$("$NODE" --input-type=module <<'EOF' +const res = await fetch('https://api.github.com/repos/libuv/libuv/releases/latest'); +if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); +const { tag_name } = await res.json(); +console.log(tag_name.replace('v', '')); +EOF +)" + +VERSION_H="$DEPS_DIR/uv/include/uv/version.h" +CURRENT_MAJOR_VERSION=$(grep "#define UV_VERSION_MAJOR" "$VERSION_H" | sed -n "s/^.*MAJOR \(.*\)/\1/p") +CURRENT_MINOR_VERSION=$(grep "#define UV_VERSION_MINOR" "$VERSION_H" | sed -n "s/^.*MINOR \(.*\)/\1/p") +CURRENT_PATCH_VERSION=$(grep "#define UV_VERSION_PATCH" "$VERSION_H" | sed -n "s/^.*PATCH \(.*\)/\1/p") +CURRENT_IS_RELEASE=$(grep "#define UV_VERSION_IS_RELEASE" "$VERSION_H" | sed -n "s/^.*RELEASE \(.*\)/\1/p") +CURRENT_SUFFIX_VERSION=$(grep "#define UV_VERSION_SUFFIX" "$VERSION_H" | sed -n "s/^.*SUFFIX \"\(.*\)\"/\1/p") +SUFFIX_STRING=$([ "$CURRENT_IS_RELEASE" = 1 ] || [ -z "$CURRENT_SUFFIX_VERSION" ] && echo "" || echo "-$CURRENT_SUFFIX_VERSION") +CURRENT_VERSION="$CURRENT_MAJOR_VERSION.$CURRENT_MINOR_VERSION.$CURRENT_PATCH_VERSION$SUFFIX_STRING" + +if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then + echo "Skipped because libuv is on the latest version." + exit 0 fi echo "Making temporary workspace..." @@ -27,7 +44,7 @@ trap cleanup INT TERM EXIT cd "$WORKSPACE" echo "Fetching libuv source archive..." -curl -sL "https://api.github.com/repos/libuv/libuv/tarball/v$LIBUV_VERSION" | tar xzf - +curl -sL "https://api.github.com/repos/libuv/libuv/tarball/v$NEW_VERSION" | tar xzf - mv libuv-libuv-* uv echo "Replacing existing libuv (except GYP build files)" @@ -40,5 +57,9 @@ echo "" echo "Please git add uv, commit the new version:" echo "" echo "$ git add -A deps/uv" -echo "$ git commit -m \"deps: update libuv to $LIBUV_VERSION\"" +echo "$ git commit -m \"deps: update libuv to $NEW_VERSION\"" echo "" + +# The last line of the script should always print the new version, +# as we need to add it to $GITHUB_ENV variable. +echo "NEW_VERSION=$NEW_VERSION" diff --git a/tools/dep_updaters/update-postject.sh b/tools/dep_updaters/update-postject.sh index 66b207f9666636..f7a63ce1816cf9 100755 --- a/tools/dep_updaters/update-postject.sh +++ b/tools/dep_updaters/update-postject.sh @@ -7,16 +7,24 @@ set -ex +ROOT=$(cd "$(dirname "$0")/../.." && pwd) +[ -z "$NODE" ] && NODE="$ROOT/out/Release/node" +[ -x "$NODE" ] || NODE=$(command -v node) +NPM="$ROOT/deps/npm/bin/npm-cli.js" + +NEW_VERSION=$("$NODE" "$NPM" view postject dist-tags.latest) +CURRENT_VERSION=$("$NODE" -p "require('./test/fixtures/postject-copy/node_modules/postject/package.json').version") + +if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then + echo "Skipped because Postject is on the latest version." + exit 0 +fi + cd "$( dirname "$0" )/../.." || exit rm -rf test/fixtures/postject-copy mkdir test/fixtures/postject-copy cd test/fixtures/postject-copy || exit -ROOT="$PWD/../../.." -[ -z "$NODE" ] && NODE="$ROOT/out/Release/node" -[ -x "$NODE" ] || NODE=$(command -v node) -NPM="$ROOT/deps/npm/bin/npm-cli.js" - "$NODE" "$NPM" init --yes "$NODE" "$NPM" install --no-bin-links --ignore-scripts postject @@ -27,3 +35,7 @@ rm -rf deps/postject mkdir deps/postject cp test/fixtures/postject-copy/node_modules/postject/LICENSE deps/postject cp test/fixtures/postject-copy/node_modules/postject/dist/postject-api.h deps/postject + +# The last line of the script should always print the new version, +# as we need to add it to $GITHUB_ENV variable. +echo "NEW_VERSION=$NEW_VERSION" diff --git a/tools/dep_updaters/update-simdutf.sh b/tools/dep_updaters/update-simdutf.sh index d502558b474479..d9e97cb21e4e60 100755 --- a/tools/dep_updaters/update-simdutf.sh +++ b/tools/dep_updaters/update-simdutf.sh @@ -4,12 +4,21 @@ set -e BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) DEPS_DIR="$BASE_DIR/deps" -SIMDUTF_VERSION=$1 +[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node" +[ -x "$NODE" ] || NODE=$(command -v node) -if [ "$#" -le 0 ]; then - echo "Error: please provide an simdutf version to update to" - echo " e.g. $0 2.0.3" - exit 1 +NEW_VERSION="$("$NODE" --input-type=module <<'EOF' +const res = await fetch('https://api.github.com/repos/simdutf/simdutf/releases/latest'); +if (!res.ok) throw new Error(`FetchError: ${res.status} ${res.statusText}`, { cause: res }); +const { tag_name } = await res.json(); +console.log(tag_name.replace('v', '')); +EOF +)" +CURRENT_VERSION=$(grep "#define SIMDUTF_VERSION" "$DEPS_DIR/simdutf/simdutf.h" | sed -n "s/^.*VERSION \"\(.*\)\"/\1/p") + +if [ "$NEW_VERSION" = "$CURRENT_VERSION" ]; then + echo "Skipped because simdutf is on the latest version." + exit 0 fi echo "Making temporary workspace..." @@ -24,8 +33,8 @@ cleanup () { trap cleanup INT TERM EXIT -SIMDUTF_REF="v$SIMDUTF_VERSION" -SIMDUTF_ZIP="simdutf-$SIMDUTF_VERSION.zip" +SIMDUTF_REF="v$NEW_VERSION" +SIMDUTF_ZIP="simdutf-$NEW_VERSION.zip" SIMDUTF_LICENSE="LICENSE-MIT" cd "$WORKSPACE" @@ -48,5 +57,9 @@ echo "" echo "Please git add simdutf, commit the new version:" echo "" echo "$ git add -A deps/simdutf" -echo "$ git commit -m \"deps: update simdutf to $SIMDUTF_VERSION\"" +echo "$ git commit -m \"deps: update simdutf to $NEW_VERSION\"" echo "" + +# The last line of the script should always print the new version, +# as we need to add it to $GITHUB_ENV variable. +echo "NEW_VERSION=$NEW_VERSION" diff --git a/tools/msvs/msi/NuGet.Config b/tools/msvs/msi/NuGet.Config new file mode 100644 index 00000000000000..19d85b78fdf998 --- /dev/null +++ b/tools/msvs/msi/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/tools/msvs/msi/custom_actions.cc b/tools/msvs/msi/custom_actions/custom_actions.cc similarity index 87% rename from tools/msvs/msi/custom_actions.cc rename to tools/msvs/msi/custom_actions/custom_actions.cc index 32811dcb19469d..d747823423eeb5 100644 --- a/tools/msvs/msi/custom_actions.cc +++ b/tools/msvs/msi/custom_actions/custom_actions.cc @@ -77,27 +77,6 @@ extern "C" UINT WINAPI SetInstallScope(MSIHANDLE hInstall) { return WcaFinalize(ERROR_SUCCESS); } - -extern "C" UINT WINAPI BroadcastEnvironmentUpdate(MSIHANDLE hInstall) { - HRESULT hr = S_OK; - UINT er = ERROR_SUCCESS; - - hr = WcaInitialize(hInstall, "BroadcastEnvironmentUpdate"); - ExitOnFailure(hr, "Failed to initialize"); - - SendMessageTimeoutW(HWND_BROADCAST, - WM_SETTINGCHANGE, - 0, - (LPARAM) L"Environment", - SMTO_ABORTIFHUNG, - 5000, - NULL); - -LExit: - er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE; - return WcaFinalize(er); -} - #define AUTHENTICATED_USERS_SID L"S-1-5-11" extern "C" UINT WINAPI GetLocalizedUserNames(MSIHANDLE hInstall) { diff --git a/tools/msvs/msi/custom_actions.def b/tools/msvs/msi/custom_actions/custom_actions.def similarity index 72% rename from tools/msvs/msi/custom_actions.def rename to tools/msvs/msi/custom_actions/custom_actions.def index 93f2a28f45e45e..5561777ae77539 100644 --- a/tools/msvs/msi/custom_actions.def +++ b/tools/msvs/msi/custom_actions/custom_actions.def @@ -2,5 +2,4 @@ LIBRARY "custom_actions" EXPORTS SetInstallScope -BroadcastEnvironmentUpdate GetLocalizedUserNames diff --git a/tools/msvs/msi/custom_actions.vcxproj b/tools/msvs/msi/custom_actions/custom_actions.vcxproj similarity index 82% rename from tools/msvs/msi/custom_actions.vcxproj rename to tools/msvs/msi/custom_actions/custom_actions.vcxproj index 2fed47b6e4a781..6de11e1eae3474 100644 --- a/tools/msvs/msi/custom_actions.vcxproj +++ b/tools/msvs/msi/custom_actions/custom_actions.vcxproj @@ -112,7 +112,7 @@ Disabled - $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) + $(PkgWixToolset_WcaUtil)\build\native\include;$(PkgWixToolset_DUtil)\build\native\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -122,7 +122,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WixSdkDir)\lib\x86;%(AdditionalLibraryDirectories) + $(PkgWixToolset_WcaUtil)\build\native\v14\x86;$(PkgWixToolset_DUtil)\build\native\v14\x86;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -131,7 +131,7 @@ Disabled - $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) + $(PkgWixToolset_WcaUtil)\build\native\include;$(PkgWixToolset_DUtil)\build\native\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -141,7 +141,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WixSdkDir)\lib\ARM64;%(AdditionalLibraryDirectories) + $(PkgWixToolset_WcaUtil)\build\native\v14\ARM64;$(PkgWixToolset_DUtil)\build\native\v14\ARM64;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -150,7 +150,7 @@ Disabled - $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) + $(PkgWixToolset_WcaUtil)\build\native\include;$(PkgWixToolset_DUtil)\build\native\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug @@ -160,7 +160,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WixSdkDir)\lib\x64;%(AdditionalLibraryDirectories) + $(PkgWixToolset_WcaUtil)\build\native\v14\x64;$(PkgWixToolset_DUtil)\build\native\v14\x64;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -170,7 +170,7 @@ MaxSpeed true - $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) + $(PkgWixToolset_WcaUtil)\build\native\include;$(PkgWixToolset_DUtil)\build\native\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreaded true @@ -184,7 +184,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WixSdkDir)\lib\x86;%(AdditionalLibraryDirectories) + $(PkgWixToolset_WcaUtil)\build\native\v14\x86;$(PkgWixToolset_DUtil)\build\native\v14\x86;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -196,7 +196,7 @@ MaxSpeed true - $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) + $(PkgWixToolset_WcaUtil)\build\native\include;$(PkgWixToolset_DUtil)\build\native\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreaded true @@ -210,7 +210,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WixSdkDir)\lib\ARM64;%(AdditionalLibraryDirectories) + $(PkgWixToolset_WcaUtil)\build\native\v14\ARM64;$(PkgWixToolset_DUtil)\build\native\v14\ARM64;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -222,7 +222,7 @@ MaxSpeed true - $(WixSdkDir)\inc;%(AdditionalIncludeDirectories) + $(PkgWixToolset_WcaUtil)\build\native\include;$(PkgWixToolset_DUtil)\build\native\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreaded true @@ -236,7 +236,7 @@ msi.lib;dutil.lib;wcautil.lib;version.lib;%(AdditionalDependencies) - $(WixSdkDir)\lib\x64;%(AdditionalLibraryDirectories) + $(PkgWixToolset_WcaUtil)\build\native\v14\x64;$(PkgWixToolset_DUtil)\build\native\v14\x64;%(AdditionalLibraryDirectories) custom_actions.def true Windows @@ -254,4 +254,12 @@ + + + + + + <_NuGetTargetFallbackMoniker>$(_NuGetTargetFallbackMoniker);native,Version=v0.0 + $(RuntimeIdentifiers);win-arm64 + diff --git a/tools/msvs/msi/i18n/en-us.wxl b/tools/msvs/msi/i18n/en-us.wxl deleted file mode 100644 index dc69f218240149..00000000000000 --- a/tools/msvs/msi/i18n/en-us.wxl +++ /dev/null @@ -1,43 +0,0 @@ - - - - 1033 - - The Setup Wizard will install [ProductName] on your computer. - Choose a custom location or click Next to install. - - A later version of [ProductName] is already installed. Setup will now exit. - - [ProductName] Setup - {\WixUI_Font_Title}Tools for Native Modules - Optionally install the tools necessary to compile native modules. - WixUI_Bmp_Banner - Some npm modules need to be compiled from C/C++ when installing. If you want to be able to install such modules, some tools (Python and Visual Studio Build Tools) need to be installed. - Automatically install the necessary tools. Note that this will also install Chocolatey. The script will pop-up in a new window after the installation completes. - Alternatively, follow the instructions at https://github.com/nodejs/node-gyp#on-windows]]> to install the dependencies yourself. - - - Node.js runtime - Install the core [ProductName] runtime (node.exe). - - npm package manager - Install npm, the recommended package manager for [ProductName]. - - corepack manager - Install corepack, the universal package manager for [ProductName]. - - Online documentation shortcuts - Add start menu entries that link the online documentation for [ProductName] [FullVersion] and the [ProductName] website. - - Add to PATH - Add [ProductName], npm, and modules that were globally installed by npm to the PATH environment variable. - - Node.js and npm - Add [ProductName] and npm (if installed) to the PATH environment variable. - - npm modules - Add modules that are installed globally by npm to the PATH environment variable. This option works for the current user only; other users need to update their PATH manually. - - - Node.js has been successfully installed. - diff --git a/tools/msvs/msi/nodemsi.sln b/tools/msvs/msi/nodemsi.sln index 86b4b10dcb043f..e06530f5e24abd 100644 --- a/tools/msvs/msi/nodemsi.sln +++ b/tools/msvs/msi/nodemsi.sln @@ -1,9 +1,13 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "nodemsi", "nodemsi.wixproj", "{1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}" +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.33027.164 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{B7DD6F7E-DEF8-4E67-B5B7-07EF123DB6F0}") = "nodemsi", "nodemsi\nodemsi.wixproj", "{1D808FF0-B5A9-4BE9-859D-B334B6F48BE2}" + ProjectSection(ProjectDependencies) = postProject + {B70585F8-DAB7-40FA-9904-13CF53A73A06} = {B70585F8-DAB7-40FA-9904-13CF53A73A06} + EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_actions", "custom_actions.vcxproj", "{B70585F8-DAB7-40FA-9904-13CF53A73A06}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_actions", "custom_actions\custom_actions.vcxproj", "{B70585F8-DAB7-40FA-9904-13CF53A73A06}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -43,4 +47,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FB650322-7A09-471D-A635-F2DBDCEECDB8} + EndGlobalSection EndGlobal diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj deleted file mode 100644 index 0cf215daca5978..00000000000000 --- a/tools/msvs/msi/nodemsi.wixproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - x86 - 3.5 - {1d808ff0-b5a9-4be9-859d-b334b6f48be2} - 2.0 - node-v$(FullVersion)-$(Platform) - Package - True - $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets - $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets - 0.0.0.0 - - - ..\..\..\ - obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder - - - ..\..\..\ - obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder - - - ..\..\..\ - obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder - en-US - - - ..\..\..\ - obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder - - - ..\..\..\ - obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder - - - ..\..\..\ - obj\$(Configuration)\ - Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder - - - True - - - - - npm.wxs - - - corepack.wxs - - - - - $(WixExtDir)\WixUIExtension.dll - WixUIExtension - - - $(WixExtDir)\WiXUtilExtension.dll - WiXUtilExtension - - - - - - - - custom_actions - {b70585f8-dab7-40fa-9904-13cf53a73a06} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - - - - - - - - - - - move "!(TargetPath)" "$(TargetDir)\$(TargetFileName)" - move "!(TargetPdbPath)" "$(TargetDir)\$(TargetPdbName)" - - diff --git a/tools/msvs/msi/nodemsi/i18n/en-us.wxl b/tools/msvs/msi/nodemsi/i18n/en-us.wxl new file mode 100644 index 00000000000000..5074d5a43125f7 --- /dev/null +++ b/tools/msvs/msi/nodemsi/i18n/en-us.wxl @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/msvs/msi/nodemsi/nodemsi.wixproj b/tools/msvs/msi/nodemsi/nodemsi.wixproj new file mode 100644 index 00000000000000..b1463cf65696b9 --- /dev/null +++ b/tools/msvs/msi/nodemsi/nodemsi.wixproj @@ -0,0 +1,70 @@ + + + + Debug + x86 + 3.5 + {1d808ff0-b5a9-4be9-859d-b334b6f48be2} + node-v$(FullVersion)-$(Platform) + Package + 0.0.0.0 + + + ..\..\..\..\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder + + + ..\..\..\..\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder + + + ..\..\..\..\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder + en-US + + + ..\..\..\..\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder + + + ..\..\..\..\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder + + + ..\..\..\..\ + obj\$(Configuration)\ + Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder + + + + npm.wxs + + + corepack.wxs + + + + + + + + + + + + + + + + + + + move "$(TargetDir)en-us\$(TargetFileName)" "$(TargetPath)" + move "$(TargetDir)en-us\$(TargetPdbFileName)" "$(TargetPdbPath)" + + diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/nodemsi/product.wxs old mode 100755 new mode 100644 similarity index 79% rename from tools/msvs/msi/product.wxs rename to tools/msvs/msi/nodemsi/product.wxs index c6984777fac3fa..de4a6a34cee118 --- a/tools/msvs/msi/product.wxs +++ b/tools/msvs/msi/nodemsi/product.wxs @@ -1,6 +1,6 @@ - - + @@ -8,24 +8,18 @@ - + - + UpgradeCode="47c07a3a-42ef-4213-a85d-8f5a59077c28" + InstallerVersion="200" + Compressed="yes"> - - - - = 603) OR (VersionNT >= 602 AND MsiNTProductType <> 1)]]> - + @@ -46,10 +40,9 @@ - - - - + + + + AllowAbsent="no"> @@ -79,7 +72,6 @@ - - - - - + + + - - - + + - + @@ -197,13 +187,13 @@ + - - - - - - - - + + + + + + + - + @@ -314,38 +304,39 @@ - + - - + + - + - - - + + + @@ -383,34 +374,35 @@ - 1 + - NOT Installed - Installed AND PATCH - 1 - LicenseAccepted = "1" - 1 - 1 - 1 - 1 - 1 - NOT Installed OR WixUI_InstallMode = "Change" - Installed AND NOT PATCH - Installed AND PATCH - 1 - 1 - 1 - 1 - 1 - Installed - NOT Installed - 1 - 1 - 1 - NATIVETOOLSCHECKBOX = 1 - 1 + + + + + + + + + + + + + + + + + + + + + + + + + @@ -420,6 +412,6 @@ - + diff --git a/tools/msvs/vswhere_usability_wrapper.cmd b/tools/msvs/vswhere_usability_wrapper.cmd index 45ca5b2164a3b3..b5dcf7f42a06c6 100644 --- a/tools/msvs/vswhere_usability_wrapper.cmd +++ b/tools/msvs/vswhere_usability_wrapper.cmd @@ -5,7 +5,7 @@ @if not defined DEBUG_HELPER @ECHO OFF setlocal -if "%~2"=="prerelease" set VSWHERE_WITH_PRERELEASE=1 +if "%~3"=="prerelease" set VSWHERE_WITH_PRERELEASE=1 set "InstallerPath=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" if not exist "%InstallerPath%" set "InstallerPath=%ProgramFiles%\Microsoft Visual Studio\Installer" if not exist "%InstallerPath%" goto :no-vswhere @@ -13,7 +13,11 @@ if not exist "%InstallerPath%" goto :no-vswhere set "Path=%Path%;%InstallerPath%" where vswhere 2> nul > nul if errorlevel 1 goto :no-vswhere -set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 +if "%2"=="arm64" ( + set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 +) else ( + set VSWHERE_REQ=-requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 +) set VSWHERE_PRP=-property installationPath set VSWHERE_LMT=-version %1 vswhere -prerelease > nul diff --git a/vcbuild.bat b/vcbuild.bat index dc9ff39ed6644c..a4dd3a28d5c98b 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -242,12 +242,12 @@ if defined noprojgen if defined nobuild goto :after-build set msvs_host_arch=x86 if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ set msvs_host_arch=amd64 if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ set msvs_host_arch=amd64 +if _%PROCESSOR_ARCHITECTURE%_==_ARM64_ set msvs_host_arch=arm64 @rem usually vcvarsall takes an argument: host + '_' + target set vcvarsall_arg=%msvs_host_arch%_%target_arch% -@rem unless both host and target are x64 +@rem unless both the host and the target are the same if %target_arch%==x64 if %msvs_host_arch%==amd64 set vcvarsall_arg=amd64 -@rem also if both are x86 -if %target_arch%==x86 if %msvs_host_arch%==x86 set vcvarsall_arg=x86 +if %target_arch%==%msvs_host_arch% set vcvarsall_arg=%target_arch% @rem Look for Visual Studio 2022 :vs-set-2022 @@ -257,21 +257,8 @@ echo Looking for Visual Studio 2022 @rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to @rem detect the version searched for if not defined target_env set "VCINSTALLDIR=" -call tools\msvs\vswhere_usability_wrapper.cmd "[17.0,18.0)" "prerelease" +call tools\msvs\vswhere_usability_wrapper.cmd "[17.0,18.0)" %target_arch% "prerelease" if "_%VCINSTALLDIR%_" == "__" goto vs-set-2019 -set "WIXSDKDIR=%WIX%\SDK\VS2017" -if defined msi ( - echo Looking for WiX installation for Visual Studio 2022... - if not exist "%WIXSDKDIR%" ( - echo Failed to find WiX install for Visual Studio 2022 - echo VS2022 support for WiX is only present starting at version 3.XX - goto vs-set-2019 - ) - if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" ( - echo Failed to find the WiX Toolset Visual Studio 2022 Extension - goto vs-set-2019 - ) -) @rem check if VS2022 is already setup, and for the requested arch if "_%VisualStudioVersion%_" == "_17.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2022 @rem need to clear VSINSTALLDIR for vcvarsall to work as expected @@ -297,21 +284,8 @@ echo Looking for Visual Studio 2019 @rem cleared first as vswhere_usability_wrapper.cmd doesn't when it fails to @rem detect the version searched for if not defined target_env set "VCINSTALLDIR=" -call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)" "prerelease" +call tools\msvs\vswhere_usability_wrapper.cmd "[16.0,17.0)" %target_arch% "prerelease" if "_%VCINSTALLDIR%_" == "__" goto msbuild-not-found -set "WIXSDKDIR=%WIX%\SDK\VS2017" -if defined msi ( - echo Looking for WiX installation for Visual Studio 2019... - if not exist "%WIXSDKDIR%" ( - echo Failed to find WiX install for Visual Studio 2019 - echo VS2019 support for WiX is only present starting at version 3.11 - goto msbuild-not-found - ) - if not exist "%VCINSTALLDIR%\..\MSBuild\Microsoft\WiX" ( - echo Failed to find the WiX Toolset Visual Studio 2019 Extension - goto msbuild-not-found - ) -) @rem check if VS2019 is already setup, and for the requested arch if "_%VisualStudioVersion%_" == "_16.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_arch%_" goto found_vs2019 @rem need to clear VSINSTALLDIR for vcvarsall to work as expected @@ -532,7 +506,7 @@ if not defined msi goto install-doctools echo Building node-v%FULLVERSION%-%target_arch%.msi set "msbsdk=" if defined WindowsSDKVersion set "msbsdk=/p:WindowsTargetPlatformVersion=%WindowsSDKVersion:~0,-1%" -msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:WixSdkDir="%WIXSDKDIR%" /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo +msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Restore,Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit if not defined sign goto upload