-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--skip-npm flag to Skip putting emsdk's npm on PATH #1141
base: main
Are you sure you want to change the base?
Changes from 3 commits
156dccb
9cc8ed7
787da0b
e6d333b
bac1329
65bc87d
7d76e9e
0d1238e
f999f4d
f3bc9f2
346e233
c299f67
c25efd6
5991457
8c09461
ba3a3c8
3009923
0a03e63
22f2521
f90d188
72bca9f
c98ba98
7c66ba7
31c28db
09992a5
7a71a71
ee175ad
adc2846
6b248a3
97ffba1
acd8abd
1507c59
1f284ad
1cadcc8
1147c9d
1355cd7
19c2dd7
7500b15
bda6e3d
b5fb454
d59bea6
41a6db6
e2f87da
fcbbb5c
d094326
5690fde
6fb20c4
6dbcaff
ab10d25
dbaed53
2933da6
42b482c
a971fe4
a2ca455
c3870d4
8c1d600
a760086
b25d87e
c5e02fa
d27c69b
d021b3d
dd94117
b3b0121
16d3178
0b10952
f9f0ba3
1285434
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,8 @@ | |
from urllib2 import urlopen | ||
|
||
|
||
skip_npm = False | ||
|
||
emsdk_packages_url = 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/' | ||
|
||
emscripten_releases_repo = 'https://chromium.googlesource.com/emscripten-releases' | ||
|
@@ -1398,6 +1400,9 @@ def find_latest_installed_tool(name): | |
|
||
# npm install in Emscripten root directory | ||
def emscripten_npm_install(tool, directory): | ||
global skip_npm | ||
if skip_npm: | ||
return True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the goal is just to avoid putting the emscripten version of not in the path, you don't need to return early here. You will want to run |
||
node_tool = find_latest_installed_tool('node') | ||
if not node_tool: | ||
npm_fallback = which('npm') | ||
|
@@ -1870,10 +1875,14 @@ def update_installed_version(self): | |
return None | ||
|
||
def is_installed(self, skip_version_check=False): | ||
global skip_npm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to |
||
# If this tool/sdk depends on other tools, require that all dependencies are | ||
# installed for this tool to count as being installed. | ||
if hasattr(self, 'uses'): | ||
for tool_name in self.uses: | ||
if skip_npm: | ||
if tool_name.startswith('node') or tool_name.startswith('npm'): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to the second part of this condition. How about just |
||
continue | ||
tool = find_tool(tool_name) | ||
if tool is None: | ||
errlog("Manifest error: No tool by name '" + tool_name + "' found! This may indicate an internal SDK error!") | ||
|
@@ -2521,6 +2530,9 @@ def process_tool_list(tools_to_activate): | |
tools_to_activate = tools_to_activate[:i] + deps + tools_to_activate[i:] | ||
i += len(deps) + 1 | ||
|
||
if skip_npm: | ||
tools_to_activate = [t for t in tools_to_activate if (not t.name.startswith("node-"))] | ||
|
||
for tool in tools_to_activate: | ||
if not tool.is_installed(): | ||
exit_with_error("error: tool is not installed and therefore cannot be activated: '%s'" % tool) | ||
|
@@ -2987,7 +2999,9 @@ def extract_string_arg(name): | |
value = args[i + 1] | ||
del args[i:i + 2] | ||
return value | ||
|
||
global skip_npm | ||
skip_npm = extract_bool_arg('--skip-npm') | ||
sbc100 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# errlog("--skip-npm found") | ||
arg_old = extract_bool_arg('--old') | ||
arg_uses = extract_bool_arg('--uses') | ||
arg_permanent = extract_bool_arg('--permanent') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to
global
here (its only needed if you want to update a global).