Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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)

meson-log.txt (289.2 KB) - added by snarkhunter (Steve Langer) 3 years ago.
log file

Download all attachments as: .zip

Change History (21)

Changed 3 years ago by snarkhunter (Steve Langer)

Attachment: meson-log.txt added

log file

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 configureglib2 @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 in reply to:  description 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 choicesglib2 @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.

Last edited 3 years ago by kencu (Ken) (previous) (diff)

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 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
Last edited 3 years ago by kencu (Ken) (previous) (diff)

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 in reply to:  7 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)

In 6f1a759b132b0e9ce4690b7bffa9e09163a167a7/macports-ports (master):

meson: accept gnu89 for ObjC

see: #63462

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)

In 8dd0f5d9f8992743dbe65cf69047ca0def657440/macports-ports (master):

glib2: use C99 mode

Using C89 with GNU extensions used to break the build, but it's
generally invalid, so we might as well fix it. Upstream has a fairly
old bug[1] reporting this, so I just applied the fix directly.[2]

[1] https://gitlab.gnome.org/GNOME/glib/-/issues/1662
[2] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/606

See: #63462

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 choicesmeson does (did) not accept gnu89 as an option when building objective C

comment:19 Changed 3 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed

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.

Note: See TracTickets for help on using tickets.