-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-lambda-nodejsbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2
Description
Describe the bug
When a bun lockfile contains additional entries compared to what's installed in the docker container at bundling time, the bundling fails with this error:
error: lockfile had changes, but lockfile is frozen
note: try re-running without --frozen-lockfile and commit the updated lockfileRegression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
N/A - this is new behavior I implemented against #31753
Expected Behavior
I expect changes to the lockfile to be allowed and the synth to pass.
Current Behavior
error: lockfile had changes, but lockfile is frozen
note: try re-running without --frozen-lockfile and commit the updated lockfileReproduction Steps
See blimmer/cdk-bug-reports#3 for a working repro case.
Possible Solution
We need to not enforce --frozen-lockfile, like we do for other package managers:
aws-cdk/packages/aws-cdk-lib/aws-lambda-nodejs/lib/package-manager.ts
Lines 34 to 49 in fb2b229
| case LockFile.YARN: | |
| return new PackageManager({ | |
| lockFile: LockFile.YARN, | |
| installCommand: logLevel && logLevel !== LogLevel.INFO ? ['yarn', 'install', '--no-immutable', '--silent'] : ['yarn', 'install', '--no-immutable'], | |
| runCommand: ['yarn', 'run'], | |
| }); | |
| case LockFile.PNPM: | |
| return new PackageManager({ | |
| lockFile: LockFile.PNPM, | |
| installCommand: logLevel && logLevel !== LogLevel.INFO ? ['pnpm', 'install', '--reporter', 'silent', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy', '--no-prefer-frozen-lockfile'] : ['pnpm', 'install', '--config.node-linker=hoisted', '--config.package-import-method=clone-or-copy', '--no-prefer-frozen-lockfile'], | |
| // --config.node-linker=hoisted to create flat node_modules without symlinks | |
| // --config.package-import-method=clone-or-copy to avoid hardlinking packages from the store | |
| // --no-prefer-frozen-lockfile (works the same as yarn's --no-immutable) Disable --frozen-lockfile that is enabled by default in CI environments (https://github.com/pnpm/pnpm/issues/1994). | |
| runCommand: ['pnpm', 'exec'], | |
| argsSeparator: '--', | |
| }); |
Additional Information/Context
No response
CDK CLI Version
2.175.1
Framework Version
No response
Node.js Version
22 LTS
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-lambda-nodejsbugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2