Skip to content

Commit 996aa63

Browse files
committed
.
1 parent 3c8a629 commit 996aa63

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

bootstrap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
], ['git', 'submodule', 'update', '--init']),
4242
('pip install', [
4343
'requirements-dev.txt',
44-
], [sys.executable, '-m', 'pip', 'install', '--root', 'out/python_deps', '-r', 'requirements-dev.txt']),
44+
], [sys.executable, '-m', 'pip', 'install', '--target', 'out/python_deps', '-r', 'requirements-dev.txt']),
4545
]
4646

4747

@@ -88,8 +88,8 @@ def main(args):
8888
return 0
8989

9090
env = os.environ.copy()
91-
env['PATH'] += os.pathsep + utils.path_from_root('out/python_deps')
92-
env['PYTHONPATH'] = utils.path_from_root('out/python_deps')
91+
env['PATH'] += os.pathsep + utils.path_from_root('out/python_deps/bin')
92+
env['PYTHONPATH'] = 'out/python_deps'
9393

9494
for name, deps, cmd in actions:
9595
if check_deps(name, deps):

emcc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@
5757
import bootstrap
5858
bootstrap.check()
5959

60+
61+
def check_python_path():
62+
# When testing emscripten we install test-only python dependecies in `out/python_deps`.
63+
# However, these should never become dependnecies of emscripten itself, so we assert here
64+
# that we cannot use them, to keep honest
65+
root = os.path.normpath(utils.path_from_root())
66+
for p in sys.path:
67+
p = os.path.normpath(p)
68+
assert 'python_deps' not in p
69+
if p != root and p != os.path.join(root, 'third_party'):
70+
assert not p.startswith(root), f'unexpected element in python path: {p}'
71+
72+
73+
check_python_path()
74+
6075
PREPROCESSED_EXTENSIONS = {'.i', '.ii'}
6176
ASSEMBLY_EXTENSIONS = {'.s'}
6277
HEADER_EXTENSIONS = {'.h', '.hxx', '.hpp', '.hh', '.H', '.HXX', '.HPP', '.HH'}

0 commit comments

Comments
 (0)