cparser.py:_preprocess() wrongly strips // in #line paths
We've hit this as a build failure for python-zstandard with compiler finding fix applied. See also: https://bugs.gentoo.org/723476.
If gcc preprocessor is run with -g
, it outputs the following additional #line
statement (marked with ->
):
# 1 "/tmp/tmpxbwuq2vh.h"
-> # 1 "/tmp/python-zstandard//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
It seems that the _preprocess()
function comment stripping regex wrongly matches that //
as a comment. As a result, csource
after substitution becomes:
# 1 "/tmp/tmpxbwuq2vh.h"
-> # 1 "/tmp/python-zstandard
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
This in turn causes cpyparser to bail on invalid #line
syntax.