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

Support Apple.Core as an indirect dependency #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

VMaldecoasago
Copy link

@VMaldecoasago VMaldecoasago commented Jul 4, 2024

Changes

  • Fix Apple.Core does not find native binaries when it is an indirect dependency

Steps to reproduce

  1. Create a Unity package
  2. Reference Apple.Core in the package and NOT on the main Unity project
  3. Notice how the plugin does not find native binaries

@VMaldecoasago VMaldecoasago changed the title Fix native binaries when Apple.Core is an indirect dependency Support Apple.Core as an indirect dependency Jul 8, 2024
DodgyTim pushed a commit to dodgy-ltd/apple-unityplugins that referenced this pull request Jul 14, 2024
@VMaldecoasago VMaldecoasago force-pushed the fix/apple-core-as-indirect-dependency branch from afb492d to b8127f0 Compare November 27, 2024 12:16
@VMaldecoasago
Copy link
Author

Up @AdamSzApple

@AdamSzApple
Copy link
Collaborator

Thanks for raising this issue. It seems like a simple fix, but with possible side effects. Such as:

  1. What about circular dependencies? Are they even possible?
  2. What about references to different versions of the same package? How would those be resolved?
  3. What about multiple references to the same package? Do those need to be deduplicated?

@VMaldecoasago
Copy link
Author

Thank you so much for looking at it.

In summary, none of these side-effects are possible, because Unity Package Manager (UPM) is heavily based on the npm JavaScript package manager, which is very robust and industry-tested and handle all of these cases well.

Furthermore, this change will not affect any of the current Apple Plugin's users, because it just extends support to indirect dependencies, without any behavior change to the projects that only use it as a direct dependency.

  1. What about circular dependencies? Are they even possible?

They are possible, but not advisable. UPM handles it without causing infinite loops or anything like it.

  1. What about references to different versions of the same package? How would those be resolved?

UPM chooses the highest compatible one, or throws an error in case different packages depend on different major versions of the same package

  1. What about multiple references to the same package? Do those need to be deduplicated?

They do not need to be deduplicated, as UPM does it for us. The dependency resolution is done at a previous step, and we get its final list.

I also tested each of these cases, and the call to Client.List(false, true) simply returns the already resolved list of packages, just as before, except that now it includes also the indirect ones.

In case you are still concerned of affecting the current users of Apple.Core, please let me know if you'd prefer that I include this change as a parameter in the AppleBuildProfile configuration that defaults to the current behavior.

Thank you,
Victor

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

Successfully merging this pull request may close these issues.

2 participants