Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSII_RUNTIME_PACKAGE_CACHE always false bug #3911

Closed
Ragnoroct opened this issue Jan 11, 2023 · 1 comment · Fixed by #3912
Closed

JSII_RUNTIME_PACKAGE_CACHE always false bug #3911

Ragnoroct opened this issue Jan 11, 2023 · 1 comment · Fixed by #3912
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@Ragnoroct
Copy link
Contributor

Ragnoroct commented Jan 11, 2023

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

@Ragnoroct Ragnoroct added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 11, 2023
@mergify mergify bot closed this as completed in #3912 Feb 16, 2023
mergify bot pushed a commit that referenced this issue Feb 16, 2023
Fix bug where cached enabled is always false.
fixes #3911

It took me a good 4 minutes to figure out that the PR title needs a to be prefixed with `fix:` including the colon 😄 

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant