Skip to content

Fails to build: Missing include: stdbool.h #69

@es20490446e

Description

@es20490446e

As long as there is any CFLAGS set in the environment variables, running python -m build --wheel --no-isolation leads to:

* Getting build dependencies for wheel..                                                              
running egg_info
creating src/rtmixer.egg-info
writing src/rtmixer.egg-info/PKG-INFO
writing dependency_links to src/rtmixer.egg-info/dependency_links.txt
writing requirements to src/rtmixer.egg-info/requires.txt
writing top-level names to src/rtmixer.egg-info/top_level.txt
writing manifest file 'src/rtmixer.egg-info/SOURCES.txt'
reading manifest file 'src/rtmixer.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'portaudio/index.html'
adding license file 'LICENSE'
writing manifest file 'src/rtmixer.egg-info/SOURCES.txt'
* Building wheel..
running bdist_wheel
running build
running build_py
creating build/lib.linux-x86_64-cpython-314
copying src/rtmixer.py -> build/lib.linux-x86_64-cpython-314
running egg_info
writing src/rtmixer.egg-info/PKG-INFO
writing dependency_links to src/rtmixer.egg-info/dependency_links.txt
writing requirements to src/rtmixer.egg-info/requires.txt
writing top-level names to src/rtmixer.egg-info/top_level.txt
reading manifest file 'src/rtmixer.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'portaudio/index.html'
adding license file 'LICENSE'
writing manifest file 'src/rtmixer.egg-info/SOURCES.txt'
running build_ext
generating cffi module 'build/temp.linux-x86_64-cpython-314/_rtmixer.c'
creating build/temp.linux-x86_64-cpython-314
building '_rtmixer' extension
creating build/temp.linux-x86_64-cpython-314/build/temp.linux-x86_64-cpython-314
creating build/temp.linux-x86_64-cpython-314/portaudio/src/common
gcc -march=x86-64 -fPIC -Isrc -Iportaudio/include -I/usr/include/python3.14 -c build/temp.linux-x86_64-cpython-314/_rtmixer.c -o build/temp.linux-x86_64-cpython-314/build/temp.linux-x86_64-cpython-314/_rtmixer.o --std=c99
build/temp.linux-x86_64-cpython-314/_rtmixer.c: In function ‘get_relevant_time’:
build/temp.linux-x86_64-cpython-314/_rtmixer.c:615:13: error: ‘false’ undeclared (first use in this function)
  615 |   }} while (false)
      |             ^~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c:702:5: note: in expansion of macro ‘CALLBACK_ASSERT’
  702 |     CALLBACK_ASSERT(action->action);
      |     ^~~~~~~~~~~~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c:604:1: note: ‘false’ is defined in header ‘<stdbool.h>’; this is probably fixable by adding ‘#include <stdbool.h>’
  603 | #include "rtmixer.h"
  +++ |+#include <stdbool.h>
  604 | 
build/temp.linux-x86_64-cpython-314/_rtmixer.c:615:13: note: each undeclared identifier is reported only once for each function it appears in
  615 |   }} while (false)
      |             ^~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c:702:5: note: in expansion of macro ‘CALLBACK_ASSERT’
  702 |     CALLBACK_ASSERT(action->action);
      |     ^~~~~~~~~~~~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c: In function ‘callback’:
build/temp.linux-x86_64-cpython-314/_rtmixer.c:615:13: error: ‘false’ undeclared (first use in this function)
  615 |   }} while (false)
      |             ^~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c:724:3: note: in expansion of macro ‘CALLBACK_ASSERT’
  724 |   CALLBACK_ASSERT(state);
      |   ^~~~~~~~~~~~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c:615:13: note: ‘false’ is defined in header ‘<stdbool.h>’; this is probably fixable by adding ‘#include <stdbool.h>’
  615 |   }} while (false)
      |             ^~~~~
build/temp.linux-x86_64-cpython-314/_rtmixer.c:724:3: note: in expansion of macro ‘CALLBACK_ASSERT’
  724 |   CALLBACK_ASSERT(state);
      |   ^~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1

This work-around works:

sed "6a#include <stdbool.h>" --in-place "src/rtmixer.c"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions