<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - PGO bootstrap fails with python3: errors in perf-helper.py"
href="https://bugs.llvm.org/show_bug.cgi?id=39548">39548</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>PGO bootstrap fails with python3: errors in perf-helper.py
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Tooling
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>romain.geissler@amadeus.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Hi,
Current clang fail to bootstrap in PGO mode when only python3 is available,
because perf-helper.py is not compatible with python 3. We can see two errors:
File
"/workdir/src/llvm-7.0.0.src/tools/clang/utils/perf-training/perf-helper.py",
line 299
by_count.sort(key = lambda (_,n): -n)
^
SyntaxError: invalid syntax
which can be fixed by removing the parameter parenthesis.
And
$ "/usr/bin/python3.6"
"/workdir/src/llvm-7.0.0.src/tools/clang/utils/perf-training/perf-helper.py"
"cc1"
"/workdir/build/final-system/llvm-build/tools/clang/stage2-instrumented-bins/bin/clang"
"-Wall" "-pedantic" "-c"
"/home/jenkins/workspace/OTF_Toolchain_release_2.0-HLXHYRKCVDYQJLF23VGZ3MVAU6VGURX537LUE3KFVM2SSPMZ6IOA/output/src/llvm-7.0.0.src/tools/clang/utils/perf-training/cxx/hello_world.cpp"
# command stderr:
Traceback (most recent call last):
File
"/workdir/src/llvm-7.0.0.src/tools/clang/utils/perf-training/perf-helper.py",
line 408, in <module>
main()
File
"/workdir/src/llvm-7.0.0.src/tools/clang/utils/perf-training/perf-helper.py",
line 405, in main
sys.exit(f(sys.argv[2:]))
File
"/workdir/src/llvm-7.0.0.src/tools/clang/utils/perf-training/perf-helper.py",
line 159, in cc1
cc1_cmd = get_cc1_command_for_args(cmd, cc1_env)
File
"/workdir/src/llvm-7.0.0.src/tools/clang/utils/perf-training/perf-helper.py",
line 119, in get_cc1_command_for_args
for ln in cc_output.split('\n'):
TypeError: a bytes-like object is required, not 'str'
error: command failed with exit status: 1
which can be made both 2 and 3 compatible by using the attribute
universal_newlines=True
Will submit a patch for review.
Cheers,
Romain</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>