From 5899439ff245d8d4d73f50cb61eec2c7b7445d1f Mon Sep 17 00:00:00 2001 From: juj Date: Wed, 27 Aug 2025 21:41:47 +0300 Subject: [PATCH] Add support for a new command 'emsdk deactivate' (#1593) Add support for a new command 'emsdk deactivate' that can be used to remove a tool from the active list. Since the big endian cross compile Node.js is added to `NODE_JS_TEST` instead of `NODE_JS`, there needs to be a way to deactivate it for regular runs. This PR adds a `emsdk deactivate` command to enable doing that. --- emsdk.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/emsdk.py b/emsdk.py index 180e763..a74c005 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2838,6 +2838,9 @@ def main(args): --override-repository emscripten-main@https://github.com//emscripten/tree/ + emsdk deactivate tool/sdk - Removes the given tool or SDK from the current set of activated tools. + + emsdk uninstall - Removes the given tool or SDK from disk.''') if WINDOWS: @@ -3107,7 +3110,7 @@ def main(args): elif cmd == 'update-tags': errlog('`update-tags` is not longer needed. To install the latest tot release just run `install tot`') return 0 - elif cmd == 'activate': + elif cmd == 'activate' or cmd == 'deactivate': if arg_permanent: print('Registering active Emscripten environment permanently') print('') @@ -3119,7 +3122,14 @@ def main(args): tool = find_sdk(arg) if tool is None: error_on_missing_tool(arg) - tools_to_activate += [tool] + + if cmd == 'activate': + tools_to_activate += [tool] + elif tool in tools_to_activate: + print('Deactivating tool ' + str(tool) + '.') + tools_to_activate.remove(tool) + else: + print('Tool "' + arg + '" was not active, no need to deactivate.') if not tools_to_activate: errlog('No tools/SDKs specified to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]') return 1