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

Dual GLib imports #6

Closed
diamondburned opened this issue May 14, 2021 · 2 comments
Closed

Dual GLib imports #6

diamondburned opened this issue May 14, 2021 · 2 comments
Labels
broken Changes that require refactoring

Comments

@diamondburned
Copy link
Owner

Right now, some packages are importing 2 (two) different GLib packages:

  • github.com/diamondburned/gotk4/pkg/glib (ours)
  • github.com/gotk3/gotk3/glib (theirs)

The obvious issue here is that their GLib contains certain types, such as Object, that we rely on. However, our GLib package also has certain parts that other packages rely on. This causes colliding imports.

The legitimate solution here is to allow import aliases to be added, which means each *girgen.ResolvedType must be aware of the new package name that is used in the qualifier. In other words, it can no longer that the base name is always the right package name. This unfortunately requires a bit refactoring in a lot of places.

An alternative solution would be to maintain a copy of their GLib package and to copy-paste everything on generation. This has the awful disadvantage of being way too ugly as well as needing to make sure the copy is regularly up to date for a very long time.

@diamondburned
Copy link
Owner Author

Branch https://github.com/diamondburned/gotk4/tree/dual-glib is made to attempt to fix this issue by adding import aliases. The issue will be kept open just in case until everything has been resolved.

@diamondburned diamondburned added the broken Changes that require refactoring label May 14, 2021
@diamondburned
Copy link
Owner Author

Fixed in 470cbd9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken Changes that require refactoring
Projects
None yet
Development

No branches or pull requests

1 participant