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

IdentityTransform fails with FileNotFound after updating to 7.5-rc1 #20778

Closed
yigit opened this issue May 13, 2022 · 13 comments
Closed

IdentityTransform fails with FileNotFound after updating to 7.5-rc1 #20778

yigit opened this issue May 13, 2022 · 13 comments
Assignees
Labels
a:regression This used to work in:artifact-transforms in:scheduler execution plan, task graph, work lease, project lock
Milestone

Comments

@yigit
Copy link

yigit commented May 13, 2022

AndroidX Github Build started failing after updating Gradle to 7.5-rc-1 from 7.5-20220421031748+0000

First failure: androidx/androidx@dc4af65

Expected Behavior

compileReleaseJavaWithJavac task should wait for its dependencies.

Current Behavior

compileReleaseJavaWithJavac fails in IdentityTransform step with a FileNotFound exception. Unfortunately, the file is there after the build so my guess is that it is not waiting for its dependencies properly.

 Execution failed for task ':lifecycle:lifecycle-livedata-core:compileReleaseJavaWithJavac'.
2022-05-13T11:22:48.790-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not resolve all files for configuration ':lifecycle:lifecycle-livedata-core:releaseCompileClasspath'.
2022-05-13T11:22:48.790-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]    > Failed to transform lifecycle-common.jar (project :lifecycle:lifecycle-common) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.usage=java-api}.
2022-05-13T11:22:48.790-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]       > Execution failed for IdentityTransform: /Users/yboyar/src/androidx/out/activity-playground/activity-playground/lifecycle/lifecycle-common/build/libs/lifecycle-common-2.6.0-alpha01.jar.
2022-05-13T11:22:48.790-0700 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]          > File/directory does not exist: /Users/yboyar/src/androidx/out/activity-playground/activity-playground/lifecycle/lifecycle-common/build/libs/lifecycle-common-2.6.0-alpha01.jar

Context

Worked in 7.5-20220421031748+0000 (and before), started failing with 7.5-rc-1.

Steps to Reproduce

checkout AndroidX Github Repo
Might also need the one time setup instructions

cd <checkout-root>/activity
./gradlew --stop
rm -rf ~/.gradle // important to reproduce
./gradlew buildOnServer --no-build-cache --no-configuration-cache

If you re-run bOS it will succeed. You can also validate that the missing file is there after the first failure.

Your Environment

Build scan URL: https://ge.androidx.dev/s/sg2yfkiqoxpti/failure#1

@yigit yigit added a:regression This used to work to-triage labels May 13, 2022
@yigit
Copy link
Author

yigit commented May 13, 2022

also tried 7.5-20220511195339+0000. didn't work.

@big-guy big-guy added this to the 7.5 RC2 milestone May 13, 2022
@big-guy
Copy link
Member

big-guy commented May 13, 2022

Thanks @yigit. We'll try to reproduce this.

Could you give 7.5-20220501001223+0000 a try?

@yigit
Copy link
Author

yigit commented May 13, 2022

I'll try it.
meanwhile, I triggered a bunch of versions on CI.

Looks like 20220427150934 (build) is the last good one and 20220428002320 is the first failure (build)

@yigit
Copy link
Author

yigit commented May 13, 2022

@big-guy , triggered a new build for 7.5-20220501001223+0000: https://github.com/androidx/androidx/actions/runs/2321565000

@yigit
Copy link
Author

yigit commented May 13, 2022

That one failed too with the same error:

https://github.com/androidx/androidx/runs/6429070066?check_suite_focus=true

yigit added a commit to androidx/androidx that referenced this issue May 13, 2022
@liutikas
Copy link
Contributor

All the things seem to point to 0654460

copybara-service bot pushed a commit to androidx/androidx that referenced this issue May 13, 2022
see gradle/gradle#20778 for details

Bug: b/232580974
Test: CI

This is an imported pull request from #399.

