elastic / elastic/logstash

Prepare for Grade 10

Open
#19,441 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

Updating to Gradle 10 could involve a couple of fixes:
1. make scripts ready for configuration cache
2. resolve compatibility issues highlighted running with `--warning-mode`

## Configuration cache

Configuration Cache improves build performance by caching the result of the configuration phase and reusing it for subsequent builds.
In Gradle 10 Configuration Cache is enabled by default.
To test previous versions edit `gradle.properties` and add:

```properties
org.gradle.configuration-cache=true
```

Running this on #19216
```shell
./gradlew :logstash-core:test
```
result in:
```
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Invocation of 'Task.project' by task ':downloadJRuby' at execution time is unsupported with the configuration cache.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Configuration cache problems found in this build.

5 problems were found storing the configuration cache, 4 of which seem unique.
- Task `:buildCustomJRuby` of type `org.gradle.api.tasks.Exec`: cannot serialize object of type 'java.io.ByteArrayOutputStream', a subtype of 'java.io.OutputStream', as these are not supported with the configuration cache. Only 'System.out' or 'System.err' can be used there.
See https://docs.gradle.org/9.7.0/userguide/configuration_cache_requirements.html#config_cache:requirements:disallowed_types
- Task `:downloadJRuby` of type `de.undercouch.gradle.tasks.download.Download`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
See https://docs.gradle.org/9.7.0/userguide/configuration_cache_requirements.html#config_cache:requirements:disallowed_types
- Task `:verifyFile` of type `de.undercouch.gradle.tasks.download.Verify`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
See https://docs.gradle.org/9.7.0/userguide/configuration_cache_requirements.html#config_cache:requirements:disallowed_types
- Task `:downloadJRuby` of type `de.undercouch.gradle.tasks.download.Download`: invocation of 'Task.project' at execution time is unsupported with the configuration cache.
See https://docs.gradle.org/9.7.0/userguide/configuration_cache_requirements.html#config_cache:requirements:use_project_during_execution
```

## Resolve warnings

Previous version of Gradle can provide insights on what's going to generate error in the next one.
Run the following command to discover and fix the issues:

```sh
./gradlew clean --warning-mode all
```

Contributor guide

Open the contributing guide

Research direction

Start by reading gradle.properties and reproducing the configuration-cache failures with ./gradlew :logstash-core:test. Investigate the downloadJRuby, buildCustomJRuby, and verifyFile tasks, then run ./gradlew clean --warning-mode all. Done means the build works with configuration cache enabled and the reported Gradle warnings and compatibility failures are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.