conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
949 stars 1.73k forks source link

pulseaudio: Workaround if clang 15 #24468

Closed franramirez688 closed 3 months ago

franramirez688 commented 3 months ago

Summary

Changes to recipe: pulseaudio/[<=14.2] Closes: https://github.com/conan-io/conan-center-index/issues/24464

Motivation

Configure step fails with:

checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking host operating system... linux
checking whether C compiler accepts -std=gnu11... no
configure: error: *** Compiler does not support -std=gnu11

Applying this workaround:

....

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Debug
compiler=clang
compiler.cppstd=gnu11
compiler.libcxx=libstdc++11
compiler.version=15
os=Linux
[conf]
tools.build:compiler_executables={'c': 'clang-15', 'cpp': 'clang++-15'}

....

checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for shared library run path origin... done
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for GNU gettext in libc... yes
checking whether to use NLS... yes
checking where the gettext function comes from... libc
checking host operating system... linux
checking whether C compiler accepts -std=gnu11... (cached) yes

....

pulseaudio/14.2 (test package): Running CMake.build()
pulseaudio/14.2 (test package): RUN: cmake --build "/home/develop/conan-center-index/recipes/pulseaudio/all/test_package/build/clang-15-x86_64-gnu11-debug" -- -j2
gmake: Warning: File 'Makefile' has modification time 0.95 s in the future
gmake[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.87 s in the future
gmake[2]: Warning: File 'CMakeFiles/test_package.dir/flags.make' has modification time 0.84 s in the future
gmake[2]: warning:  Clock skew detected.  Your build may be incomplete.
gmake[2]: Warning: File 'CMakeFiles/test_package.dir/flags.make' has modification time 0.79 s in the future
[ 50%] Building C object CMakeFiles/test_package.dir/test_package.c.o
[100%] Linking C executable test_package
gmake[2]: warning:  Clock skew detected.  Your build may be incomplete.
[100%] Built target test_package
gmake[1]: warning:  Clock skew detected.  Your build may be incomplete.
gmake: warning:  Clock skew detected.  Your build may be incomplete.

======== Testing the package: Executing test ========
pulseaudio/14.2 (test package): Running test()
pulseaudio/14.2 (test package): RUN: ./test_package
pulse audio verions 14.2.0

Details

Higher versions does not use Autotools and it does not fail

franramirez688 commented 3 months ago

To clarify it a bit more. This workaround is bypassing this piece of code within the pulseaudio/configure script:

# ...

if ac_fn_c_try_compile "$LINENO"; then :
  ax_cv_check_cflags__pedantic__Werror__std_gnu11=yes
else
  ax_cv_check_cflags__pedantic__Werror__std_gnu11=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__pedantic__Werror__std_gnu11" >&5
$as_echo "$ax_cv_check_cflags__pedantic__Werror__std_gnu11" >&6; }
if test "x$ax_cv_check_cflags__pedantic__Werror__std_gnu11" = x"yes"; then :
  :
else
  as_fn_error $? "*** Compiler does not support -std=gnu11" "$LINENO" 5
fi
# ...
conan-center-bot commented 3 months ago

Conan v1 pipeline :heavy_check_mark:

All green in build 1 (f0db3280e701118beb02b7212586447ecb13b14c):


Conan v2 pipeline :heavy_check_mark:

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 1 (f0db3280e701118beb02b7212586447ecb13b14c):

AyoubCoding21 commented 3 months ago

and clang 16 ?

AyoubCoding21 commented 3 months ago

Wow, It works. Thanks.