[MacPorts] #73976: glib2-bootstrap @2.88.1_0+universal+x11 Failed to configure

MacPorts noreply at macports.org
Fri May 29 12:49:48 UTC 2026


#73976: glib2-bootstrap @2.88.1_0+universal+x11 Failed to configure
------------------------------+----------------------
  Reporter:  leoinparis       |      Owner:  mascguy
      Type:  defect           |     Status:  assigned
  Priority:  Normal           |  Milestone:
 Component:  ports            |    Version:  2.12.5
Resolution:                   |   Keywords:
      Port:  glib2-bootstrap  |
------------------------------+----------------------

Comment (by potmj):

 Here is a fix I have come up with that can be added to the {{{ platform
 Darwin }}} section, with the aid of Gemini to speed the analysis of what I
 thought was a meson issue.  The configuration failures when building
 `glib2-bootstrap` and `glib2` with the `+universal` variant on OS X
 10.11.6 are caused by two specific limitations in upstream GLib 2.88.x's
 `meson.build` script during the split `muniversal` cross-compilation
 phase:

 1. **Subsystem Autodetection Failure (Line 84):**
 The assignment `subsystem = host_machine.subsystem()` fails because a
 valid subsystem object mapping is not declared natively by the host in the
 cross-file layout, causing Meson 1.11+ to panic with:
 "ERROR: Subsystem not defined or could not be autodetected." (from the
 apple compiler).

 2. **Introspection Execution Gate (Line 2722):**
 For the main `glib2` port, Meson flags the dual-architecture folders as
 cross-build environments and hard-asserts that host binaries cannot run
 via `error('Running binaries on the build host needs to be
 supported...')`, which crashes the setup despite the host natively
 supporting the target architectures.

 Both errors can be cleanly bypassed using standard Meson syntax string
 swaps under a unified `post-patch` routine. Adding the following block to
 the `platform darwin` section of the Portfile resolves the issue, allowing
 a pure build via the native system compiler chain:

 platform darwin {
     # Fixes for OS X 10.11 El Capitan (major 15) and newer universal
 builds
     if {${os.major} >= 15} {
         post-patch {
             if {[file exists ${worksrcpath}/meson.build]} {
                 # 1. Clear out the subsystem check panic
                 reinplace "s|subsystem =
 host_machine.subsystem()|subsystem = ''|g" ${worksrcpath}/meson.build

                 # 2. Downgrade the cross-build host execution error to a
 warning
                 reinplace "s|error('Running binaries on the build host
 needs to be supported to build with
 -Dintrospection=enabled')|warning('Bypassing cross-build host binary check
 for universal variant')|g" ${worksrcpath}/meson.build
             }
         }
     }
 }

-- 
Ticket URL: <https://trac.macports.org/ticket/73976#comment:14>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list