diff --git a/test/test_other.py b/test/test_other.py index 2f80f1963a2c4..8e31fb1cf0f21 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15088,7 +15088,7 @@ def test_parsetools_make_removed_fs_assert(self): @requires_git_checkout def test_install(self): self.run_process([PYTHON, path_from_root('tools/install.py'), 'newdir'], env=shared.env_with_node_in_path()) - self.assertExists('newdir/emcc') + self.assertExists(utils.bat_suffix('newdir/emcc')) # Some files, such as as maintenance tools should not be part of the # install. self.assertNotExists('newdir/tools/maint/') diff --git a/tools/install.py b/tools/install.py index fccfab238eec2..34e257e1d6d9e 100755 --- a/tools/install.py +++ b/tools/install.py @@ -17,6 +17,8 @@ import subprocess import sys +WINDOWS = sys.platform.startswith('win') + EXCLUDES = [os.path.normpath(x) for x in ''' test/third_party tools/maint @@ -25,12 +27,22 @@ node_modules Makefile .git +.circleci +.github +.mypy_cache +.ruff_cache cache cache.lock out bootstrap.py '''.split()] +LAUNCHER_BAT_SCRIPTS = ''' +emcc.bat +em++.bat +bootstrap.bat +'''.split() + EXCLUDE_PATTERNS = ''' *.pyc .* @@ -50,6 +62,15 @@ def add_revision_file(target): def copy_emscripten(target): script_dir = os.path.dirname(os.path.abspath(__file__)) emscripten_root = os.path.dirname(script_dir) + + excludes = EXCLUDES + # We have a few launcher scripts that are checked into git still. + # Exclude the ones not designed for the current platforms. + if WINDOWS: + excludes += [os.path.splitext(l)[0] for l in LAUNCHER_BAT_SCRIPTS] + else: + excludes += LAUNCHER_BAT_SCRIPTS + os.chdir(emscripten_root) for root, dirs, files in os.walk('.'): # Handle the case where the target directory is underneath emscripten_root @@ -78,7 +99,7 @@ def copy_emscripten(target): logger.debug('skipping file: ' + os.path.join(root, f)) continue full = os.path.normpath(os.path.join(root, f)) - if full in EXCLUDES: + if full in excludes: logger.debug('skipping file: ' + os.path.join(root, f)) continue logger.debug('installing file: ' + os.path.join(root, f))