aws / aws/aws-cdk

(lambda): lambda.Runtime.JAVA_21.bundlingImage changed from providing Gradle 8.4 to Gradle 9, breaking builds

Open
#38,404 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-lambda bug effort/small guidance p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

`lambda.Runtime.JAVA_21.bundlingImage` resolves to `public.ecr.aws/sam/build-java21` so any change in the image will propagate, and the underlying image changed provided Gradle version between versions 1.153 and 1.154. This breaks build that depend on documented behaviour in Gradle 8.4 that was removed in Gradle 9, specifically the -c/--settings-file cli option

See https://github.com/aws/aws-sam-build-images/issues/203

### Regression Issue

- [ ] Select this option if this issue appears to be a regression.

### Last Known Working CDK Library Version

independent of CDK library version

### Expected Behavior

That existing CDK projects with bundling options should continue to build.

See https://github.com/aws/aws-sam-build-images/issues/203

### Current Behavior

Existing CDK lambda projects break if they use gradle with -c or --settings-file cli option.

See https://github.com/aws/aws-sam-build-images/issues/203

### Reproduction Steps

See https://github.com/aws/aws-sam-build-images/issues/203

### Possible Solution

Pin lambda.Runtime.JAVA_21.bundlingImage to latest working image tag, introduce new constant for Gradle 9. Better maintain two independent image tags.

### Additional Information/Context

_No response_

### AWS CDK Library version (aws-cdk-lib)

any version

### AWS CDK CLI version

any version

### Node.js Version

any version

### OS

any

### Language

Java

### Language Version

Java 21

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the lambda.Runtime.JAVA_21.bundlingImage entry point and compare the image behavior between versions 1.153 and 1.154. Read aws-sam-build-images issue 203 for the reproduction and image context; done means existing Java 21 CDK projects using -c or --settings-file build successfully while a separate Gradle 9 image option remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java
Domain
build-system, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.