Unable to install glib with homebrew installed in home location on a macos_arm64

Hi all,

I have my homebrew installed to my home location (due to work reason) by doing git clone:

HOMEBREW_VERSION: 4.0.15-86-g50a6993
ORIGIN: https://github.com/Homebrew/brew
HEAD: 50a699315fe99a4625a54f751ae454c5e4b3b1c2
Last commit: 76 minutes ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 6524544aab85de5b5872793590bb0b8791794379
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /Users/ycsin/homebrew
HOMEBREW_REPOSITORY: /Users/ycsin/homebrew
HOMEBREW_CELLAR: /Users/ycsin/homebrew/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_INSTALL_FROM_API: set
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.87.0 => /usr/bin/curl
macOS: 13.3.1-arm64
CLT: 14.3.0.0.1.1679647830
Xcode: N/A
Rosetta 2: false

I’m trying to install glib however it always fails:

% brew install glib --debug

Running `brew update --auto-update`...
==> Auto-updated Homebrew!
==> Updated Homebrew from 9d5b017bb to 50a699315.
No changes to formulae or casks.

/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/glib.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/gettext.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/meson.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/ninja.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.11.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpdecimal.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/ca-certificates.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/Users/ycsin/homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/pcre2.rb
==> Fetching glib
Warning: Building glib from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Users/ycsin/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Users/ycsin/homebrew)
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/43467fd8dfc0e8954892ecc08fab131242dca025/glib/hardcoded-paths.diff
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.15-86-g50a6993\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.3.1\)\ curl/7.87.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://raw.githubusercontent.com/Homebrew/formula-patches/43467fd8dfc0e8954892ecc08fab131242dca025/glib/hardcoded-paths.diff
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.15-86-g50a6993\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.3.1\)\ curl/7.87.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://raw.githubusercontent.com/Homebrew/formula-patches/43467fd8dfc0e8954892ecc08fab131242dca025/glib/hardcoded-paths.diff
Already downloaded: /Users/ycsin/Library/Caches/Homebrew/downloads/3cff797fba2e962ee6871405f3f9c105575e25520c4eeadd25ebfe6c746d3f15--hardcoded-paths.diff
==> Downloading https://download.gnome.org/sources/glib/2.76/glib-2.76.2.tar.xz
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.15-86-g50a6993\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.3.1\)\ curl/7.87.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head https://download.gnome.org/sources/glib/2.76/glib-2.76.2.tar.xz
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.15-86-g50a6993\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.3.1\)\ curl/7.87.0 --header Accept-Language:\ en --retry 3 --fail --location --silent --head --request GET https://download.gnome.org/sources/glib/2.76/glib-2.76.2.tar.xz
Already downloaded: /Users/ycsin/Library/Caches/Homebrew/downloads/9c15853c4f70f2040f4ad6511c7c727a09e5db3b65ab12d0548f1639fe98098a--glib-2.76.2.tar.xz
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/git --version
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/pcre2.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/gettext.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/meson.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/ninja.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/python@3.11.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/mpdecimal.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssl@1.1.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/ca-certificates.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/sqlite.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/readline.rb
/Users/ycsin/homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /Users/ycsin/homebrew/Library/Taps/homebrew/homebrew-core/Formula/xz.rb
/usr/bin/env tar --extract --no-same-owner --file /Users/ycsin/Library/Caches/Homebrew/downloads/9c15853c4f70f2040f4ad6511c7c727a09e5db3b65ab12d0548f1639fe98098a--glib-2.76.2.tar.xz --directory /private/tmp/d20230427-31541-qo31q4
/usr/bin/env cp -pR /private/tmp/d20230427-31541-qo31q4/glib-2.76.2/. /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2
==> Patching
==> Applying hardcoded-paths.diff
patching file 'gio/xdgmime/xdgmime.c'
patching file 'glib/gutils.c'
==> meson setup build --default-library=both --localstatedir=/Users/ycsin/homebrew/var -Dgio_module_dir=/Users/ycsin/homebrew/lib/gio/modules -Dbsymbolic_functions=false -Ddtrace=false -Druntime_dir=/Users/ycsin/homebrew/var/run --prefix=/Users/ycsin/homebrew/Cellar/gli
==> meson compile -C build --verbose
Last 15 lines from /Users/ycsin/Library/Logs/Homebrew/glib/02.meson:
[408/1355] /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build/glib/gtester -k --quiet --i-know-this-is-deprecated -o glib/tests/tmpsample.xml --test-arg=--gtester-selftest /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build/glib/gtester
FAILED: glib/tests/tmpsample.xml 
/private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build/glib/gtester -k --quiet --i-know-this-is-deprecated -o glib/tests/tmpsample.xml --test-arg=--gtester-selftest /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build/glib/gtester
[409/1355] clang -Igobject/libgobject-2.0.0.dylib.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.0.dylib.p/gvaluearray.c.o -MF gobject/libgobject-2.0.0.dylib.p/gvaluearray.c.o.d -o gobject/libgobject-2.0.0.dylib.p/gvaluearray.c.o -c ../gobject/gvaluearray.c
[410/1355] clang -Igobject/libgobject-2.0.0.dylib.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.0.dylib.p/gvalue.c.o -MF gobject/libgobject-2.0.0.dylib.p/gvalue.c.o.d -o gobject/libgobject-2.0.0.dylib.p/gvalue.c.o -c ../gobject/gvalue.c
[411/1355] clang -Igobject/libgobject-2.0.0.dylib.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.0.dylib.p/gvaluetransform.c.o -MF gobject/libgobject-2.0.0.dylib.p/gvaluetransform.c.o.d -o gobject/libgobject-2.0.0.dylib.p/gvaluetransform.c.o -c ../gobject/gvaluetransform.c
[412/1355] clang -Igobject/libgobject-2.0.0.dylib.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.0.dylib.p/gsignal.c.o -MF gobject/libgobject-2.0.0.dylib.p/gsignal.c.o.d -o gobject/libgobject-2.0.0.dylib.p/gsignal.c.o -c ../gobject/gsignal.c
[413/1355] clang -Igobject/libgobject-2.0.0.dylib.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.0.dylib.p/gvaluetypes.c.o -MF gobject/libgobject-2.0.0.dylib.p/gvaluetypes.c.o.d -o gobject/libgobject-2.0.0.dylib.p/gvaluetypes.c.o -c ../gobject/gvaluetypes.c
[414/1355] clang -Igobject/gobject-query.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int -MD -MQ gobject/gobject-query.p/gobject-query.c.o -MF gobject/gobject-query.p/gobject-query.c.o.d -o gobject/gobject-query.p/gobject-query.c.o -c ../gobject/gobject-query.c
[415/1355] clang -Igobject/tests/performance/performance-threaded.p -Igobject/tests/performance -I../gobject/tests/performance -I. -I.. -Iglib -I../glib -Igobject -I../gobject -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -UG_DISABLE_ASSERT -MD -MQ gobject/tests/performance/performance-threaded.p/performance-threaded.c.o -MF gobject/tests/performance/performance-threaded.p/performance-threaded.c.o.d -o gobject/tests/performance/performance-threaded.p/performance-threaded.c.o -c ../gobject/tests/performance/performance-threaded.c
[416/1355] clang -Igobject/tests/performance/performance.p -Igobject/tests/performance -I../gobject/tests/performance -I. -I.. -Iglib -I../glib -Igobject -I../gobject -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -UG_DISABLE_ASSERT -MD -MQ gobject/tests/performance/performance.p/performance.c.o -MF gobject/tests/performance/performance.p/performance.c.o.d -o gobject/tests/performance/performance.p/performance.c.o -c ../gobject/tests/performance/performance.c
[417/1355] clang -Igobject/libgobject-2.0.0.dylib.p -Igobject -I../gobject -I. -I.. -Iglib -I../glib -I/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/ffi -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -D_GNU_SOURCE -fno-strict-aliasing -DG_DISABLE_CAST_CHECKS -Wimplicit-fallthrough -Wmisleading-indentation -Wmissing-field-initializers -Wnonnull -Wunused -Wno-unused-parameter -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Wno-variadic-macros -Werror=format=2 -Werror=init-self -Werror=missing-include-dirs -Werror=pointer-arith -Werror=unused-result -Wstrict-prototypes -Wno-bad-function-cast -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=pointer-sign -Wno-string-plus-int '-DG_LOG_DOMAIN="GLib-GObject"' -DGOBJECT_COMPILATION -MD -MQ gobject/libgobject-2.0.0.dylib.p/gtype.c.o -MF gobject/libgobject-2.0.0.dylib.p/gtype.c.o.d -o gobject/libgobject-2.0.0.dylib.p/gtype.c.o -c ../gobject/gtype.c
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /Users/ycsin/homebrew/Library/Homebrew/shims/mac/super/ninja -C /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build -v
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/git --version
/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/curl --version
/Users/ycsin/homebrew/Library/Homebrew/ignorable.rb:29:in `block in raise'
BuildError: Failed executing: meson compile -C build --verbose
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 1
==> Temporary files retained at:
/private/tmp/glib-20230427-31541-1ai7ytv

Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!

/usr/bin/env /Users/ycsin/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/4.0.15-86-g50a6993\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 13.3.1\)\ curl/7.87.0 --header Accept-Language:\ en --retry 3 --location https://api.github.com/search/issues\?q=glib\+repo\%3AHomebrew\%2Fhomebrew-core\+state\%3Aopen\+in\%3Atitle\&per_page=100 --header Accept:\ application/vnd.github\+json --write-out '
'\%\{http_code\} --header X-GitHub-Api-Version:2022-11-28 --dump-header /private/tmp/github_api_headers20230427-30409-8e8lg2
These open issues may also help:
Fix compile glib and systemd fail https://github.com/Homebrew/homebrew-core/pull/129242

I tried to debug what’s going on with

FAILED: glib/tests/tmpsample.xml 

by cd into /private/tmp/glib-20230427-40958-qz9zqh/glib-2.76.2/build and do:

/private/tmp/glib-20230427-40958-qz9zqh/glib-2.76.2/build/glib/gtester -k --verbose --i-know-this-is-deprecated -o glib/tests/tmpsample.xml --test-arg=--gtester-selftest /private/tmp/glib-20230427-40958-qz9zqh/glib-2.76.2/build/glib/gtester

and this is what I get:

TEST: /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build/glib/gtester... (pid=35253)
FAIL: /private/tmp/glib-20230427-31541-1ai7ytv/glib-2.76.2/build/glib/gtester

This is the content of the tmpsample.xml

<?xml version="1.0"?>
<!-- Deprecated: Since GLib 2.62, gtester and gtester-report are deprecated. Port to TAP. -->
<gtester>
  <testbinary path="/private/tmp/glib-20230427-40958-qz9zqh/glib-2.76.2/build/glib/gtester">
    <duration>0.001202</duration>
  </testbinary>
</gtester>

And I dont really know how to dig any further, any idea?

Misc info:

% cc -v
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I hope that I’ll be able to install glib with homebrew

1 Like

i ran into this today while doing an upgrade. after debugging a bit, it seems that gtester immediately segfaults after invoking fork. the child process does not even get to main_selftest. it seems like there is a bug in the implementation of g_spawn_async_with_pipes_and_fds

Which version were you using before upgrading?

my currently installed version is 2.74.4.

1 Like

I’m hitting the same problem. I think having homebrew outside of /opt/homebrew is forcing glib to build from sources and building fails like in ycsin’s logs.

Any suggestions how we can fix this glib build issue?

Until we get a proper fix, I worked around the issue by running with --debug, dropping into shell, editing build/build.meson to remove all references to gtester + tmpsample.xml + test.gresource (the next failure).

1 Like

that worked well enough for me to move forward for now, but i hope someone actually looks at the failure.

@JayRod12 yes it is being forced to build from source because my homebrew cellar/prefix are different from the default.

Looks like fork() in macOS is not very reliable:

Solution: [brew in non-default location][macos_arm64] unable to compile glib · Homebrew · Discussion #4463 · GitHub

This MR could help: Avoid stack overflow in gspawn on macOS (!3468) · Merge requests · GNOME / GLib · GitLab

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.