Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py-gobject3: add patch to address closure / tramp on ARM64 #12377

Merged

Conversation

michaelld
Copy link
Contributor

Description

py-gobject3: add patch to address closure / tramp on ARM64

NOTE: This patch is not official! It is a "best effort" workaround for the issue, and for the Python interface to GObject-Introspection only. See also the actual commit for its message.

Closes: https://trac.macports.org/ticket/62180

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 11.5 20G71 [Intel]
Xcode 12.3 12C33

macOS 11.6 20G165 [ARM64]
Xcode 13.0 13A233

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

NOTE: This patch is not official! It is a "best effort" workaround for the issue, and for the Python interface to GObject-Introspection only.

Closes: https://trac.macports.org/ticket/62180
@macportsbot
Copy link

Notifying maintainers:
@dbevans for port py-gobject3.

@macportsbot macportsbot added by: member Created by a member with commit rights maintainer: open Affects an openmaintainer port type: bugfix labels Sep 25, 2021
@kencu
Copy link
Contributor

kencu commented Sep 25, 2021

Well. Not an easy one to sort out or test. I read through https://gitlab.gnome.org/GNOME/pygobject/-/issues/455 and I can see the troubles people are having.

It's times like this that we will feel the pain from losing Jeremy's attentions...

@michaelld
Copy link
Contributor Author

Well. Not an easy one to sort out or test. I read through https://gitlab.gnome.org/GNOME/pygobject/-/issues/455 and I can see the troubles people are having.

It's times like this that we will feel the pain from losing Jeremy's attentions...

Indeed! (all around ...) The gist of how I read the patch is that they are replicating the underlying behavior but fixing it to actually do the right thing. It's a bit of a rabbit hole to go down (the comparison), but in my read their fix is legit -- even if just for this very specific case of GO-I and LIBFFI. I'm not sophisticated enough to work out how to patch GO-I to generically do the right thing. Hence, trying this route to see if there's any traction.

Copy link
Contributor

@kencu kencu left a comment

Choose a reason for hiding this comment

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

so this is one of those situations where we leap and then fix whatever comes next, I believe.

@michaelld
Copy link
Contributor Author

so this is one of those situations where we leap and then fix whatever comes next, I believe.

Yup that's my take too. It's like my M1 patches for NumPy and SciPy: make it work and hope upstream fixes things soonish!

@michaelld
Copy link
Contributor Author

Checks passes, which is always a good sign. Let's see what @dbevans says ...

@michaelld
Copy link
Contributor Author

michaelld commented Sep 29, 2021

This port is openmaintainer, we have maintainer timeout (and then some), all CI passes, and this hack/fix is critical for GNURadio's GRC to execute on M1. Per @kencu's note: this is one of those situations where we leap and then fix whatever comes next. Thus I'm merging & we'll see what happens. 🤞

@michaelld michaelld merged commit 36b3f88 into macports:master Sep 29, 2021
@michaelld michaelld deleted the py-gobject3_hackfix_for_ARM64.diff branch September 29, 2021 12:43
@gergomez
Copy link

gergomez commented Feb 2, 2022

This is still happening. I've found an easy way to reproduce it without gnuradio:

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

window = Gtk.Window(title="Hello World")
window.show()
window.connect("destroy", Gtk.main_quit)
Gtk.main()

using
py39-gobject3@3.38.0
py39-cairo@1.20.1
libffi@3.4.2_2
glib2@@2.64.6

Running this on macOS 12.2 in a M1 Max, I get the same behavior as reported. Backtrace attached.

If I do:

gi.require_version("Gtk", "2.0")

everything works as expected.

bt.txt

@gergomez
Copy link

In fact the bug I encountered is not because of this but because of glib2 (https://trac.macports.org/ticket/64377#ticket). Solved by removing the universal.patch and config.ed and recompiling everything from source.

@michaelld
Copy link
Contributor Author

@gergomez thanks for that info! I'll give that a try & see if I can reduce the issue to some specific part of those files ... they are usually there for a reason, but sometimes need updating for newer releases than they were originally created

@michaelld
Copy link
Contributor Author

Excellent! For my install I have to disable that patch, then reinstall glib2, then reinstall gtk3. Then GRC works. Nice!

@wifwucite
Copy link

Cool, sounds like you guys have found a feasible work-around. Unfortunately I am not able to follow along. Could someone post some instructions on how to get GRC up and running on an ARM64 Mac with MacPorts? I think quite a few people would appreciate this. :-) Thanks in a advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by: member Created by a member with commit rights maintainer: open Affects an openmaintainer port type: bugfix
6 participants