conan-center-index icon indicating copy to clipboard operation
conan-center-index copied to clipboard

[request] gettext/0.22 to fix macOS build

Open stevenwdv opened this issue 11 months ago • 5 comments

Package Name/Version

gettext/0.22

Changelog

https://savannah.gnu.org/news/?group_id=425

Context about the new update

gettext is still at 0.21. This means qt fails to build on some macOS versions, because harfbuzz apparently uses it: https://github.com/conan-io/conan-center-index/blob/556ff2cbee7c7044d94471048f431eb1125ffeb9/recipes/harfbuzz/all/conanfile.py#L108-L111

I tried with:

Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.4.0

And got the error:

/Users/xxx/.conan2/p/b/gette57bdbf186b3cd/b/src/libtextstyle/lib/obstack.c:351:31: error: incompatible function pointer types initializing 'void (*)(void) __attribute__((noreturn))' with an expression of type 'void (void)' [-Wincompatible-function-pointer-types]
__attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
                              ^

This is fixed in gnulib commit 0cc3971, which is included in https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.tar.gz . Note that 0.22.5 is also out, so maybe we should update to that: https://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.gz

Note that it seems #18005 and #19055 already tried to update gettext, but both were closed.

Also note that libgettext is already at 0.22.

stevenwdv avatar Mar 08 '24 11:03 stevenwdv

Hi @stevenwdv - thanks for reporting this. I'll work on getting to the bottom of why 0.22 couldn't be built.

In the meantime, I'm a bit confused:

  • what are the current issues with gettext being 0.21 - that is, what fails?
  • the error that you are getting, is when building Qt from source? which version of Qt, on what version of macOS?

I'm trying to understand what, beyond providing the new version, is the actual root cause - and why we haven't seen this yet?

jcar87 avatar Mar 08 '24 14:03 jcar87

@jcar87

what are the current issues with gettext being 0.21 - that is, what fails?

The problem is that https://ftp.gnu.org/pub/gnu/gettext/gettext-0.21.tar.gz includes obstack.c, e.g. at libtextstyle/lib/obstack.c, which seems to be part of gnulib/glib. Somewhere in the code, a _Noreturn void(*)(void) is being assigned to a __attribute__((noreturn)) void(*)(void), which is not possible: this used to be a compiler warning, but now is an error. See also e.g. https://code.videolan.org/videolan/vlc/-/merge_requests/2399. They should not have used the _Noreturn variant, but I guess it slipped in somehow. This is fixed in the gnulib commit I linked, which is incorporated into gettext 0.22.

the error that you are getting, is when building Qt from source? which version of Qt, on what version of macOS?

Yes. When compiling Qt 6.6.2 on macOS 14.4. EDIT: However, it seems to only occur on a x86 machine and not on ARM?

stevenwdv avatar Mar 08 '24 15:03 stevenwdv

Setting qt/*:with_harfbuzz=False works as a workaround, but I'm not sure what the implications of that are.

stevenwdv avatar Mar 08 '24 15:03 stevenwdv

I see, thanks @stevenwdv. Is the issue then building gettext 0.21 from source? Presumably the error is seen when building qt due to --build=missing, but it's actually gettext and a newer version of appleclang?

jcar87 avatar Mar 08 '24 17:03 jcar87

@jcar87 Yes, although the OS and apple-clang version of the failing x86 (I mean x86-64) build are the same as that of the successful ARM64 build, so I'm not 100% sure of the cause. Although, maybe gettext is not actually built on the ARM64 host... I'll check next week.

stevenwdv avatar Mar 08 '24 19:03 stevenwdv

Although, maybe gettext is not actually built on the ARM64 host... I'll check next week.

This was the case, so the issue is not dependent on the architecture. Probably the problem is the newer apple-clang version.

stevenwdv avatar Mar 11 '24 08:03 stevenwdv

Hi @stevenwdv - thanks so much.

Was able to reproduce the issue with AppleClang 15 building 0.21 from source.

We have two fixes for this:

  • Have added gettext/0.22.5 -> https://github.com/conan-io/conan-center-index/pull/23033 - until we have updated the dependencies where appropriate, you can temporarily use this feature to force the solver to use the newer version
  • Alternatively we are actually back-porting the fixes to getttext/0.21 in https://github.com/conan-io/conan-center-index/pull/23100, which should be merged later today. Once this happens, just ensuring you are on the latest revision (with --update when invoking conan install) should fix your problem.

jcar87 avatar Mar 19 '24 10:03 jcar87

@jcar87 I think the gettext issue is solved, however now meson complains while building glib that it cannot find the distutils Python package, because it was removed in my newer Python version. Should I create a new issue for this?

-------- Installing package glib/2.78.1 (31 of 36) --------
glib/2.78.1: Building from source
glib/2.78.1: Package glib/2.78.1:0dd1f1b4027e1da48f5f7bb9297d55f667ddce05
glib/2.78.1: Copying sources to build folder
glib/2.78.1: Building your package in /Users/pep/.conan2/p/b/glibb9e78228e5845/b
glib/2.78.1: Calling generate()
glib/2.78.1: Generators folder: /Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release/conan
glib/2.78.1: Generating aggregated env files
glib/2.78.1: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh']
glib/2.78.1: Calling build()
glib/2.78.1: apply_conandata_patches(): No patches defined in conandata
glib/2.78.1: Meson configure cmd: meson setup --native-file "/Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release/conan/conan_meson_native.ini" "/Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release" "/Users/pep/.conan2/p/b/glibb9e78228e5845/b/src" --prefix=/
glib/2.78.1: RUN: meson setup --native-file "/Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release/conan/conan_meson_native.ini" "/Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release" "/Users/pep/.conan2/p/b/glibb9e78228e5845/b/src" --prefix=/
The Meson build system
Version: 1.2.2
Source dir: /Users/pep/.conan2/p/b/glibb9e78228e5845/b/src
Build dir: /Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release
Build type: native build
Project name: glib
Project version: 2.78.1
C compiler for the host machine: clang (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
C linker for the host machine: clang ld64 1053.12
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -std=c90: YES 
Compiler for C supports arguments -std=c99: YES 
Compiler for C supports arguments -std=c11: YES 
Compiler for C supports arguments -std=c17: YES 
C++ compiler for the host machine: clang++ (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
C++ linker for the host machine: clang++ ld64 1053.12

...

Checking if "/proc/self/cmdline" runs: NO (1)
../src/meson.build:2329:26: ERROR: <PythonExternalProgram 'python3' -> ['/usr/local/opt/[email protected]/bin/python3.12']> is not a valid python or it is missing distutils
A full log can be found at /Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release/meson-logs/meson-log.txt
glib/2.78.1: ERROR: 
Package '0dd1f1b4027e1da48f5f7bb9297d55f667ddce05' build failed
glib/2.78.1: WARN: Build folder /Users/pep/.conan2/p/b/glibb9e78228e5845/b/build-release
ERROR: glib/2.78.1: Error in build() method, line 136
	meson.configure()
	ConanException: Error 1 while executing

EDIT: Seems like this is not gettext-related, and already known in #21535 / #23193.

stevenwdv avatar Mar 25 '24 08:03 stevenwdv