Mailing List Archive

compile issues - latest macOS SDK (11.3) / Xcode (11.5)
I'm trying to build new app bundles for master and fixes/31 using my
standard compile script, but am now getting errors in the compile process
with the latest Xcode release.

The error occurs on both master and fixes/31 for both intel and arm
platforms.

Everything is still working on older versions of macOS (i.e. Catalina /
High Sierra)

Here's the compiler error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C
libmythsoundtouch all

ccache clang++ -c -pipe -stdlib=libc++ -D_FILE_OFFSET_BITS=64 -DPIC
-std=c++17 -faligned-new -DNDEBUG -fomit-frame-pointer -fPIC
-DQT_DISABLE_DEPRECATED_BEFORE=0x050900 -pthread -g -Wall -Wextra
-Wpointer-arith -Wno-constant-logical-operand -Wno-unused-value
-Qunused-arguments -Wimplicit-fallthrough -fPIC -std=gnu++1z -arch arm64
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
-mmacosx-version-min=10.13 -w -DUSING_APPLEREMOTE -D_GNU_SOURCE -I.
-I/opt/local/libexec/qt5/include -I/opt/local/include/libxml2 -I. -I../..
-I/opt/local/libexec/qt5/mkspecs/macx-clang -o obj/AAFilter.o AAFilter.cpp

In file included from AAFilter.cpp:45:

In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:309:

In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/type_traits:417:

In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/cstddef:37:

../../version:1:1: error: C++ requires a type specifier for all declarations

SOURCE_VERSION="v32-Pre"

^

../../version:1:25: error: expected ';' after top level declarator

SOURCE_VERSION="v32-Pre"

^

In file included from AAFilter.cpp:45:

In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:309:

In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/type_traits:418:

../../version:1:1: error: C++ requires a type specifier for all declarations

SOURCE_VERSION="v32-Pre"

^

../../version:1:25: error: expected ';' after top level declarator

SOURCE_VERSION="v32-Pre"

^

4 errors generated.

make[2]: *** [obj/AAFilter.o] Error 1

make[1]: *** [libmythsoundtouch-all] Error 2

make: *** [external] Error 2

Compiling Mythtv failed

Here's a snippet of my configure output:

#### MythTV CONFIGURATION ####

# Basic Settings

Qt minimum version 5.9

Qt installed version 5.15.2

Compile type profile

Compiler cache yes

DistCC no

qmake /opt/local/libexec/qt5/bin/qmake

install prefix /Users/jhoyt/mythtv-32/32-osx-64bit

runtime prefix ../Resources

CPU aarch64 (Apple M1)

NEON enabled yes (Intrinsics yes)

VFP enabled yes

Creating configuration files ...


# Input Support

Joystick menu no

lirc support no

libCEC device support no [/usr/include]

Apple Remote yes

Video4Linux support no

ivtv support no

HD-PVR support no

FireWire support no

DVB support no [/usr/include]

DVB-S2 support no

HDHomeRun support no

Sat>IP support yes

V@Box TV Gateway support yes

Ceton support yes

DVEO ASI support no


# Sound Output Support

PulseAudio support no

OSS support no

ALSA support no

JACK support default

libfftw3 support no


# Video Output Support

x11/xrandr support no

VideoToolBox support yes

VAAPI support no

DRM support no

Video4Linux codecs no (DRM no)

MMAL decoder support no

OpenGL yes (OpenGLES no)

EGL support no

Vulkan no (libglslang no)

MHEG support yes

libass subtitle support yes


# Misc Features

Frontend yes

Backend yes

Qt private headers no

Wayland extras no

multi threaded libavcodec yes

libxml2 support yes [/opt/local/include/libxml2]

libdns_sd (Bonjour) yes

libcrypto yes

gnutls yes

exiv2 support yes (internal)

bluray support yes (system)

BD-J (Bluray java) yes

BD-J type j2se

systemd_notify no

systemd_journal no


# Bindings

bindings_perl yes

bindings_python yes

bindings_php yes


# External Codec Options

mp3lame yes

xvid yes

x264 yes

x265 (HEVC) yes

vpx yes

libaom (AV1) yes

libdav1d (AV1) yes


# Compilation Options

C++ standard supported c++17

Enforce c++11 nullptr no

Enforce shadowed vars yes


Creating libs/libmythbase/mythconfig.h and libs/libmythbase/mythconfig.mak


libs/libmythbase/mythconfig.h is unchanged

libs/libmythbase/mythconfig.mak is unchanged

Configuring libexiv2...

Configuring libmythdvdnav...

Configuring libudfread...

Configuring libmythsoundtouch...

Any suggestions on how to troubleshoot this? If I add a ';' to
mythtv/mythtv/VERSION the "error: expected ';' after top level declarator"
errors go away.

