Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
Expand Down
23 changes: 22 additions & 1 deletion tools/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
.*
Expand All @@ -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
Expand Down Expand Up @@ -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))
Expand Down