gradle / gradle

Adaptable, fast automation for all
https://gradle.org
Apache License 2.0
16.99k stars 4.77k forks source link

Configuration cache is not invalidated when creating a buildSrc directory #31097

Open wolfs opened 3 weeks ago

wolfs commented 3 weeks ago

Current Behavior

When creating a buildSrc directory with contents in a project that didn't have one, yet, the next build might be a configuration cache hit.

Expected Behavior

Creating a buildSrc directory should invalidate the configuration cache entry.

Context (optional)

No response

Self-contained Reproducer Project

Start with the unmodified issue-reproducer

  1. run ./gradlew help --configuration-cache causing a configuration cache store
  2. add buildSrc/src/main/groovy/MyClass.groovy with contents class MyClass {}
  3. run ./gradlew help --configuration-cache - a configuration cache hit.

Gradle version

8.12 nightly, see the build scan

Build scan URL (optional)

https://ge.gradle.org/s/sxc7wtf7dlpvy/performance/configuration

Your Environment (optional)

See https://ge.gradle.org/s/sxc7wtf7dlpvy/performance/configuration

ljacomet commented 3 weeks ago

Given this happens on the main branch, adding to the future 8.12 RC1 to make sure this gets fixed.

@gradle/bt-configuration Could you check this does not happen in 8.11?

mlopatkin commented 3 weeks ago

Could you check this does not happen in 8.11?

This never worked properly.