Thanks for the help!
John
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
On Sun, 2021-05-16 at 09:08 -0400, John Hoyt wrote:
> I'm trying to build new app bundles for master and fixes/31 using my
> standard compile script, but am now getting errors in the compile
> process with the latest Xcode release.

> The error occurs on both master and fixes/31 for both intel and arm
> platforms.
>
> Everything is still working on older versions of macOS (i.e. Catalina /
> High Sierra)
>
> Here's the compiler error:
> /Applications/Xcode.app/Contents/Developer/usr/bin/make -C
> libmythsoundtouch all
> ccache clang++ -c -pipe -stdlib=libc++ -D_FILE_OFFSET_BITS=64 -DPIC -
> std=c++17 -faligned-new -DNDEBUG -fomit-frame-pointer -fPIC -
> DQT_DISABLE_DEPRECATED_BEFORE=0x050900 -pthread -g -Wall -Wextra -
> Wpointer-arith -Wno-constant-logical-operand -Wno-unused-value -
> Qunused-arguments -Wimplicit-fallthrough -fPIC -std=gnu++1z  -arch
> arm64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De
> veloper/SDKs/MacOSX11.3.sdk -mmacosx-version-min=10.13 -w -
> DUSING_APPLEREMOTE -D_GNU_SOURCE -I. -I/opt/local/libexec/qt5/include -
> I/opt/local/include/libxml2 -I. -I../.. -
> I/opt/local/libexec/qt5/mkspecs/macx-clang -o obj/AAFilter.o
> AAFilter.cpp
> In file included from AAFilter.cpp:45:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De
> veloper/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:309:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De
> veloper/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/type_traits:417:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/De
> veloper/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/cstddef:37:

The problem is here. The file /usr/include/c++/v1/cstddef should be
including /usr/include/c++/v1/version but is instead getting the file
"VERSION" from the mythtv sources. This shouldn't happen. System header
files should never include user header files.

I'm sorry I don't remember how I fixed it. I was changing a bunch of
things at the time, trying to get my OSX builder working again.

Are you using the system clang and llvm, or the ones installed by
macports? I'm using the system versions. I'm running XCode 12.4 and
using SDK 11.2 (I think).

David


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
On Sun, May 16, 2021 at 4:42 PM David Hampton via mythtv-dev
<mythtv-dev@mythtv.org> wrote:

> The problem is here. The file /usr/include/c++/v1/cstddef should be
> including /usr/include/c++/v1/version but is instead getting the file
> "VERSION" from the mythtv sources. This shouldn't happen. System header
> files should never include user header files.

My guess would be that this sounds like a
case insensitive file system issue combined
with the include path order.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
On Sun, May 16, 2021 at 12:42 PM David Hampton via mythtv-dev <
mythtv-dev@mythtv.org> wrote:

> Are you using the system clang and llvm, or the ones installed by
> macports? I'm using the system versions. I'm running XCode 12.4 and
> using SDK 11.2 (I think).


I am using the system clang and llvm. Just double checked to be sure.

On Sun, May 16, 2021 at 1:12 PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> > The problem is here. The file /usr/include/c++/v1/cstddef should be
> > including /usr/include/c++/v1/version but is instead getting the file
> > "VERSION" from the mythtv sources. This shouldn't happen. System header
> > files should never include user header files.
>
> My guess would be that this sounds like a case insensitive file system
> issue combined with the include path order.
>

It's definitely a case insensitive file system - case sensitive file
systems introduced a ton of issues into the build process so I.

The weird thing is the same compile script works without issues with Xcode
versions below 11.5, I suspect something changed under the hood with the
new Xcode / command line tools. I try to diff out the include paths and
see if something jumps out at me.
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
>
>
>> It's definitely a case insensitive file system - case sensitive file
> systems introduced a ton of issues into the build process so I.
>
> The weird thing is the same compile script works without issues with Xcode
> versions below 12.5, I suspect something changed under the hood with the
> new Xcode / command line tools. I try to diff out the include paths and
> see if something jumps out at me.
>

It looks like other folks are having similar issues in the tesseract
community with Xcode 12.5:

https://groups.google.com/g/tesseract-ocr/c/MpCZe5wRYQE
<https://groups.google.com/g/tesseract-ocr/c/MpCZe5wRYQE>

As Gary suggested, the case insensitive filesystem is probably the culprit
plus apple using <version> instead of "version" in some of their header
files.

I can certainly take a similar action and rename VERSION to MYTHTV_VERSION
or something and update anything that references VERSION - but this seems
like the wrong solution.

