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

Is there a reason RealmTransformerTask isn't cacheable? #7858

Closed
oheyadam opened this issue Nov 20, 2023 · 4 comments
Closed

Is there a reason RealmTransformerTask isn't cacheable? #7858

oheyadam opened this issue Nov 20, 2023 · 4 comments

Comments

@oheyadam
Copy link

Problem

RealmTransformerTask is on the critical path for us, but it's not cacheable according to our build scans. Is there a reason for that?

Solution

Would it be possible to make this task cacheable, or is there a reason it's not?

Alternatives

No response

How important is this improvement for you?

Would be a major improvement

Feature would mainly be used with

Local Database only

@rorbech
Copy link
Contributor

rorbech commented Nov 20, 2023

What exactly is reported to be the issue? I have tried to enable configuration caching in a sample project and it does work. Maybe related to specific versions of Gradle, AGP and realm.

Could you supply a reproducing project or try to fill in the information of the actual reported observation (stack trace, build/scan error, etc.) and the Gradle, AGP and Realm versions, etc. corresponding to the info requested in this form https://github.com/realm/realm-java/issues/new?assignees=&labels=T-Bug&projects=&template=bug.yml

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Nov 20, 2023
@oheyadam
Copy link
Author

Hey @rorbech, yea sorry my bad for not providing more information. Here's a screenshot from our build scan and you can see Gradle says this task doesn't have caching enabled. It's one of our longest running tasks as well.

We do have configuration cache enabled, and that works as you described, but configuration cache is different from the build cache. To make a task build-cacheable, you annotate it with the @Cacheable annotation. More docs here. Sorry if you're already aware of all of this, not trying to over-explain things--just thought I'd send links.

We're running Android Studio Giraffe v2022.3.1, patch 4, Gradle v8.4, AGP v8.1.4 and realm-gradle-plugin v10.16.1.

SCR-20231122-jrks

@github-actions github-actions bot added Needs-Attention and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Nov 22, 2023
@rorbech
Copy link
Contributor

rorbech commented Dec 4, 2023

Hi @oheyadam. It is not by design that our task should not be cacheable. Your screenshot points out that our task depends on the runtime_library_classes_jar. We are depending on the library runtime classes, since a model definition can reference classes in other modules. If some of the dependencies changes we will have to rerun our transformer. Is that the explanation you were looking for?

@sync-by-unito sync-by-unito bot added More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention labels Dec 4, 2023
@oheyadam
Copy link
Author

oheyadam commented Dec 4, 2023

Yep, absolutely. Thank you very much!

@oheyadam oheyadam closed this as completed Dec 4, 2023
@github-actions github-actions bot added Needs-Attention and removed More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Dec 4, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants