chore: make examples compile#18020
chore: make examples compile#18020mergify[bot] merged 14 commits intoaws:masterfrom kaizencc:compile-modules
Conversation
| return false; | ||
| }, | ||
| }, | ||
| local: {tryBundle}, |
There was a problem hiding this comment.
Will this compile in Python too?
There was a problem hiding this comment.
It passes rosetta:extract --compile so it should. However, this entire PR is waiting on a fix in backup I'm going to make very soon (which is why build is failing).
edit: nevermind, no fix necessary.
There was a problem hiding this comment.
This won't work actually. If Rosetta doesn't flag this, that's a bug in Rosetta.
You need to declare an explicit class that implements the right interface.
There was a problem hiding this comment.
Rip rosetta. I can investigate what is going on in rosetta later. In fact, I looked back at what I did in lambda-go which also included a bundling function. I recall that rosetta:extract --compile did not pass there and what I did was end up making that example a text snippet and say that the snippet is only available in TypeScript.
Which I guess is bad for the Python folks because I'm basically saying, sorry this doesn't work in Python.
You need to declare an explicit class that implements the right interface.
That seems to be what #17928 tried and it did not work.
| return false; | ||
| }, | ||
| }, | ||
| local: {tryBundle}, |
There was a problem hiding this comment.
This won't work actually. If Rosetta doesn't flag this, that's a bug in Rosetta.
You need to declare an explicit class that implements the right interface.
|
I ran @jsii.implements(ILocalBundling)
class myBundle:
def try_bundle(self, output_dir, *, image, entrypoint=None, command=None, volumes=None, environment=None, workingDirectory=None, user=None, local=None, outputType=None, securityOpt=None):
can_run_locally = True # replace with actual logic
if can_run_locally:
# perform local bundling here
return True
return False
assets.Asset(self, "BundledAsset",
path="/path/to/asset",
bundling=BundlingOptions(
local=my_bundle(),
# Docker bundling fallback
image=DockerImage.from_registry("alpine"),
entrypoint=["/bin/sh", "-c"],
command=["bundle"]
)
)I think this looks good to go. The rest of the PR should still be gtg as well. |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Done for a bunch of modules: - custom-resources - backup - s3-assets - s3-notifications - s3-deployment - config - cloudtrail ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Done for a bunch of modules:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license