Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
58 lines (50 loc) · 2 KB

File metadata and controls

executable file
·
58 lines (50 loc) · 2 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/python3
import os
import shlex
import shutil
import subprocess
import sys
from pathlib import Path
profiles_folder = Path(os.environ['SCRIPT_INPUT_FILE_0'])
empty_profdata = Path(os.environ['SCRIPT_INPUT_FILE_1'])
output_folder = Path('{BUILT_PRODUCTS_DIR}/DerivedSources/{PROJECT_NAME}/Profiling'.format_map(os.environ))
depfile_path = Path('{DERIVED_FILES_DIR}/copy-profiling-data.d'.format_map(os.environ))
# Some 26.x versions of Xcode do not expose ARCHS_BASE, but can safely fall
# back to ARCHS.
archs = os.environ.get('ARCHS_BASE', os.environ['ARCHS'])
project_name = os.environ['PROJECT_NAME']
def checked_decompress(src, dst):
if src.stat().st_size < 1024:
if os.environ['CONFIGURATION'] == 'Production':
raise SystemExit(
f'error: {src} is <1KB, is it a Git LFS stub? '
'Ensure this file was checked out on a machine with git-lfs installed.'
)
else:
print(
f'warning: {src} is <1KB, is it a Git LFS stub? '
'To build with production optimizations, ensure this file was '
'checked out on a machine with git-lfs installed. Falling '
'back to stub profile data.',
file=sys.stderr
)
shutil.copy(src, dst)
else:
subprocess.check_call(
('compression_tool', '-v', '-decode', '-i', src, '-o', dst)
)
inputs = []
# Fall back to the Xcode-provided setting name for configurations where we do
# not pass the -fprofile-instr-use flag directly.
if os.environ.get('WK_ENABLE_PGO_USE',
os.environ.get('CLANG_USE_OPTIMIZATION_PROFILE')) == 'YES':
for arch in archs.split():
src = profiles_folder / f'{arch}/{project_name}.profdata.compressed'
dst = output_folder / f'{arch}.profdata'
checked_decompress(src, dst)
inputs.append(src)
depfile_path.write_text(
'dependencies: ' + '\\\n '.join(
shlex.quote(str(path)) for path in inputs
)
)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.