Open christophecvr opened 3 weeks ago
@dcbaker @eli-schwartz
This is really a build breaking bug on macos.
The last reference : was not right. I referenced to this issue in commit by accident. However another solution just for this command of which the goal is just to find the default systems main framework path the clang compiler is referring to and only works for macos with apples clang compilers. Is to limit the language used to objc or c . Then then the CXXFLAGS or OBJCXXFLAGS who may contain invalid flags for c are not used. The framework path will always be found.
Changing:
# TODO: this really needs to be *AppleClang*, not just any clang.
if self.id != 'clang':
raise mesonlib.MesonException('Cannot find framework path with non-clang compiler')
# Construct the compiler command-line
commands = self.get_exelist(ccache=False) + ['-v', '-E', '-']
commands += self.get_always_args()
# Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS from the env
commands += env.coredata.get_external_args(self.for_machine, self.language)
mlog.debug('Finding framework path by running: ', ' '.join(commands), '\n')
Into :
# TODO: this really needs to be *AppleClang*, not just any clang.
if self.id != 'clang':
raise mesonlib.MesonException('Cannot find framework path with non-clang compiler')
# Construct the compiler command-line
commands = self.get_exelist(ccache=False) + ['-v', '-E', '-']
commands += self.get_always_args()
# Add CFLAGS/CXXFLAGS/OBJCFLAGS/OBJCXXFLAGS from the env
# For this command with clang only 'C' or 'Objc' is ok
# With other compiler languages objcpp cpp CXXFLAGS and OBJCXXFLAGS are added
# Some of this flags are not supported in C such as -std=C++<ver> -std=gnu++<ver> and ...
# If project language is objcpp change it to objc if language is cpp change to c
# This only applies for this specific command.
# https://github.com/mesonbuild/meson/issues/13640
if self.language == 'objcpp':
commands += env.coredata.get_external_args(self.for_machine, 'objc')
else:
commands += env.coredata.get_external_args(self.for_machine, 'c')
mlog.debug('Finding framework path by running:', ' '.join(commands), '\n')
Since there is no reply or even not a review on the pull request #13641 I of course did not issued another. It would really be nice if You review this . Since it is a serious bug of meson on macos platform when using clang.
Since there is no interest in this issue we keep running by patching self the meson for macos clang
close this issue since meson developpers are not interested in improving clang macos platform
Just leave open since it's still there
It's not that we're not interested, but none of us are payed to work on Meson full time, and only one of us has a mac. It's much easier to review patches than it is to write them for a platform that we don't have direct access too.
,
It's not that we're not interested, but none of us are payed to work on Meson full time, and only one of us has a mac. It's much easier to review patches than it is to write them for a platform that we don't have direct access too.
Ok thanks
When building some packages with macports such as gstreamer1-plugins-bad for macos system and using xcode basic systems clang apple compiler or upgraded apple clang compiler sometimes extra CXX compiler args such as for this package -std=gnu++11 is required. When building package it issues a meson configure error:
Further investigation showed that the issued framework find path command failed. I tried it in terminal on it's own. failure message :
Due to the error which can't be silenced on clang compiler the command issues 1 and is broken result : framework path not found.
When searching further on the net this issue does show up very much in environments where clang and meson is used. this for -std=c++11,-std=gnu++11,-std=c++17 or -std=gnu++17 ....
The cause is that indeed those args are only allowed for C++/Gobj++ not for 'C'
I did finally found a simple (and do think a clean solution to this issue) : First :
My solution is just to omit the invalid flags for just the framework find path command how :
changing in file mesonbuild/compilers/mixins/clike.py line 1187-1195 from :
to :
Then all the framwork paths are found again and project builds fine .
I will submit in short a pull request with this change. I just added this issue first so I can refer to this issue in pull request commit.