Any suggestions on how to tell the compiler to explicitly ignore the
VERSION file?
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
On Sun, May 16, 2021 at 9:17 PM John Hoyt <john.hoyt@gmail.com> wrote:

> Any suggestions on how to tell the compiler to explicitly ignore the VERSION file?

If you are in the Apple Developer Program, are
you not able to open a Technical Support Incident
to request support on the API frameworks?

That may take a bit of time to get resolution,
but fixing the framework to "do the right thing"
would seem to be the longer term better
solution (for you, and others).
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
On Sun, May 16, 2021 at 6:34 PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Sun, May 16, 2021 at 9:17 PM John Hoyt <john.hoyt@gmail.com> wrote:
>
> > Any suggestions on how to tell the compiler to explicitly ignore the
> VERSION file?
>
> If you are in the Apple Developer Program, are
> you not able to open a Technical Support Incident
> to request support on the API frameworks?
>
> That may take a bit of time to get resolution,
> but fixing the framework to "do the right thing"
> would seem to be the longer term better
> solution (for you, and others).


I am a member of the Apple Developer program and I just generated an issue
with Apple.

I expect this will take a while to resolve :) - I'm still looking for a
workaround, but renaming VERSION locally seems to be working so I can post
some updated mac builds again.
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
>
> > Any suggestions on how to tell the compiler to explicitly ignore the
>> VERSION file?
>>
>> If you are in the Apple Developer Program, are
>> you not able to open a Technical Support Incident
>> to request support on the API frameworks?
>>
>> That may take a bit of time to get resolution,
>> but fixing the framework to "do the right thing"
>> would seem to be the longer term better
>> solution (for you, and others).
>
>
> I am a member of the Apple Developer program and I just generated an issue
> with Apple.
>
> I expect this will take a while to resolve :) - I'm still looking for a
> workaround, but renaming VERSION locally seems to be working so I can post
> some updated mac builds again.
>

Here's the response to my issue report to Apple:

"Thanks for reporting the issue. Unfortunately the problem is caused by the
fact that you’re passing in `-I../..` header search path option. The
cstddef header in the SDK has the following include `#include <version>`,
and the header search path you pass into the compiler invocation appears to
contain a `version` header there. Please either rename `version` header in
your project or stop passing in `-I../..` to your compilation to resolve
the issue. Fwiw the `version` header is part of the C++ standard
https://en.cppreference.com/w/cpp/header/version, and thus the compiler
reserves it for its own use and thus you shouldn’t use that name in your
project."


I suspect this is in the "won't fix" bin for Apple - but I pointed them to
3 other projects that have similar issues, so maybe Apple will take a
deeper look.
Re: compile issues - latest macOS SDK (11.3) / Xcode (11.5) [ In reply to ]
On Fri, May 28, 2021 at 8:29 AM John Hoyt <john.hoyt@gmail.com> wrote:

> > Any suggestions on how to tell the compiler to explicitly ignore the
>>> VERSION file?
>>>
>>> If you are in the Apple Developer Program, are
>>> you not able to open a Technical Support Incident
>>> to request support on the API frameworks?
>>>
>>> That may take a bit of time to get resolution,
>>> but fixing the framework to "do the right thing"
>>> would seem to be the longer term better
>>> solution (for you, and others).
>>
>>
>> I am a member of the Apple Developer program and I just generated an
>> issue with Apple.
>>
>> I expect this will take a while to resolve :) - I'm still looking for a
>> workaround, but renaming VERSION locally seems to be working so I can post
>> some updated mac builds again.
>>
>
> Here's the response to my issue report to Apple:
>
> "Thanks for reporting the issue. Unfortunately the problem is caused by
> the fact that you’re passing in `-I../..` header search path option. The
> cstddef header in the SDK has the following include `#include <version>`,
> and the header search path you pass into the compiler invocation appears to
> contain a `version` header there. Please either rename `version` header in
> your project or stop passing in `-I../..` to your compilation to resolve
> the issue. Fwiw the `version` header is part of the C++ standard
> https://en.cppreference.com/w/cpp/header/version, and thus the compiler
> reserves it for its own use and thus you shouldn’t use that name in your
> project."
>
>
> I suspect this is in the "won't fix" bin for Apple - but I pointed them to
> 3 other projects that have similar issues, so maybe Apple will take a
> deeper look.
>

I just received some additional info from the macports dev's that this is a
C++17 issue caused by the latest Xcode release finally shipping with a
clang version including the header. They've seen it before and doubt that
Apple will do anything to fix it as well.

As Gary correctly surmised, this is now a C++17 and case insensitive
filesystem issue unlikely to be corrected by Apple. Any suggestions on how
to fix it properly in mythtv's codebase?

It seems to me that renaming VERSION to something new may be the simplest
solution.