Resolves #399
Github-Pr-Head-Sha: 66946a3
GitOrigin-RevId: 6d6ee13
Change-Id: If04aee87ef94025184bd47410dbab501ab7518b7
@DPUkyle
Copy link
Member

DPUkyle commented May 16, 2022

I was able to reproduce. Instead of purging the whole Gradle user home (~/.gradle), I just did:

$ rm -rf ../out/activity-playground/activity-playground/lifecycle/lifecycle-common/build/libs from the activity subproject.

This was enough to raise the error. I'll continue investigating.

DPUkyle added a commit to DPUkyle/androidx that referenced this issue Jun 7, 2022
 - Dummy dependency substitution rule prevents artifact transforms from executing too early
@DPUkyle
Copy link
Member

DPUkyle commented Jun 7, 2022

Hi @yigit and @liutikas, sorry for the delay in responding.

We've been looking at the execution graph optimizations which exposed this issue. The reality is the behavior which analyzed the inputs to transformations has been incorrect since at least Gradle 7.4, but something about the androidx setup combined with our recent optimizations has teased out this bug. Unfortunately the proper long-term fix is too disruptive to add to 7.5-rc-2.

Instead I've provided a suggested temporary workaround here. This should allow you to test with Gradle 7.5-rc-1, and we will make changes in either 7.5.1 or 7.6 which will remove the need for the workaround.

@ljacomet ljacomet removed this from the 7.5 RC2 milestone Jun 9, 2022
@ljacomet ljacomet added affects-version:7.5 in:artifact-transforms in:scheduler execution plan, task graph, work lease, project lock and removed to-triage labels Jun 10, 2022
copybara-service bot pushed a commit to androidx/androidx that referenced this issue Jun 13, 2022
This PR updates playground gradle to 7.5-rc2 (aosp is happening in parallel).
` ./gradlew wrapper --gradle-version=7.5-rc-2`

It also applies the workaround provided by the gradle team until we can update to 7.5.1 (or 7.6)

Bug: gradle/gradle#20778
Test: CI

This is an imported pull request from #413.

Resolves #413
Github-Pr-Head-Sha: de11c88
GitOrigin-RevId: acc6527
Change-Id: Id7f1dbbe6ee4d92388ce8eb3c43a678bd25065aa
@big-guy big-guy added this to the 7.6 RC1 milestone Jul 1, 2022
@big-guy
Copy link
Member

big-guy commented Jul 1, 2022

@bamboo I think Adam is looking/working on this. Do you want us to reassign it to him?

@DPUkyle
Copy link
Member

DPUkyle commented Jul 1, 2022

@bamboo I think Adam is looking/working on this. Do you want us to reassign it to him?

This issue is blocked by the root cause, which is being investigated as #20975.

@adammurdoch adammurdoch self-assigned this Jul 21, 2022
@adammurdoch
Copy link
Member

This is fixed now via #21292

@yigit
Copy link
Author

yigit commented Jul 25, 2023

Unfortunately, we are still seeing this problem with gradle 8:

https://ge.androidx.dev/s/jpkurj73xajqw

@rolgalan
Copy link

rolgalan commented Aug 1, 2023

Unfortunately, we are still seeing this problem with gradle 8:

https://ge.androidx.dev/s/jpkurj73xajqw

I can confirm we are getting exactly the same problem with Gradle 8.2 and Gradle 8.2.1 only if we enable configuration cache.

We detected while executing sonarqube, but the error happens during the kaptGenerateStubsDebugKotlin. Interestingly enough, if we run first kaptGenerateStubsDebugKotlin and then in a separate execution sonarqube, it finishes successfully.

This happens for us in our CI (on Linux AMIs, with 16 cores) but not locally (on macOS, with 8-10 cores), not sure if the extra available workers or the OS might be connected. This is a project around 140 modules and it always fails in one of the first ones (required by another 14 modules).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:regression This used to work in:artifact-transforms in:scheduler execution plan, task graph, work lease, project lock
Projects
Development

No branches or pull requests

7 participants