Skip to content

Commit 71ee39f

Browse files
authored
Remove EMSCRIPTEN_ROOT from config file (#18279)
I tried to do this once before back in #7254 and then that got temporarily revert in #7411. The specific issue with godot was addressed in 7998745237bee472ec7d899424a0f4357dfbf9c0 Folks who want to find out where emscripten is still have two different choices that don't involve parsing the config file by hand: 1. `which emcc` 2. `em-config EMSCRIPTEN_ROOT`
1 parent 6a93f7d commit 71ee39f

File tree

5 files changed

+7
-20
lines changed

5 files changed

+7
-20
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ See docs/process.md for more on how version tagging works.
2121
3.1.28 (in development)
2222
-----------------------
2323
- musl libc updated from v1.2.2 to v1.2.3. (#18270)
24+
- The default emscripten config file no longer contains `EMSCRIPTEN_ROOT`. This
25+
setting has long been completely ignored by emscripten itself. For
26+
applications that wish to know where emscripten is installed looking for
27+
`emcc` in the `PATH` has long been the recommended method (i.e. `which emcc`).
28+
(#18279)
2429

2530
3.1.27 - 11/29/22
2631
-----------------

test/test_other.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,6 @@ def test_emcc_generate_config(self):
234234
self.run_process([compiler, '--generate-config'])
235235
self.assertExists(config_path)
236236
config_contents = read_file(config_path)
237-
self.assertContained('EMSCRIPTEN_ROOT', config_contents)
238237
self.assertContained('LLVM_ROOT', config_contents)
239238
os.remove(config_path)
240239

test/test_sanity.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def make_new_executable(name):
208208
self.assertNotContained('}}}', config_data)
209209
self.assertContained('{{{', template_data)
210210
self.assertContained('}}}', template_data)
211-
for content in ['EMSCRIPTEN_ROOT', 'LLVM_ROOT', 'NODE_JS', 'JS_ENGINES']:
211+
for content in ['LLVM_ROOT', 'NODE_JS', 'JS_ENGINES']:
212212
self.assertContained(content, config_data)
213213

214214
# The guessed config should be ok
@@ -269,17 +269,6 @@ def test_llvm(self):
269269
output = self.check_working(EMCC)
270270
self.assertNotContained(LLVM_WARNING, output)
271271

272-
def test_emscripten_root(self):
273-
# The correct path
274-
restore_and_set_up()
275-
add_to_config("EMSCRIPTEN_ROOT = '%s'" % path_from_root())
276-
self.check_working(EMCC)
277-
278-
# The correct path with extra stuff
279-
restore_and_set_up()
280-
add_to_config("EMSCRIPTEN_ROOT = '%s'" % (path_from_root() + os.path.sep))
281-
self.check_working(EMCC)
282-
283272
def test_node(self):
284273
NODE_WARNING = 'node version appears too old'
285274
NODE_WARNING_2 = 'cannot check node version'

tools/config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def generate_config(path):
176176
config_data = config_data.splitlines()[3:] # remove the initial comment
177177
config_data = '\n'.join(config_data)
178178
# autodetect some default paths
179-
config_data = config_data.replace('\'{{{ EMSCRIPTEN_ROOT }}}\'', repr(__rootpath__))
180179
llvm_root = os.path.dirname(which('llvm-dis') or '/usr/bin/llvm-dis')
181180
config_data = config_data.replace('\'{{{ LLVM_ROOT }}}\'', repr(llvm_root))
182181

@@ -199,10 +198,9 @@ def generate_config(path):
199198
LLVM_ROOT = %s
200199
BINARYEN_ROOT = %s
201200
NODE_JS = %s
202-
EMSCRIPTEN_ROOT = %s
203201
204202
Please edit the file if any of those are incorrect.\
205-
''' % (path, llvm_root, binaryen_root, node, __rootpath__), file=sys.stderr)
203+
''' % (path, llvm_root, binaryen_root, node), file=sys.stderr)
206204

207205

208206
# Emscripten configuration is done through the --em-config command line option

tools/config_template.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
# is not valid, but LLVM='c:\\llvm\\' and LLVM='c:/llvm/'
1313
# are.
1414

15-
# This is used by external projects in order to find emscripten. It is not used
16-
# by emscripten itself.
17-
EMSCRIPTEN_ROOT = '{{{ EMSCRIPTEN_ROOT }}}' # directory
18-
1915
LLVM_ROOT = '{{{ LLVM_ROOT }}}' # directory
2016
BINARYEN_ROOT = '{{{ BINARYEN_ROOT }}}' # directory
2117

0 commit comments

Comments
 (0)