Synth generates new assets on each run #27280
Replies: 3 comments
-
Looks like the asset ids are being generated based on the current path. The path in the container is new each time (/codebuild/output/srcXXXXXXXX/src). Because of that the assets are new on each synth(). It looks like I am doing something wrong. Any input would be really helpful. What is the standard way to do synthesized files caching in CodePipeline? How can I make CodeBuild to not generate new assets each time? |
Beta Was this translation helpful? Give feedback.
-
Nevermind I found out that our lambdas have their base class redefined, and the bundling uses full path instead of the relative one. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a strange issue in my CodePipeline. 'cdk synth' generates new assets for all bundled assets in each run.
For example here are an asset for a lambda:
index.js index.meta.json index.js.map
At first run it is placed in the asset.fdce21718a4f7a8581303fce3acd019cef5a860374122d76dec11000589d2253, the next run it goes into asset.9d18db04ce59290e3a058c8458c6171a49376b3f8c4aca15f59edd5f6d326334
The index.js and index.js.map are exactly the same and here is the difference between index.meta.json:
`
Comparing files index.meta.json and ASSET.9D18DB04CE59290E3A058C8458C6171A49376B3F8C4ACA15F59EDD5F6D326334\INDEX.META.JSON
***** index.meta.json
"outputs": { "cdk.out/asset.fdce21718a4f7a8581303fce3acd019cef5a860374122d76dec11000589d2253/index.js.map": { "imports": [],
***** ASSET.9D18DB04CE59290E3A058C8458C6171A49376B3F8C4ACA15F59EDD5F6D326334\INDEX.META.JSON
"outputs": { "cdk.out/asset.9d18db04ce59290e3a058c8458c6171a49376b3f8c4aca15f59edd5f6d326334/index.js.map": { "imports": [],
***** index.meta.json
},"cdk.out/asset.fdce21718a4f7a8581303fce3acd019cef5a860374122d76dec11000589d2253/index.js": { "imports": [
***** ASSET.9D18DB04CE59290E3A058C8458C6171A49376B3F8C4ACA15F59EDD5F6D326334\INDEX.META.JSON
},"cdk.out/asset.9d18db04ce59290e3a058c8458c6171a49376b3f8c4aca15f59edd5f6d326334/index.js": { "imports": [
`
So difference basically only in the reference on the asset hash which should not affect the hash.
Currently all the lambda functions are being re-synthesized and the cache does not help.
This does not happen for assets, which contains images only or other fixed files, it will be something like asset.3d0e5fc...8801 on every run.
I couldn't reproduce this locally. This happens only on CodeBuild container. CDK version is 2.97.0.
Could somebody suggest how this can be fixed or debugged further?
Beta Was this translation helpful? Give feedback.
All reactions