Repository navigation
Failing configure tests due to missing space #120671
Copy link
Copy link
Closed
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When building CPython from source, I noticed some suspicious errors that seem to be related to a missing spaces in the configure script. It seems that most uses of as_fn_append correctly include a leading space before appending to a variable, however, there are several cases where this space has not been added which can lead to two arguments being concatenated:
- https://github.com/python/cpython/blob/main/configure#L9617
- https://github.com/python/cpython/blob/main/configure#L9735
- https://github.com/python/cpython/blob/main/configure#L9780
- https://github.com/python/cpython/blob/main/configure#L9821
- https://github.com/python/cpython/blob/main/configure#L9862
- https://github.com/python/cpython/blob/main/configure#L9903
- https://github.com/python/cpython/blob/main/configure#L9944
- https://github.com/python/cpython/blob/main/configure#L9996
When compiling to Emscripten in Bazel, for example, I end up with -sRELOCATABLE=1-Wstrict-prototypes in one of my tests:
configure:9880: checking if we can enable /home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/29/execroot/_main/external/emsdk/emscripten_toolchain/emcc.sh strict-prototypes warning
configure:9900: /home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/29/execroot/_main/external/emsdk/emscripten_toolchain/emcc.sh -c --sysroot=/home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/29/execroot/_main/external/emscripten_bin_linux/emscripten/cache/sysroot -fdiagnostics-color -fno-strict-aliasing -funsigned-char -no-canonical-prefixes -Wall -iwithsysroot/include/c++/v1 -iwithsysroot/include/compat -iwithsysroot/include -isystem /home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/29/execroot/_main/external/emscripten_bin_linux/lib/clang/19/include -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -O2 -g0 -fwasm-exceptions -pthread -sRELOCATABLE=1-Wstrict-prototypes -Werror -I/home/developer/.cache/bazel/_bazel_developer/25e07d78077dfe1eca932359d50e41ef/sandbox/processwrapper-sandbox/29/execroot/_main/bazel-out/k8-fastbuild/bin/python/libpython.ext_build_deps/libffi/include conftest.c >&5
emcc: error: setting `RELOCATABLE` expects `bool` but got `str`
CPython versions tested on:
3.12
Operating systems tested on:
Other
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
allsey87 commentedon Jun 18, 2024
Actually this issue is all caused by a single space missing in the configure.ac file. I propose the following:
zware commentedon Jun 18, 2024
Would you like to submit a pull request to that effect?
allsey87 commentedon Jun 18, 2024
Will do!
eli-schwartz commentedon Jun 19, 2024
In commit 76d14fa (GH-29485), some code was refactored to be more compact and use more advanced autoconf tricks. In the process, it switched
to
This was a functional logic break, since it elided the space in between the existing and appended values -- and that space is mandatory for command-line flags stuffed into a variable.
The same problem occurred for LDFLAGS, but was silently fixed as a side effect of commit bb8b931 (GH-32229).
allsey87 commentedon Jun 19, 2024
@eli-schwartz should there also be a space at configure.ac#L7548?
gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (#120822)
pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (pythonGH-…
pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (pythonGH-…
vstinner commentedon Jun 25, 2024
I think that this line is fine since added line ends with a newline.
vstinner commentedon Jun 25, 2024
Fixed by 2106c9b. Thanks @allsey87!
[3.12] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)…
[3.13] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)…
pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (python#12…
pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (python#12…
pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (python#12…