Skip to content

JSII_RUNTIME_PACKAGE_CACHE always false bug #3911

@Ragnoroct

Description

@Ragnoroct

Describe the bug

Correct me if I'm wrong but won't packageCacheEnabled always be false? Since JSII_RUNTIME_PACKAGE_CACHE is converted to uppercase and compared to a lowercase string literal.

See code here
https://github.com/aws/jsii/blob/main/packages/@jsii/kernel/src/tar-cache/index.ts#L26-L27

Expected Behavior

export JSII_RUNTIME_PACKAGE_CACHE=enabled should enable caching.

Current Behavior

No caching.

after running cdk synth with that env variable

ls: cannot access '/home/myuser/.cache/aws/jsii/package-cache': No such file or directory

Reproduction Steps

pip install aws-cdk-lib then cdk synth for a very simple stack in python.

Possible Solution

Change the line of code https://github.com/aws/jsii/blob/main/packages/@jsii/kernel/src/tar-cache/index.ts#L26-L27

- let packageCacheEnabled = process.env.JSII_RUNTIME_PACKAGE_CACHE?.toLocaleUpperCase() === 'enabled'
+ let packageCacheEnabled = process.env.JSII_RUNTIME_PACKAGE_CACHE?.toLocaleLowerCase() === 'enabled'

Additional Information/Context

This is using python cdk version 2.59.0

SDK version used

jsii 1.72.0

Environment details (OS name and version, etc.)

Ubuntu 22.04.1 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions