AWS Lambda layers with diffoscope and some tools it needs.
Either take a .zip package generated for the current release or build it yourself, e.g.
./make_layer.sh python3.6and upload with
./upload_layer.sh python3.6 # requires properly configured "aws" commandFirst, you need to set two environment variables:
MAGIC=/usr/share/misc/magic:/opt/magic
LD_PRELOAD=/opt/lib/libarchive.soSecond, use this snippet to run diffoscope:
fromdiffoscope.loggingimportline_eraser, setup_loggingfromdiffoscope.mainimportcreate_parser, run_diffoscopefromdiffoscope.profilingimportProfileManager, profilefromdiffoscope.progressimportProgressManager, Progressdefhandler(event, context):
# ...args= [files[v1], files[v2], "--html", output_file]
withprofile("main", "parse_args"):
parser, post_parse=create_parser()
parsed_args=parser.parse_args(args)
print(parsed_args)
log_handler=ProgressManager().setup(parsed_args)
withsetup_logging(parsed_args.debug, log_handler) aslogger:
post_parse(parsed_args)
run_diffoscope(parsed_args)
# serve output_file as text/html