From 8505d6b5fbd81ed0b212143feb18ebf6538bfe1b Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 12 Apr 2020 20:36:10 +0200 Subject: [PATCH 01/14] Set user environment variables by default in Windows --- emsdk.py | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) mode change 100755 => 100644 emsdk.py diff --git a/emsdk.py b/emsdk.py old mode 100755 new mode 100644 index e4669eecc2..441dcfe05f --- a/emsdk.py +++ b/emsdk.py @@ -1760,18 +1760,13 @@ def is_env_active(self): return False return True - def win_activate_env_vars(self, permanently_activate): + def win_activate_env_vars(self, system): if WINDOWS: envs = self.activated_environment() for env in envs: key, value = parse_key_value(env) - if permanently_activate: - # If there is an env var for the LOCAL USER with same name, it will - # hide the system var, so must remove that first. - win_delete_environment_variable(key, False) - - win_set_environment_variable(key, value, permanently_activate) + win_set_environment_variable(key, value, system) # If this tool can be installed on this system, this function returns True. # Otherwise, this function returns a string that describes the reason why this @@ -2411,7 +2406,7 @@ def write_set_env_script(env_string): # Reconfigure .emscripten to choose the currently activated toolset, set PATH # and other environment variables. # Returns the full list of deduced tools that are now active. -def set_active_tools(tools_to_activate, permanently_activate): +def set_active_tools(tools_to_activate, permanently_activate, system): tools_to_activate = process_tool_list(tools_to_activate, log_errors=True) if tools_to_activate: @@ -2433,13 +2428,13 @@ def set_active_tools(tools_to_activate, permanently_activate): if WINDOWS and permanently_activate: # Individual env. vars for tool in tools_to_activate: - tool.win_activate_env_vars(permanently_activate=True) + tool.win_activate_env_vars(system=system) # PATH variable - newpath, added_items = adjusted_path(tools_to_activate, system_path_only=True) + newpath, added_items = adjusted_path(tools_to_activate, system=system) # Are there any actual changes? if newpath != os.environ['PATH']: - win_set_environment_variable('PATH', newpath, system=True) + win_set_environment_variable('PATH', newpath, system=system) return tools_to_activate @@ -2485,17 +2480,12 @@ def to_msys_path(p): # Looks at the current PATH and adds and removes entries so that the PATH reflects # the set of given active tools. -def adjusted_path(tools_to_activate, log_additions=False, system_path_only=False): +def adjusted_path(tools_to_activate, log_additions=False, system=False): # These directories should be added to PATH path_add = get_required_path(tools_to_activate) # These already exist. if WINDOWS and not MSYS: - existing_path = win_get_environment_variable('PATH', system=True) - if not system_path_only: - current_user_path = win_get_environment_variable('PATH', system=False) - if current_user_path: - existing_path += ENVPATH_SEPARATOR + current_user_path - existing_path = existing_path.split(ENVPATH_SEPARATOR) + existing_path = win_get_environment_variable('PATH', system=system).split(ENVPATH_SEPARATOR) else: existing_path = os.environ['PATH'].split(ENVPATH_SEPARATOR) emsdk_root_path = to_unix_path(emsdk_path()) @@ -2776,6 +2766,7 @@ def extract_bool_arg(name): arg_old = extract_bool_arg('--old') arg_uses = extract_bool_arg('--uses') arg_global = extract_bool_arg('--global') + arg_system = extract_bool_arg('--system') if extract_bool_arg('--embedded'): errlog('embedded mode is now the only mode available') if extract_bool_arg('--no-embedded'): @@ -2987,7 +2978,7 @@ def print_tools(t): if not tools_to_activate: errlog('No tools/SDKs specified to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]') return 1 - active_tools = set_active_tools(tools_to_activate, permanently_activate=arg_global) + active_tools = set_active_tools(tools_to_activate, permanently_activate=arg_global, system=arg_system) if not active_tools: errlog('No tools/SDKs found to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]') return 1 From 84e00aaff9cbad5b99208aaa324a16f0a83bd119 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 12 Apr 2020 21:00:08 +0200 Subject: [PATCH 02/14] remove redundant parameter --- emsdk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emsdk.py b/emsdk.py index 441dcfe05f..357a308efd 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2480,7 +2480,7 @@ def to_msys_path(p): # Looks at the current PATH and adds and removes entries so that the PATH reflects # the set of given active tools. -def adjusted_path(tools_to_activate, log_additions=False, system=False): +def adjusted_path(tools_to_activate, system=False): # These directories should be added to PATH path_add = get_required_path(tools_to_activate) # These already exist. From adb85410ec454532e0f62b1b93cb48e4a58284fd Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 18 Sep 2020 17:12:28 -0500 Subject: [PATCH 03/14] set `arg_global`if `arg_system` is provided In other words, system means permanent too! --- emsdk.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emsdk.py b/emsdk.py index 357a308efd..f0a0d3396f 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2767,6 +2767,8 @@ def extract_bool_arg(name): arg_uses = extract_bool_arg('--uses') arg_global = extract_bool_arg('--global') arg_system = extract_bool_arg('--system') + if arg_system: + arg_global = True if extract_bool_arg('--embedded'): errlog('embedded mode is now the only mode available') if extract_bool_arg('--no-embedded'): From 86358df619be38263d79f82c5a5a3a4ea81eda97 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 18 Sep 2020 17:16:53 -0500 Subject: [PATCH 04/14] add documentation for --global and --system options --- emsdk.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/emsdk.py b/emsdk.py index f0a0d3396f..d76d4dfa98 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2730,12 +2730,17 @@ def main(): emsdk activate [--global] [--build=type] [--vs2017/--vs2019] - Activates the given tool or SDK in the - environment of the current shell. If the - --global option is passed, the registration - is done globally to all users in the system - environment. If a custom compiler version was - used to override the compiler to use, pass - the same --vs2017/--vs2019 parameter + environment of the current shell. + + - If the `--global` option is passed, the the environment + variables are set permanently for the current user. + + - If the `--system` option is passed, the registration + is done for all users of the system + (uses Machine environment variables). + + - If a custom compiler version was used to override + the compiler to use, pass the same --vs2017/--vs2019 parameter here to choose which version to activate. emcmdprompt.bat - Spawns a new command prompt window with the From 9f24f8eae42791f671817a8f61742546673e51c0 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 18 Sep 2020 19:11:11 -0500 Subject: [PATCH 05/14] deprecate --global, introduce --permanent --- emsdk.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/emsdk.py b/emsdk.py index d76d4dfa98..04a1b54877 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2727,12 +2727,12 @@ def main(): if WINDOWS: print(''' - emsdk activate [--global] [--build=type] [--vs2017/--vs2019] + emsdk activate [--permanent] [--system] [--build=type] [--vs2017/--vs2019] - Activates the given tool or SDK in the environment of the current shell. - - If the `--global` option is passed, the the environment + - If the `--permanent` option is passed, the the environment variables are set permanently for the current user. - If the `--system` option is passed, the registration @@ -2770,9 +2770,13 @@ def extract_bool_arg(name): arg_old = extract_bool_arg('--old') arg_uses = extract_bool_arg('--uses') + arg_permanent = extract_bool_arg('--permanent') arg_global = extract_bool_arg('--global') + if arg_global: + print('--global is deprecated. Use `--system` to set the environment variables for all users') arg_system = extract_bool_arg('--system') if arg_system: + arg_permanent = True arg_global = True if extract_bool_arg('--embedded'): errlog('embedded mode is now the only mode available') @@ -2935,7 +2939,7 @@ def print_tools(t): print('Items marked with * are activated for the current user.') if has_partially_active_tools[0]: env_cmd = 'emsdk_env.bat' if WINDOWS else 'source ./emsdk_env.sh' - print('Items marked with (*) are selected for use, but your current shell environment is not configured to use them. Type "' + env_cmd + '" to set up your current shell to use them' + (', or call "emsdk activate --global " to permanently activate them.' if WINDOWS else '.')) + print('Items marked with (*) are selected for use, but your current shell environment is not configured to use them. Type "' + env_cmd + '" to set up your current shell to use them' + (', or call "emsdk activate --permanent " to permanently activate them.' if WINDOWS else '.')) if not arg_old: print('') print("To access the historical archived versions, type 'emsdk list --old'") @@ -2969,8 +2973,8 @@ def print_tools(t): fetch_emscripten_tags() return 0 elif cmd == 'activate': - if arg_global: - print('Registering active Emscripten environment globally for all users.') + if arg_permanent: + print('Registering active Emscripten environment premenantly') print('') tools_to_activate = currently_active_tools() @@ -2985,12 +2989,12 @@ def print_tools(t): if not tools_to_activate: errlog('No tools/SDKs specified to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]') return 1 - active_tools = set_active_tools(tools_to_activate, permanently_activate=arg_global, system=arg_system) + active_tools = set_active_tools(tools_to_activate, permanently_activate=arg_permanent, system=arg_system) if not active_tools: errlog('No tools/SDKs found to activate! Usage:\n emsdk activate tool/sdk1 [tool/sdk2] [...]') return 1 - if WINDOWS and not arg_global: - errlog('The changes made to environment variables only apply to the currently running shell instance. Use the \'emsdk_env.bat\' to re-enter this environment later, or if you\'d like to permanently register this environment globally to all users in Windows Registry, rerun this command with the option --global.') + if WINDOWS and not arg_permanent: + errlog('The changes made to environment variables only apply to the currently running shell instance. Use the \'emsdk_env.bat\' to re-enter this environment later, or if you\'d like to permanently register this environment permanently, rerun this command with the option --permanent.') return 0 elif cmd == 'install': # Process args From 188c5ac9303a7e5d291d4bf4ecab1b88c3bf9c75 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 18 Sep 2020 20:19:03 -0500 Subject: [PATCH 06/14] add tests for --permanent on Windows --- .circleci/config.yml | 5 +++ scripts/test_permanent.ps1 | 67 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 scripts/test_permanent.ps1 diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b3959661e..6a5e16f475 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,6 +87,11 @@ jobs: command: | source emsdk_env.sh python scripts/test.py + - run: + name: --permanent test + shell: powershell.exe + command: | + scripts/test_permanent.ps1 build-docker-image: executor: bionic diff --git a/scripts/test_permanent.ps1 b/scripts/test_permanent.ps1 new file mode 100644 index 0000000000..051b2a1eaf --- /dev/null +++ b/scripts/test_permanent.ps1 @@ -0,0 +1,67 @@ +$cwd=(Get-Location).Path + +try { + + cd([System.IO.Path]::GetDirectoryName((resolve-path "$PSScriptRoot"))) + + ./emsdk.ps1 install latest + ./emsdk.ps1 activate latest --permanently + + $EMSDK_USER = [System.Environment]::GetEnvironmentVariable("EMSDK", "User") + $EM_CONFIG_USER = [System.Environment]::GetEnvironmentVariable("EM_CONFIG", "User") + $EMSDK_NODE_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_NODE", "User") + $EMSDK_PYTHON_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_PYTHON", "User") + $JAVA_HOME_USER = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", "User") + $EM_CACHE_USER = [System.Environment]::GetEnvironmentVariable("EM_CACHE", "User") + $PATH_USER = [System.Environment]::GetEnvironmentVariable("PATH", "User") + + if (!$EMSDK_USER) { + throw "EMSDK is not set for the user" + } + if (!$EM_CONFIG_USER) { + throw "EM_CONFIG_USER is not set for the user" + } + if (!$EMSDK_NODE_USER) { + throw "EMSDK_NODE is not set for the user" + } + if (!$JAVA_HOME_USER) { + throw "JAVA_HOME is not set for the user" + } + if (!$EMSDK_PYTHON_USER) { + throw "EMSDK_PYTHON is not set for the user" + } + if (!$EM_CACHE_USER) { + throw "EM_CACHE is not set for the user" + } + + + $path_split = $path.Split(';') + + $EMSDK_Path_USER = $path_split | Where-Object { $_ -match 'emsdk' } + if (!$EMSDK_Path_USER) { + throw "No path is added!" + } + $EMSDK_NODE_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\node' } + if (!$EMSDK_NODE_Path_USER) { + throw "emsdk\node is not added to path." + } + $EMSDK_PYTHON_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\python' } + if (!$EMSDK_PYTHON_Path_USER) { + throw "emsdk\python is not added to path." + } + $EMSDK_JAVA_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\java' } + if (!$EMSDK_JAVA_Path_USER) { + throw "emsdk\java is not added to path." + } + + $EMSDK_UPSTREAM_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\upstream\\emscripten' } + if (!$EMSDK_UPSTREAM_Path_USER) { + throw "emsdk\upstream\emscripten is not added to path." + } + +} +finally +{ +# return back to cwd +cd $cwd +} From 25efaf464a58404ecc72d39342a375df6a43f866 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 20 Sep 2020 23:00:55 -0500 Subject: [PATCH 07/14] set arg_permanent if arg_global is used --- emsdk.py | 1 + 1 file changed, 1 insertion(+) diff --git a/emsdk.py b/emsdk.py index 04a1b54877..96b4711934 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2774,6 +2774,7 @@ def extract_bool_arg(name): arg_global = extract_bool_arg('--global') if arg_global: print('--global is deprecated. Use `--system` to set the environment variables for all users') + arg_permanent = True arg_system = extract_bool_arg('--system') if arg_system: arg_permanent = True From bd028b9b6278e6e7b58b972c11de62ce3b0e3748 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 20 Sep 2020 23:01:05 -0500 Subject: [PATCH 08/14] don't use arg_global anymore --- emsdk.py | 1 - 1 file changed, 1 deletion(-) diff --git a/emsdk.py b/emsdk.py index 96b4711934..a90b67b078 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2778,7 +2778,6 @@ def extract_bool_arg(name): arg_system = extract_bool_arg('--system') if arg_system: arg_permanent = True - arg_global = True if extract_bool_arg('--embedded'): errlog('embedded mode is now the only mode available') if extract_bool_arg('--no-embedded'): From 8bd542291c0103bfa8d7f937ce4c00b44e43a30b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 20 Sep 2020 23:05:02 -0500 Subject: [PATCH 09/14] add --permanent to readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1e6fe00401..829b93f99f 100644 --- a/README.md +++ b/README.md @@ -176,9 +176,8 @@ reissuing `emsdk install`. You can toggle between different tools and SDK versions by running `emsdk activate `. Activating a tool will set up `~/.emscripten` to -point to that particular tool. On Windows, you can pass the option `--global` to -the `activate` command to register the environment permanently to the system -registry for all users. +point to that particular tool. On Windows, you can pass the option `--permanent` to +the `activate` command to register the environment permanently for the current user. Use `--system` to do this for all users. ### How do I build multiple projects with different SDK versions in parallel? From 90c07a84a4120343760cb3340612a23fb6be82f3 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 25 Sep 2020 22:45:12 -0500 Subject: [PATCH 10/14] test: use repo root instead of cd https://github.com/emscripten-core/emsdk/pull/621#discussion_r491791770 --- scripts/test_permanent.ps1 | 107 +++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 59 deletions(-) diff --git a/scripts/test_permanent.ps1 b/scripts/test_permanent.ps1 index 051b2a1eaf..01ec1f12c1 100644 --- a/scripts/test_permanent.ps1 +++ b/scripts/test_permanent.ps1 @@ -1,67 +1,56 @@ -$cwd=(Get-Location).Path +$repo_root = [System.IO.Path]::GetDirectoryName((resolve-path "$PSScriptRoot")) -try { +& "$repo_root/emsdk.ps1" install latest +& "$repo_root/emsdk.ps1" activate latest --permanent - cd([System.IO.Path]::GetDirectoryName((resolve-path "$PSScriptRoot"))) +$EMSDK_USER = [System.Environment]::GetEnvironmentVariable("EMSDK", "User") +$EM_CONFIG_USER = [System.Environment]::GetEnvironmentVariable("EM_CONFIG", "User") +$EMSDK_NODE_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_NODE", "User") +$EMSDK_PYTHON_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_PYTHON", "User") +$JAVA_HOME_USER = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", "User") +$EM_CACHE_USER = [System.Environment]::GetEnvironmentVariable("EM_CACHE", "User") +$PATH_USER = [System.Environment]::GetEnvironmentVariable("PATH", "User") - ./emsdk.ps1 install latest - ./emsdk.ps1 activate latest --permanently - - $EMSDK_USER = [System.Environment]::GetEnvironmentVariable("EMSDK", "User") - $EM_CONFIG_USER = [System.Environment]::GetEnvironmentVariable("EM_CONFIG", "User") - $EMSDK_NODE_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_NODE", "User") - $EMSDK_PYTHON_USER = [System.Environment]::GetEnvironmentVariable("EMSDK_PYTHON", "User") - $JAVA_HOME_USER = [System.Environment]::GetEnvironmentVariable("JAVA_HOME", "User") - $EM_CACHE_USER = [System.Environment]::GetEnvironmentVariable("EM_CACHE", "User") - $PATH_USER = [System.Environment]::GetEnvironmentVariable("PATH", "User") - - if (!$EMSDK_USER) { - throw "EMSDK is not set for the user" - } - if (!$EM_CONFIG_USER) { - throw "EM_CONFIG_USER is not set for the user" - } - if (!$EMSDK_NODE_USER) { - throw "EMSDK_NODE is not set for the user" - } - if (!$JAVA_HOME_USER) { - throw "JAVA_HOME is not set for the user" - } - if (!$EMSDK_PYTHON_USER) { - throw "EMSDK_PYTHON is not set for the user" - } - if (!$EM_CACHE_USER) { - throw "EM_CACHE is not set for the user" - } - - - $path_split = $path.Split(';') +if (!$EMSDK_USER) { + throw "EMSDK is not set for the user" +} +if (!$EM_CONFIG_USER) { + throw "EM_CONFIG_USER is not set for the user" +} +if (!$EMSDK_NODE_USER) { + throw "EMSDK_NODE is not set for the user" +} +if (!$JAVA_HOME_USER) { + throw "JAVA_HOME is not set for the user" +} +if (!$EMSDK_PYTHON_USER) { + throw "EMSDK_PYTHON is not set for the user" +} +if (!$EM_CACHE_USER) { + throw "EM_CACHE is not set for the user" +} - $EMSDK_Path_USER = $path_split | Where-Object { $_ -match 'emsdk' } - if (!$EMSDK_Path_USER) { - throw "No path is added!" - } - $EMSDK_NODE_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\node' } - if (!$EMSDK_NODE_Path_USER) { - throw "emsdk\node is not added to path." - } - $EMSDK_PYTHON_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\python' } - if (!$EMSDK_PYTHON_Path_USER) { - throw "emsdk\python is not added to path." - } - $EMSDK_JAVA_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\java' } - if (!$EMSDK_JAVA_Path_USER) { - throw "emsdk\java is not added to path." - } - $EMSDK_UPSTREAM_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\upstream\\emscripten' } - if (!$EMSDK_UPSTREAM_Path_USER) { - throw "emsdk\upstream\emscripten is not added to path." - } +$path_split = $PATH_USER.Split(';') +$EMSDK_Path_USER = $path_split | Where-Object { $_ -match 'emsdk' } +if (!$EMSDK_Path_USER) { + throw "No path is added!" +} +$EMSDK_NODE_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\node' } +if (!$EMSDK_NODE_Path_USER) { + throw "emsdk\node is not added to path." } -finally -{ -# return back to cwd -cd $cwd +$EMSDK_PYTHON_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\python' } +if (!$EMSDK_PYTHON_Path_USER) { + throw "emsdk\python is not added to path." +} +$EMSDK_JAVA_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\java' } +if (!$EMSDK_JAVA_Path_USER) { + throw "emsdk\java is not added to path." +} + +$EMSDK_UPSTREAM_Path_USER = $path_split | Where-Object { $_ -match 'emsdk\\upstream\\emscripten' } +if (!$EMSDK_UPSTREAM_Path_USER) { + throw "emsdk\upstream\emscripten is not added to path." } From 2d7ccb2969831bb1edd70b0b41957d09e4341089 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 25 Sep 2020 22:44:41 -0500 Subject: [PATCH 11/14] ci: allow failure of the permanent test in CI --- .circleci/config.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a5e16f475..4a2b452584 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -91,7 +91,12 @@ jobs: name: --permanent test shell: powershell.exe command: | - scripts/test_permanent.ps1 + try { + scripts/test_permanent.ps1 + } catch { + Write-Host "`n Error Message: [$($_.Exception.Message)"] -ForegroundColor Red + Write-Host "`n Line Number: "$_.InvocationInfo.ScriptLineNumber -ForegroundColor Red + } build-docker-image: executor: bionic From 4dae9403b439c3ebea6184e99eeafc5880da5b6f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Sep 2020 22:09:03 -0500 Subject: [PATCH 12/14] Fix typos --- emsdk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emsdk.py b/emsdk.py index a90b67b078..3d9a2f351c 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2732,7 +2732,7 @@ def main(): - Activates the given tool or SDK in the environment of the current shell. - - If the `--permanent` option is passed, the the environment + - If the `--permanent` option is passed, then the environment variables are set permanently for the current user. - If the `--system` option is passed, the registration @@ -2974,7 +2974,7 @@ def print_tools(t): return 0 elif cmd == 'activate': if arg_permanent: - print('Registering active Emscripten environment premenantly') + print('Registering active Emscripten environment permanently') print('') tools_to_activate = currently_active_tools() From f34f705d4c1bd7d5f44c0670e2f518869c1c015b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Sep 2020 22:11:25 -0500 Subject: [PATCH 13/14] Mention admin access in the help for --system --- emsdk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emsdk.py b/emsdk.py index 3d9a2f351c..4a5f5b1dd1 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2736,7 +2736,8 @@ def main(): variables are set permanently for the current user. - If the `--system` option is passed, the registration - is done for all users of the system + is done for all users of the system. + This needs admin privileges (uses Machine environment variables). - If a custom compiler version was used to override From ad16e5da5cdf057291d861b1579310985cff347c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Sep 2020 23:38:41 -0500 Subject: [PATCH 14/14] set --system when --global used --- emsdk.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emsdk.py b/emsdk.py index 4a5f5b1dd1..5e38497d9e 100644 --- a/emsdk.py +++ b/emsdk.py @@ -2773,10 +2773,10 @@ def extract_bool_arg(name): arg_uses = extract_bool_arg('--uses') arg_permanent = extract_bool_arg('--permanent') arg_global = extract_bool_arg('--global') + arg_system = extract_bool_arg('--system') if arg_global: print('--global is deprecated. Use `--system` to set the environment variables for all users') - arg_permanent = True - arg_system = extract_bool_arg('--system') + arg_system = True if arg_system: arg_permanent = True if extract_bool_arg('--embedded'):