Mac OS X 10.12 cs-1.6.1 build error

Discuss issues related to installing or building
Post Reply
charlest
Posts: 4
Joined: Tue Nov 12 2019 8:38 am

Mac OS X 10.12 cs-1.6.1 build error

Post by charlest »

Hi, Just new to CopperSpice and trying to build on Mac OS/X 10.12.6 (Sierra), which I am attached to since it allows my older 17" MacBookPro to run.
Came across this name clash with an Apple defined macro:
FAILED: src/webkit/CMakeFiles/CsWebKit.dir/__/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ @src/webkit/CMakeFiles/CsWebKit.dir/__/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp.o.rsp -MD -MT src/webkit/CMakeFiles/CsWebKit.dir/__/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp.o -MF src/webkit/CMakeFiles/CsWebKit.dir/__/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp.o.d -o src/webkit/CMakeFiles/CsWebKit.dir/__/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp.o -c /Users/ct/Projects/copperspice/src/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
In file included from /Users/ct/Projects/copperspice/src/3rdparty/webkit/Source/WebCore/platform/network/qt/ResourceHandleQt.cpp:40:
In file included from /Users/ct/Projects/copperspice/src/3rdparty/webkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h:24:
In file included from include/QtNetwork/QNetworkAccessManager:1:
In file included from include/QtNetwork/qnetworkaccessmanager.h:32:
In file included from include/QtNetwork/QSslConfiguration:1:
In file included from include/QtNetwork/qsslconfiguration.h:28:
In file included from include/QtNetwork/qsslsocket.h:33:
In file included from include/QtNetwork/qsslerror.h:28:
include/QtNetwork/qsslcertificate.h:122:83: error: too many arguments provided to function-like macro invocation
static QList<QSslError> verify(const QList<QSslCertificate> &certificateChain, const QString &hostName = QString());
^
/usr/include/AssertMacros.h:1339:11: note: macro 'verify' defined here
#define verify(assertion) __Verify(assertion)
^
1 error generated.
So the static QSslCertificate::verify function definition is clashing with the Apple verify macro. However I do note that in the AssertMacros.h file it says just before the block of macro defs that define the verify macro:
* Prior to Mac OS X 10.6 the macro names used in this file conflicted with some
* user code, including libraries in boost and the proposed C++ standards efforts,
* and there was no way for a client of this header to resolve this conflict. Because
* of this, most of the macros have been changed so that they are prefixed with
* __ and contain at least one capital letter, which should alleviate the current
* and future conflicts. However, to allow current sources to continue to compile,
* compatibility macros are defined at the end with the old names. A tops script
* at the end of this file will convert all of the old macro names used in a directory
* to the new names. Clients are recommended to migrate over to these new macros as
* they update their sources because a future release of Mac OS X will remove the
* old macro definitions ( without the double-underscore prefix ). Clients who
* want to compile without the old macro definitions can define the macro
* __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES to 0 before this file is
* included.

...

#ifndef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES
/* If we haven't set this yet, it defaults to on. In the next release, this will default to off. */
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 1
#endif
So am just wondering if this __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES needs setting to zero on OS/X 10.12 ?
Has anyone else hit this. I suppose I could use the binary distribution.

I did the simple cmake initial command:
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../cs_lib ../copperspice
Thanks.
EDIT: Ah. Have realised I have not installed Homebrew or MacPorts. Do I assume I need to do this?
janwilmans
Posts: 17
Joined: Wed Oct 16 2019 9:33 pm
Contact:

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by janwilmans »

I have not seen this before, can you provide the sequence of commands you used to configure cmake ?

I build MacOs on Azure, here is the last succesful build:
https://dev.azure.com/copperspice/copperspice-msvc/_build/results?buildId=182

Also, here you can see my build script: https://github.com/janwilmans/copperspice-msvc/blob/master/ci/azure-pipelines.yml#L147
I basically use homebrew only to install ninja, but I think we indeed rely on both homebrew and macports to install dependencies.
charlest
Posts: 4
Joined: Tue Nov 12 2019 8:38 am

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by charlest »

Hi Jan
Thanks for that. Have put this on the back burner for the last week but will take a look at your scripts and double check how I go.

However for info:
1. I installed homebrew using the standard ruby command line.
2. Did not (yet) install macports.
3. cloned CopperSpice into a directory copperspice
4. Made a cs_build directory at the same level as the cloned copperspice
(Planning to build from ./copperspice into ./cs_build and install into ./cs_lib as per web site sequence. THough I notice you make the build directory below the copperspice one)
5. Then went into cs_build and did:
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../cs_lib ../copperspice
6. Followed by (8 core usage instead of 12 on my machine to stop it getting too hot! Its an old MacBookPro which is susceptible to that I am afraid):
ninja -j8
7. It takes a while but gets about 2500 files in and the blows with the macro error.
8. Please note I am on OSX 10.12.6 and I did NOT set the CMAKE_OSX_DEPLOYMENT_TARGET as you did so will try some of that.

Thanks for the links. I will go through and see how I get on since I really want to come away from Qt usage.
barbara
Posts: 472
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by barbara »

We have not seen this issue in CopperSpice CI and we build for Mac OS X 10.12 and 10.13. We are looking at what libraries you may installed which are different from our configuration.

Please let us know the exact version of Xcode you have installed.

Barbara
charlest
Posts: 4
Joined: Tue Nov 12 2019 8:38 am

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by charlest »

Hello Barbara
Xcode version is 9.2 (9c40b). No need to push at this since I am continuing main app development on Qt at the moment, but will return to this bit by bit and let you know what I find.
Many thanks for the replies
Charles
ansel
Posts: 155
Joined: Fri Apr 10 2015 8:23 am

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by ansel »

Just for reference, as of CopperSpice 1.6.2 released on Feb 21st the requirements for a build environment have changed on OS X. Our minimum supported version is now OS X 10.13 with Xcode 10.1.
Ansel Sermersheim
CopperSpice Cofounder
charlest
Posts: 4
Joined: Tue Nov 12 2019 8:38 am

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by charlest »

I have now got a new Mac with Catalina do the original problem does not occur. It is building fine, though am having problems with Kitchensink not running (it builds ok) am getting the following:

The application failed to start because the platform plugin was not found or did not load.
Requested Plugin Key: "cocoa"

But have probably not set the CMake params right. Will be trying with prebuilt binaries first.
barbara
Posts: 472
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Mac OS X 10.12 cs-1.6.1 build error

Post by barbara »

The application failed to start because the platform plugin was not found or did not load.
Requested Plugin Key: "cocoa"
After you built KitchenSink did you run "ninja install"?

During the install the required .dylib ( or .so or .dll ) file will be copied to your deploy/platforms folder. This is where the cocoa ( or xcb or windows ) plugin will be located.

Since KitchenSink has multiple examples after the install you will also see several other folders in your deploy folder such as mediaservices and playlistformats. If you want to change the names of these folders there are config files we can direct you to.

Barbara
Post Reply