#63462 closed defect (fixed)
meson does (did) not accept gnu89 as an option when building objective C
Reported by: | snarkhunter (Steve Langer) | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | Cc: | ryandesign (Ryan Carsten Schmidt), SoapZA, FnControlOption (fn ⌃ ⌥), mascguy (Christopher Nielsen), larryv (Lawrence Velázquez), hapaguy (Brian Kurt Fujikawa), diochnos, danchr (Dan Villiom Podlaski Christiansen), cooljeanius (Eric Gallager) | |
Port: | meson |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
On Big Sur 11.5.2, glib2 doesn't get past the configuration step when default variants include +quartz:
meson.build:655:2: ERROR: Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices. Possible choices are (as string): "none", "c89", "c99", "c11", "c17", "gnu99", "gnu11".
Attachments (1)
Change History (21)
Changed 3 years ago by snarkhunter (Steve Langer)
Attachment: | meson-log.txt added |
---|
comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | SoapZA FnControlOption added |
---|---|
Description: | modified (diff) |
Port: | meson added |
Summary: | glib2 @2.62.6_1+quartz fails to configure → glib2 @2.62.6_1+quartz: ERROR: Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices |
This appears to have been caused by updating meson to 0.59.1. This problem didn't occur when using meson 0.58.1.
glib2 is outdated. Possibly updating glib2 will solve this. However, it seems like a meson bug to me. Why wouldn't gnu89 be valid?
comment:2 Changed 3 years ago by mascguy (Christopher Nielsen)
Cc: | mascguy added |
---|
comment:3 Changed 3 years ago by larryv (Lawrence Velázquez)
Cc: | larryv added |
---|---|
Summary: | glib2 @2.62.6_1+quartz: ERROR: Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices → glib2 @2.62.6_1: ERROR: Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices |
Replying to snarkhunter:
On Big Sur 11.5.2, glib2 doesn't get past the configuration step when default variants include +quartz:
It occurs with +x11
as well, and I'm on 10.14.6.
comment:4 Changed 3 years ago by kencu (Ken)
it seems to be failing on the objectivec sanity test... the c tests all passed.
the meson 59 release notes indicate the objectivec flag handling changed.
that's as far as I got tonight.
comment:5 Changed 3 years ago by danchr (Dan Villiom Podlaski Christiansen)
I've posted a PR that should fix this:
https://github.com/macports/macports-ports/pull/12154
Essentially, I just search their Gitlab repository for similar issues, and found one. It's a couple of years old, but simply changes gnu89
to gnu99
.
comment:6 Changed 3 years ago by kencu (Ken)
Yeah - it would still be nice to understand why this is happening, but if just changing it to gnu99 and forgetting about the why gets us moving on, that is good enough for me.
we may see this again in other ports perhaps (doubt it -- who else would be forcing gnu89?). But if so, we can do the same thing.
If there are other issues with the objective-c flags that show up, we'll find them soon enough and then have to understand it.
comment:7 follow-up: 9 Changed 3 years ago by kencu (Ken)
OK, it looks like the issue is here in
mesonbuild/compilers/objc.py
they have (incorrectly I believe) excluded gnu89 from the available options for the C std.
If we can verify somehow to them that gnu89 should be an accepted option for ObjC, then perhaps they can add it.
Or we can patch it in as an accepted option ourselves, as it was (apparently) previously accepted.
def get_options(self) -> 'coredata.KeyedOptionDictType': opts = super().get_options() opts.update({ OptionKey('std', machine=self.for_machine, lang='c'): coredata.UserComboOption( 'C language standard to use', ['none', 'c89', 'c99', 'c11', 'c17', 'gnu99', 'gnu11'], 'none', ) }) return opts
comment:8 Changed 3 years ago by kencu (Ken)
changing that line to
['none', 'c89', 'c99', 'c11', 'c17', 'gnu89', 'gnu99', 'gnu11'],
and all is fine again, glib2 builds through
comment:9 Changed 3 years ago by larryv (Lawrence Velázquez)
Replying to kencu:
Or we can patch it in as an accepted option ourselves, as it was (apparently) previously accepted.
It was never accepted; they just did not check before. Probably an oversight, as gnu89
clearly works.
comment:10 Changed 3 years ago by hapaguy (Brian Kurt Fujikawa)
Cc: | hapaguy added |
---|
comment:11 Changed 3 years ago by diochnos
Cc: | diochnos added |
---|
comment:12 Changed 3 years ago by kencu (Ken)
comment:13 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
I filed an upstream bug report: https://github.com/mesonbuild/meson/issues/9237
comment:14 Changed 3 years ago by danchr (Dan Villiom Podlaski Christiansen)
comment:15 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | danchr added |
---|
Please see the comment at the top of the glib2 portfile:
# Please keep the glib2 and glib2-devel ports as similar as possible.
comment:16 Changed 3 years ago by cooljeanius (Eric Gallager)
Cc: | cooljeanius added |
---|
comment:17 Changed 3 years ago by rubendibattista (Ruben Di Battista)
Updating the glib2 version makes it work for me: https://github.com/macports/macports-ports/pull/12203
comment:18 Changed 3 years ago by kencu (Ken)
Port: | glib2 removed |
---|---|
Summary: | glib2 @2.62.6_1: ERROR: Value "gnu89" (of type "string") for combo option "C language standard to use" is not one of the choices → meson does (did) not accept gnu89 as an option when building objective C |
comment:19 Changed 3 years ago by kencu (Ken)
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:20 Changed 3 years ago by kencu (Ken)
the next version of meson fixes this and adds a few more missing standards we would have eventually tripped over.
log file