GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Failing configure tests due to missing space · Issue #120671 · python/cpython

Failing configure tests due to missing space #120671

New issue
Copy link
New issue
Copy link
Closed
#120822
Closed
Failing configure tests due to missing space#120671
#120822
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@allsey87
allsey87
opened on Jun 18, 2024
Issue body actions

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

  • gh-120671: Fix as_fn_append CFLAGS #120822
  • [3.13] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822) #120985
  • [3.12] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822) #120986
Reacted by Erlend E. Aasland

Activity

  1. allsey87
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 18, 2024
  2. allsey87 commented on Jun 18, 2024

    @allsey87
    allsey87
    on Jun 18, 2024
    ContributorAuthor
    More actions

    Actually this issue is all caused by a single space missing in the configure.ac file. I propose the following:

    diff --git a/configure b/configure
    index 99dd1fe595..3f043be4f2 100755
    --- a/configure
    +++ b/configure
    @@ -9506,7 +9506,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wextra -Werror"
    +    as_fn_append CFLAGS " -Wextra -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9624,7 +9624,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wunused-result -Werror"
    +    as_fn_append CFLAGS " -Wunused-result -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9669,7 +9669,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wunused-parameter -Werror"
    +    as_fn_append CFLAGS " -Wunused-parameter -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9710,7 +9710,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wint-conversion -Werror"
    +    as_fn_append CFLAGS " -Wint-conversion -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9751,7 +9751,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wmissing-field-initializers -Werror"
    +    as_fn_append CFLAGS " -Wmissing-field-initializers -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9792,7 +9792,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wsign-compare -Werror"
    +    as_fn_append CFLAGS " -Wsign-compare -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9833,7 +9833,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wunreachable-code -Werror"
    +    as_fn_append CFLAGS " -Wunreachable-code -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    @@ -9885,7 +9885,7 @@ then :
     else $as_nop
     
         py_cflags=$CFLAGS
    -    as_fn_append CFLAGS "-Wstrict-prototypes -Werror"
    +    as_fn_append CFLAGS " -Wstrict-prototypes -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
     /* end confdefs.h.  */
     
    diff --git a/configure.ac b/configure.ac
    index bd2be94b47..61255c2acd 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -2363,7 +2363,7 @@ AC_DEFUN([PY_CHECK_CC_WARNING], [
       AS_VAR_PUSHDEF([py_var], [ac_cv_$1_]m4_normalize($2)[_warning])
       AC_CACHE_CHECK([m4_ifblank([$3], [if we can $1 $CC $2 warning], [$3])], [py_var], [
         AS_VAR_COPY([py_cflags], [CFLAGS])
    -    AS_VAR_APPEND([CFLAGS], ["-W$2 -Werror"])
    +    AS_VAR_APPEND([CFLAGS], [" -W$2 -Werror"])
         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
                           [AS_VAR_SET([py_var], [yes])],
                           [AS_VAR_SET([py_var], [no])])
  3. zware commented on Jun 18, 2024

    @zware
    zware
    on Jun 18, 2024
    Member
    More actions

    Would you like to submit a pull request to that effect?

  4. allsey87 commented on Jun 18, 2024

    @allsey87
    allsey87
    on Jun 18, 2024
    ContributorAuthor
    More actions

    Will do!

    Reacted by Zachary Ware and Erlend E. Aasland
    Reacted by Zachary Ware and Erlend E. Aasland
  5. eli-schwartz commented on Jun 19, 2024

    @eli-schwartz
    eli-schwartz
    on Jun 19, 2024
    Contributor
    More actions

    In commit 76d14fa (GH-29485), some code was refactored to be more compact and use more advanced autoconf tricks. In the process, it switched

    AS_VAR_SET([XXX], ["$XXX other values"])
    

    to

    AS_VAR_APPEND([XXX], ["other values"])
    

    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).

    Reacted by Erlend E. Aasland
  6. allsey87 commented on Jun 19, 2024

    @allsey87
    allsey87
    on Jun 19, 2024
    ContributorAuthor
    More actions

    @eli-schwartz should there also be a space at configure.ac#L7548?

  7. vstinner
    added a commit that references this issue on Jun 25, 2024

    gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (#120822)

    2106c9b
  8. vstinner
    closed this as completedin #120822on Jun 25, 2024
  9. miss-islington
    added 2 commits that reference this issue on Jun 25, 2024

    pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (pythonGH-…

    fe2912e

    pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (pythonGH-…

    42bec11
  10. vstinner commented on Jun 25, 2024

    @vstinner
    vstinner
    on Jun 25, 2024
    Member
    More actions

    @eli-schwartz should there also be a space at configure.ac#L7548?

    I think that this line is fine since added line ends with a newline.

  11. vstinner commented on Jun 25, 2024

    @vstinner
    vstinner
    on Jun 25, 2024
    Member
    More actions

    Fixed by 2106c9b. Thanks @allsey87!

    Reacted by Michael Allwright
  12. vstinner
    added 2 commits that reference this issue on Jun 25, 2024

    [3.12] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)…

    433a5f8

    [3.13] gh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (GH-120822)…

    d26ce50
  13. mrahtz
    added a commit that references this issue on Jun 30, 2024

    pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (python#12…

    02eccfc
  14. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-120671: Fix PY_CHECK_CC_WARNING() in configure.ac (python#12…

    c49e6d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.