Skip to content

Switch to android-games-sdk-rs submodule? #190

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

Closed
jb55 opened this issue Mar 13, 2025 · 5 comments
Closed

Switch to android-games-sdk-rs submodule? #190

jb55 opened this issue Mar 13, 2025 · 5 comments

Comments

@jb55
Copy link

jb55 commented Mar 13, 2025

As suggested by @MarijnS95, to ease maintainability of updating android-games-sdk, it would be ideal if we could use a submodule of android-games-sdk with our patches on top. This would allow us to continue to hack on the upstream files when we need to, and make it easier to rebase these changes on future versions of game-activity and game-text-input.

In:

I first had to revert all of the existing patches on top of 2.0.2, and then re-apply them on top of 4.0.0. To do this every time would be error prone and time consuming.

The downside of the submodule approach is that the android-games-sdk is like 200mb+, which is a bit crazy for a few files. This is an inconvenience but the revert and re-apply dance on every new version is also very annoying.

I've created https://github.com/jb55/android-games-sdk-rs with patches on top of v4.0.0. If a submodule is acceptable, I can rework #189 to use this approach, otherwise I will continue with #189 the way it is. @rib @MarijnS95

@rib
Copy link
Member

rib commented Mar 14, 2025

hmm, submodules has rarely made anything better in my experience.

Most people don't remember or consider having to do the submodule init and so it becomes an annoying extra step whenever you clone a repo with submodules since they still aren't seamlessly integrated into Git.

This could have maybe been a bit easier without needing to do the explict revert of the existing game-sdk patches. It could have worked to first import a new snapshot of v4.0.0 and then re-cherry-pick the old patches that are still applicable.

Maintaining a games-sdk branch with our patches does sound good though - regardless of whether we then import that with a submodule.

Maybe we could have a submodule that is optional, that's useful when we do these periodic updates to the latest version, but when we're done we just copy the result in-tree so that 99.99% of the time anyone can just clone the repo and not have to think about git submodules.

Maybe we could tweak build.rs so that it can check for a third-party/game-sdk directory - or anything similar - and if it sees that the submodule has been fetched then that will take precedence.

That could then be used for development when updating the game-sdk, without imposing git submodules for others.

@rib
Copy link
Member

rib commented Mar 14, 2025

One concern with even having submodules be used optionally for this kind of development is that cargo apparently doesn't have great support for submodules: rust-lang/cargo#7987

If the submodule is pretty large then an optional submodule might be annoying for anyone that wants to patch their android-activity dependency and fetch via Git.

@jb55
Copy link
Author

jb55 commented Mar 14, 2025

I guess we can just copy the needed files over from the android-games-sdk-rs repo. at least now that the paths are aligned we can in theory patch things back and forth easier, and we still have the repo for rebasing patches.

@jb55
Copy link
Author

jb55 commented Mar 14, 2025

@rib
Copy link
Member

rib commented Apr 4, 2025

Since the current plan with #191 is to avoid adding a dependency on Git submodules (and we will instead import the small number of files we need from the games-sdk by copying them), then I think we can close this issue now.

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

No branches or pull requests

2 participants