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

Setting org.gradle.unsafe.isolated-projects not causing recalculation of configuration cache #26049

Closed
mathjeff opened this issue Aug 8, 2023 · 3 comments · Fixed by #26204
Closed
Assignees
Milestone

Comments

@mathjeff
Copy link
Contributor

mathjeff commented Aug 8, 2023

Current Behavior

I'm finding that when I run ./gradlew --configuration-cache ${someArguments} && ./gradlew --configuration-cache -Dorg.gradle.unsafe.isolated-projects=true ${someArguments} , then if the first build succeeds and populates the configuration cache, it prevents the second build from verifying project isolation compatibility: instead it reuses the configuration cache entry created by the first build.

Expected Behavior

I think it would be nice if org.gradle.unsafe.isolated-projects could be declared as an input to the configuration cache so that a previous successful build without project isolation enabled won't cause project isolation validation to be subsequently skipped

Context (optional)

I'm working towards enabling project isolation (in AndroidX) and we have a large collection of violations.

For the moment, my process is:

  1. Run a small subset of the build with project isolation enabled, attempt to fix one project isolation error, and repeat until the specific error appears to be fixed. The build still fails, but it should have fewer errors.
  2. Rerun the build without project isolation enabled, to make sure I didn't accidentally break anything.
  3. Go back to 1 and try to fix another error

Sometimes step 3 will succeed because step 2 succeeded, making me incorrectly think that I might have fixed the project isolation error when actually the reason is that the configuration phase was skipped.

Steps to Reproduce

See https://github.com/mathjeff/gradle-samples-2/tree/main/configuration-cache-ignoring-project-isolation

Gradle version

8.3-rc-1

Build scan URL (optional)

No response

Your Environment (optional)

No response

@ov7a
Copy link
Member

ov7a commented Aug 9, 2023

Thank you for your interest in Gradle!

This issue needs a decision from the team responsible for that area. They have been informed. Response time may vary.

@ov7a ov7a added in:configuration-cache Configuration Caching 👋 team-triage Issues that need to be triaged by a specific team in:isolated-projects and removed to-triage labels Aug 9, 2023
@mlopatkin mlopatkin removed the 👋 team-triage Issues that need to be triaged by a specific team label Aug 15, 2023
@alllex alllex self-assigned this Aug 23, 2023
@alllex
Copy link
Member

alllex commented Aug 23, 2023

@mathjeff, thank you for this great reproducer experience! This is probably the best one I've seen ⭐

Maybe a small thing to improve: it seems, maybe macOS-specific, but the -rf flags at the end of the rm command are not taken into account, and the reproducer fails on the first run.

rm build .gradle log -rf
rm: build: No such file or directory
...

If you move them in front like rm -rf ..., then the non-existent directories are ignored, as per the -f flag.

bot-gradle added a commit that referenced this issue Aug 30, 2023
…Configuration Cache key

<!--- The issue this PR addresses -->
Fixes #26049

### Reviewing cheatsheet

Before merging the PR, comments starting with
- ❌ ❓**must** be fixed
- 🤔 💅 **should** be fixed
- 💭 **may** be fixed
- 🎉 celebrate happy things

Co-authored-by: Alex Semin <asemin@gradle.com>
@bot-gradle bot-gradle added this to the 8.4 RC1 milestone Aug 31, 2023
@mathjeff
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment