Opened 4 weeks ago

Last modified 11 days ago

#71165 assigned defect

meson: py-meson: Default FrameworkPath not found when using -std=C++<ver> or std=gnu++<ver>

Reported by: christophecvr (christophecvr) Owned by: reneeotten (Renee Otten)
Priority: Normal Milestone:
Component: ports Version: 2.10.99
Keywords: Cc: thomasleaute
Port: py-meson meson

Description

The default Framework path is not found (System and or sdk build type)When the sometimes required -std=C++11 or 17 or ... is used. This when using mp-clang or xcode clang (It's a general Apple clang issue when using meson). Upstream ticket is filed.
https://github.com/mesonbuild/meson/issues/13640

We do have a meson upgrade but problem still present.

Meson is not in a hurry to do something about it. But this issue :

  • breaks sometimes the build (which is the best case)
  • Still allows build with a very degraded result (that is worse)
  • Still allows build with a result of buggy programs up to segfaults (worsted case)

For example the gstreamer1 package in general. Also in all packages requiring the linking to Macos defaults Frameworks using meson.

I do have a solution for it by me. The first one was even send upstream as push request. The second is not the best. The first solution well. Since there was simply no reaction after even a week of wait I removed the pull request to meson.By me I worked with the first one. I will make a new patch on the updated py-meson.

Send to macports-ports master as pull request.

Change History (4)

comment:1 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)

Keywords: meson py-meson removed
Owner: set to reneeotten
Status: newassigned

Are there any MacPorts tickets filed for build failures that are caused by this? Can you give those ticket numbers?

comment:2 in reply to:  1 Changed 4 weeks ago by christophecvr (christophecvr)

Replying to ryandesign:

Are there any MacPorts tickets filed for build failures that are caused by this? Can you give those ticket numbers?

No there are no tickets filled for this issue since it breaks (unfortunately) not many builds. This cause meson will in a lot of cases ignore modules who can't be build due to a missing thing but well build the project in a very degraded result. Or even worse when video elements require the sdk or Systems video modules off Macos framework validations issue may occur who may brake the package self with segfault11 . That is a Apple thing which is even not a real segfault but well ends whit such crash reports.

Lucky that for example the gstreamer1-gst-plugins-bad package (configured with all options also the restricted licensed one) build breaks due to not find framework path which on it is caused cause meson did not found (the present and existing) frameworkpath since option -std=c++11 or -std=gnu++11 is required for that package. Thanks to that the reason could be found.

log of what is really happening then :

Called: `/opt/local/bin/pkg-config --modversion CoreFoundation` -> 1
stderr:
Package CoreFoundation was not found in the pkg-config search path.
Perhaps you should add the directory containing `CoreFoundation.pc'
to the PKG_CONFIG_PATH environment variable
No package 'CoreFoundation' found
-----------
Finding framework path by running:  /usr/bin/clang++ -v -E - -pipe -Os -std=gnu++11 -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -arch x86_64 -I/opt/local/include -L/opt/local/lib -Wno-unused-command-line-argument -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk 

CMake binary for host machine is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency corefoundation found: NO (tried pkgconfig, framework and cmake)

sys/applemedia/meson.build:42:21: ERROR: Dependency "CoreFoundation" not found, tried pkgconfig, framework and cmake

Further analyse shows the failed command:

Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
<whole command ...>
error: invalid argument '-std=gnu++11' not allowed with 'C'

The clang error can't be silenced or changed to warning only. When using other compiler with same command gcc for example it is just a warning not a error.

However every port using meson build system, needing options -std=c++<all> will if it still builds build without any linking to a framework. Quit possible that there are tickets for those packages with run-time issues and then the real cause is very difficult to find.

If You will analyse it you-self try the build from source of: (configuring is already enough to trace)

gstreamer1-gst-plugins-bad

with all restricted licensed options enabled. You will see that not any framework is found.

comment:3 Changed 4 weeks ago by christophecvr (christophecvr)

Pull request with very simple solution send to macports-ports master:
https://github.com/macports/macports-ports/pull/26300

comment:4 Changed 11 days ago by thomasleaute

Cc: thomasleaute added
Note: See TracTickets for help on using tickets.