Skip to content

Commit b0aab83

Browse files
committed
sync
1 parent f604a15 commit b0aab83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+11824
-6464
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ jobs:
427427
- run: ruff check
428428
# TODO (cclauss): When ruff supports rule E303 without --preview, remove following line
429429
- run: ruff check --preview --select=E303
430+
- run: ruff format
430431
mypy:
431432
executor: focal
432433
steps:

.style.yapf

Lines changed: 0 additions & 3 deletions
This file was deleted.

bootstrap.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
on the timestamps of various input files (kind of like a dumb version
88
of a Makefile).
99
"""
10+
1011
import argparse
1112
import os
1213
import shutil
@@ -21,13 +22,16 @@
2122

2223
actions = [
2324
('npm packages', ['package.json'], [shutil.which('npm'), 'ci']),
24-
('create entry points', [
25-
'tools/maint/create_entry_points.py',
26-
'tools/maint/run_python.bat',
27-
'tools/maint/run_python.sh',
28-
'tools/maint/run_python.ps1',
29-
],
30-
[sys.executable, 'tools/maint/create_entry_points.py']),
25+
(
26+
'create entry points',
27+
[
28+
'tools/maint/create_entry_points.py',
29+
'tools/maint/run_python.bat',
30+
'tools/maint/run_python.sh',
31+
'tools/maint/run_python.ps1',
32+
],
33+
[sys.executable, 'tools/maint/create_entry_points.py'],
34+
),
3135
('git submodules', ['test/third_party/posixtestsuite/'], [shutil.which('git'), 'submodule', 'update', '--init']),
3236
]
3337

@@ -57,7 +61,9 @@ def main(args):
5761
parser = argparse.ArgumentParser(description=__doc__)
5862
parser.add_argument('-v', '--verbose', action='store_true', help='verbose', default=False)
5963
parser.add_argument('-n', '--dry-run', action='store_true', help='dry run', default=False)
60-
parser.add_argument('-i', '--install-post-checkout', action='store_true', help='install post checkout script', default=False)
64+
parser.add_argument(
65+
'-i', '--install-post-checkout', action='store_true', help='install post checkout script', default=False
66+
)
6167
args = parser.parse_args()
6268

6369
if args.install_post_checkout:

docs/process.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ pre-processor. See [`.clang-format`][clang-format] for more details.
5555
### Python Code
5656

5757
We generally follow the pep8 standard with the major exception that we use 2
58-
spaces for indentation. `ruff` is run on all PRs to ensure that Python code
59-
conforms to this style. See [`pyproject.toml`][pyproject.toml] for more details.
58+
spaces for indentation. `ruff check` and `ruff format` are run on all PRs to
59+
ensure that Python code conforms to this style. See
60+
[`pyproject.toml`][pyproject.toml] for more details.
6061

6162
#### Static Type Checking
6263

em-config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121

2222
def main():
23-
if len(sys.argv) != 2 or \
24-
not re.match(r"^[\w\W_][\w\W_\d]*$", sys.argv[1]) or \
25-
not hasattr(config, sys.argv[1]):
23+
if len(sys.argv) != 2 or not re.match(r"^[\w\W_][\w\W_\d]*$", sys.argv[1]) or not hasattr(config, sys.argv[1]):
2624
print('Usage: em-config VAR_NAME', file=sys.stderr)
2725
sys.exit(1)
2826

emar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# University of Illinois/NCSA Open Source License. Both these licenses can be
55
# found in the LICENSE file.
66

7-
"""Wrapper script around `llvm-ar`.
8-
"""
7+
"""Wrapper script around `llvm-ar`."""
98

109
import sys
1110
from tools import shared

embuilder.py

Lines changed: 112 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -30,96 +30,96 @@
3030

3131
# Minimal subset of targets used by CI systems to build enough to be useful
3232
MINIMAL_TASKS = [
33-
'libbulkmemory',
34-
'libcompiler_rt',
35-
'libcompiler_rt-wasm-sjlj',
36-
'libcompiler_rt-ww',
37-
'libc',
38-
'libc-debug',
39-
'libc-ww-debug',
40-
'libc_optz',
41-
'libc_optz-debug',
42-
'libc++abi',
43-
'libc++abi-except',
44-
'libc++abi-noexcept',
45-
'libc++abi-debug',
46-
'libc++abi-debug-except',
47-
'libc++abi-debug-noexcept',
48-
'libc++abi-debug-ww-noexcept',
49-
'libc++',
50-
'libc++-except',
51-
'libc++-noexcept',
52-
'libc++-ww-noexcept',
53-
'libal',
54-
'libdlmalloc',
55-
'libdlmalloc-tracing',
56-
'libdlmalloc-debug',
57-
'libdlmalloc-ww',
58-
'libembind',
59-
'libembind-rtti',
60-
'libemmalloc',
61-
'libemmalloc-debug',
62-
'libemmalloc-memvalidate',
63-
'libemmalloc-verbose',
64-
'libemmalloc-memvalidate-verbose',
65-
'libmimalloc',
66-
'libmimalloc-mt',
67-
'libGL',
68-
'libGL-getprocaddr',
69-
'libGL-emu-getprocaddr',
70-
'libGL-emu-webgl2-ofb-getprocaddr',
71-
'libGL-webgl2-ofb-getprocaddr',
72-
'libGL-ww-getprocaddr',
73-
'libhtml5',
74-
'libsockets',
75-
'libsockets-ww',
76-
'libstubs',
77-
'libstubs-debug',
78-
'libstandalonewasm-nocatch',
79-
'crt1',
80-
'crt1_proxy_main',
81-
'crtbegin',
82-
'libunwind-except',
83-
'libnoexit',
84-
'sqlite3',
85-
'sqlite3-mt',
86-
'libwebgpu',
87-
'libwebgpu_cpp',
33+
'libbulkmemory',
34+
'libcompiler_rt',
35+
'libcompiler_rt-wasm-sjlj',
36+
'libcompiler_rt-ww',
37+
'libc',
38+
'libc-debug',
39+
'libc-ww-debug',
40+
'libc_optz',
41+
'libc_optz-debug',
42+
'libc++abi',
43+
'libc++abi-except',
44+
'libc++abi-noexcept',
45+
'libc++abi-debug',
46+
'libc++abi-debug-except',
47+
'libc++abi-debug-noexcept',
48+
'libc++abi-debug-ww-noexcept',
49+
'libc++',
50+
'libc++-except',
51+
'libc++-noexcept',
52+
'libc++-ww-noexcept',
53+
'libal',
54+
'libdlmalloc',
55+
'libdlmalloc-tracing',
56+
'libdlmalloc-debug',
57+
'libdlmalloc-ww',
58+
'libembind',
59+
'libembind-rtti',
60+
'libemmalloc',
61+
'libemmalloc-debug',
62+
'libemmalloc-memvalidate',
63+
'libemmalloc-verbose',
64+
'libemmalloc-memvalidate-verbose',
65+
'libmimalloc',
66+
'libmimalloc-mt',
67+
'libGL',
68+
'libGL-getprocaddr',
69+
'libGL-emu-getprocaddr',
70+
'libGL-emu-webgl2-ofb-getprocaddr',
71+
'libGL-webgl2-ofb-getprocaddr',
72+
'libGL-ww-getprocaddr',
73+
'libhtml5',
74+
'libsockets',
75+
'libsockets-ww',
76+
'libstubs',
77+
'libstubs-debug',
78+
'libstandalonewasm-nocatch',
79+
'crt1',
80+
'crt1_proxy_main',
81+
'crtbegin',
82+
'libunwind-except',
83+
'libnoexit',
84+
'sqlite3',
85+
'sqlite3-mt',
86+
'libwebgpu',
87+
'libwebgpu_cpp',
8888
]
8989

9090
# Additional tasks on top of MINIMAL_TASKS that are necessary for PIC testing on
9191
# CI (which has slightly more tests than other modes that want to use MINIMAL)
9292
MINIMAL_PIC_TASKS = MINIMAL_TASKS + [
93-
'libcompiler_rt-mt',
94-
'libc-mt',
95-
'libc-mt-debug',
96-
'libc_optz-mt',
97-
'libc_optz-mt-debug',
98-
'libc++abi-mt',
99-
'libc++abi-mt-noexcept',
100-
'libc++abi-debug-mt',
101-
'libc++abi-debug-mt-noexcept',
102-
'libc++-mt',
103-
'libc++-mt-noexcept',
104-
'libdlmalloc-mt',
105-
'libGL-emu',
106-
'libGL-emu-webgl2-getprocaddr',
107-
'libGL-mt-getprocaddr',
108-
'libGL-mt-emu',
109-
'libGL-mt-emu-webgl2-getprocaddr',
110-
'libGL-mt-emu-webgl2-ofb-getprocaddr',
111-
'libsockets_proxy',
112-
'libsockets-mt',
113-
'crtbegin',
114-
'libsanitizer_common_rt',
115-
'libubsan_rt',
116-
'libwasm_workers-debug-stub',
117-
'libfetch',
118-
'libfetch-mt',
119-
'libwasmfs',
120-
'libwasmfs-debug',
121-
'libwasmfs_no_fs',
122-
'giflib',
93+
'libcompiler_rt-mt',
94+
'libc-mt',
95+
'libc-mt-debug',
96+
'libc_optz-mt',
97+
'libc_optz-mt-debug',
98+
'libc++abi-mt',
99+
'libc++abi-mt-noexcept',
100+
'libc++abi-debug-mt',
101+
'libc++abi-debug-mt-noexcept',
102+
'libc++-mt',
103+
'libc++-mt-noexcept',
104+
'libdlmalloc-mt',
105+
'libGL-emu',
106+
'libGL-emu-webgl2-getprocaddr',
107+
'libGL-mt-getprocaddr',
108+
'libGL-mt-emu',
109+
'libGL-mt-emu-webgl2-getprocaddr',
110+
'libGL-mt-emu-webgl2-ofb-getprocaddr',
111+
'libsockets_proxy',
112+
'libsockets-mt',
113+
'crtbegin',
114+
'libsanitizer_common_rt',
115+
'libubsan_rt',
116+
'libwasm_workers-debug-stub',
117+
'libfetch',
118+
'libfetch-mt',
119+
'libwasmfs',
120+
'libwasmfs-debug',
121+
'libwasmfs_no_fs',
122+
'giflib',
123123
]
124124

125125
PORTS = sorted(list(ports.ports_by_name.keys()) + list(ports.port_variants.keys()))
@@ -187,19 +187,17 @@ def handle_port_error(target, message):
187187
def main():
188188
all_build_start_time = time.time()
189189

190-
parser = argparse.ArgumentParser(description=__doc__,
191-
formatter_class=argparse.RawDescriptionHelpFormatter,
192-
epilog=get_help())
190+
parser = argparse.ArgumentParser(
191+
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, epilog=get_help()
192+
)
193193
parser.add_argument('--lto', action='store_const', const='full', help='build bitcode object for LTO')
194-
parser.add_argument('--lto=thin', dest='lto', action='store_const', const='thin', help='build bitcode object for ThinLTO')
195-
parser.add_argument('--pic', action='store_true',
196-
help='build relocatable objects for suitable for dynamic linking')
197-
parser.add_argument('--force', action='store_true',
198-
help='force rebuild of target (by removing it first)')
199-
parser.add_argument('--verbose', action='store_true',
200-
help='show build commands')
201-
parser.add_argument('--wasm64', action='store_true',
202-
help='use wasm64 architecture')
194+
parser.add_argument(
195+
'--lto=thin', dest='lto', action='store_const', const='thin', help='build bitcode object for ThinLTO'
196+
)
197+
parser.add_argument('--pic', action='store_true', help='build relocatable objects for suitable for dynamic linking')
198+
parser.add_argument('--force', action='store_true', help='force rebuild of target (by removing it first)')
199+
parser.add_argument('--verbose', action='store_true', help='show build commands')
200+
parser.add_argument('--wasm64', action='store_true', help='use wasm64 architecture')
203201
parser.add_argument('operation', choices=['build', 'clear', 'rebuild'])
204202
parser.add_argument('targets', nargs='*', help='see below')
205203
args = parser.parse_args()
@@ -240,7 +238,7 @@ def main():
240238

241239
# process tasks
242240
auto_tasks = False
243-
task_targets = dict.fromkeys(args.targets) # use dict to keep targets order
241+
task_targets = dict.fromkeys(args.targets) # use dict to keep targets order
244242

245243
# substitute
246244
predefined_tasks = {
@@ -315,14 +313,28 @@ def main():
315313
return 1
316314

317315
time_taken = time.time() - start_time
318-
logger.info('...success. Took %s(%.2fs)' % (('%02d:%02d mins ' % (time_taken // 60, time_taken % 60) if time_taken >= 60 else ''), time_taken))
316+
logger.info(
317+
'...success. Took %s(%.2fs)'
318+
% (('%02d:%02d mins ' % (time_taken // 60, time_taken % 60) if time_taken >= 60 else ''), time_taken)
319+
)
319320

320321
if USE_NINJA and args.operation != 'clear':
321322
system_libs.build_deferred()
322323

323324
if len(tasks) > 1 or USE_NINJA:
324325
all_build_time_taken = time.time() - all_build_start_time
325-
logger.info('Built %d targets in %s(%.2fs)' % (len(tasks), ('%02d:%02d mins ' % (all_build_time_taken // 60, all_build_time_taken % 60) if all_build_time_taken >= 60 else ''), all_build_time_taken))
326+
logger.info(
327+
'Built %d targets in %s(%.2fs)'
328+
% (
329+
len(tasks),
330+
(
331+
'%02d:%02d mins ' % (all_build_time_taken // 60, all_build_time_taken % 60)
332+
if all_build_time_taken >= 60
333+
else ''
334+
),
335+
all_build_time_taken,
336+
)
337+
)
326338

327339
return 0
328340

0 commit comments

Comments
 (0)