Skip to content

glib, glib-utils: merge#108307

Closed
carlocab wants to merge 9 commits intoHomebrew:masterfrom
carlocab:glib-hacks
Closed

glib, glib-utils: merge#108307
carlocab wants to merge 9 commits intoHomebrew:masterfrom
carlocab:glib-hacks

Conversation

@carlocab
Copy link
Copy Markdown
Member

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

glib-utils currently leans heavily on the implementation details of Meson. We have no guarantees of stability of that API, so this can break with any Meson update, and we wouldn't even know that it happened until the next time glib-utils is rebuilt.

Let's get rid of it.

We can decouple glib from a specific versioned Python dependency by using uses_from_macos "python" instead. This does rely on our syntax check ignoring dependency conflicts of this type, but that's at least something we have control over (unlike Meson's internal API).

While we're here, let's switch this to using libffi from macOS.

The tap syntax check may fail from a number of formulae currently depending on glib-utils. To avoid having to rebuild them, I may remove those dependencies in a separate syntax-only PR.

Closes #107305.

@BrewTestBot BrewTestBot added the automerge-skip `brew pr-automerge` will skip this pull request label Aug 17, 2022
Comment thread Formula/glib.rb Outdated
Copy link
Copy Markdown
Member

@cho-m cho-m Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does mean utilities won't work out-of-the-box on Mojave and older since they need Python 3, which could cascade into breaking dependent builds.

This is reason we originally didn't choose this approach as uses_from_macos "python", since: :catalina can trigger audit failure

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does mean utilities won't work out-of-the-box on Mojave and older since they need Python 3, which could cascade into breaking dependent builds.

Mojave support is "best-effort" --
I don't think supporting Mojave can justify the hacks in glib-utils.

This is reason we originally didn't choose this approach as uses_from_macos "python", since: :catalina can trigger audit failure

What audit failure was that?

Copy link
Copy Markdown
Member

@cho-m cho-m Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ones seen when mixing node (which uses alias for Python3) and emscripten (#95866)

Similarly seen with node + jupyterlab (#103972, #104097)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should adjust the audit then.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I had to guess, HOMEBREW_SIMULATE_MACOS_ON_LINUX is taking code paths of older version of macOS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about making this the oldest supported release of macOS?

Off the top of my head, I think that would be fine. Looks like there wasn't really much discussion about it when it was added, so probably fine.

CC: @Bo98

Copy link
Copy Markdown
Member

@Bo98 Bo98 Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The philosophy behind choosing the oldest macOS is that it includes the most dependencies (99.9% of the time). For auditing reasons this is usually a good thing.

We would have the same issue on Linux if the conflict audit wasn't disabled there. I would not rely on this remaining the case - I've been wanting to change that for a long time now.

The conflict audit failure here is really a special case. I'd say the way forward is to special case the python alias to not trigger the conflict audit, since those formulae are typically not bound to a particular version of Python. That's the real issue I feel.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged Homebrew/brew#13714. Now we only need #108343.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses_from_macos "python"
uses_from_macos "python", since: :catalina

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. This needs another run for the self-hosted runner and to rebuild some dependents against system libffi anyway.

carlocab added a commit to carlocab/homebrew-core that referenced this pull request Aug 20, 2022
carlocab added a commit to carlocab/homebrew-core that referenced this pull request Aug 20, 2022
carlocab added a commit to carlocab/homebrew-core that referenced this pull request Aug 20, 2022
@carlocab
Copy link
Copy Markdown
Member Author

Opened Homebrew/brew#13725 so that we can do this without rebuilding all the formulae that do depends_on "glib-utils" => :build.

Copy link
Copy Markdown
Member Author

@carlocab carlocab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glib will probably need a bunch of link_overwrites to prevent brew link conflicts for anyone who's installed glib-utils in the meantime.

While we're here, let's stop using Homebrew `libffi`. We don't need it.
This formula relies on some really terrible hacks. In particular, it
depends on the implementation details of meson, and we have no
guarantees about the stability of those details.

Let's get rid of it.
Comment thread Formula/gobject-introspection.rb Outdated
Copy link
Copy Markdown
Member Author

@carlocab carlocab Aug 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ships a

_giscanner.cpython-310-darwin.so

so this is not flexible about the version of Python used.

@carlocab
Copy link
Copy Markdown
Member Author

carlocab commented Aug 23, 2022

Dropping trezor-agent. Building it requires rebuilding harfbuzz without the glib-utils dependency. Will rebuild it separately when this is merged.

This cannot switch to `uses_from_macos "python"` since this ships C
extension modules for Python, and these are tied to a specific Python
version.
This has both versions of OpenSSL in its dep tree, but it does not link
with anything that links with OpenSSL 1.1, so this conflict does not
seem problematic.
@cho-m
Copy link
Copy Markdown
Member

cho-m commented Aug 23, 2022

Linux CI didn't run properly with dependents not using the built glib.

Dependents tests: Error: 1583 failed steps!

And pygobject:

==> brew install --only-dependencies --verbose --build-bottle pygobject3
...
==> Downloading https://ghcr.io/v2/homebrew/core/glib/manifests/2.72.3_1
  /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Linuxbrew/3.5.10\ \(Linux\;\ x86_64\ 5.15.0-1016-gcp\)\ curl/7.47.0 --header Accept-Language:\ en --fail --silent --retry 3 --header Accept:\ application/vnd.oci.image.index.v1\+json --header Authorization:\ Bearer\ QQ== --location --remote-time --output /github/home/.cache/Homebrew/downloads/762aec743625be859f12564877b8b8f08aedfa0ced86b6a5cf046f5da3204a9f--glib-2.72.3_1.bottle_manifest.json.incomplete https://ghcr.io/v2/homebrew/core/glib/manifests/2.72.3_1
  curl: (22) The requested URL returned error: 404 Not Found
  Error: pygobject3: Failed to download resource "glib_bottle_manifest"
  Download failed: https://ghcr.io/v2/homebrew/core/glib/manifests/2.72.3_1

@carlocab
Copy link
Copy Markdown
Member Author

Seems unavoidable, unfortunately. At least, not without rebuilding all the glib-utils dependents. macOS looks fine, so there are unlikely to be too many issues here. Will merge this and fix any outstanding issues after.

@BrewTestBot
Copy link
Copy Markdown
Contributor

:shipit: @carlocab has triggered a merge.

@BrewTestBot
Copy link
Copy Markdown
Contributor

:shipit: @carlocab has triggered a merge.

@BrewTestBot
Copy link
Copy Markdown
Contributor

⚠️ @carlocab bottle publish failed.

@carlocab
Copy link
Copy Markdown
Member Author

pygobject3 rebottled on Linux at 54ac8d1.

trezor-agent rev bumped at #108756.

That should settle everything. If there's any remaining breakage, feel free to ping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge-skip `brew pr-automerge` will skip this pull request CI-linux-self-hosted Build on Linux self-hosted runner CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. long build Set a long timeout for formula testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

glib package's pkgconfig references binary not included

5 participants