awslabs / llrt

LLRT (Low Latency Runtime) is an experimental, lightweight JavaScript runtime designed to address the growing demand for fast and efficient Serverless applications.
Apache License 2.0
7.73k stars 342 forks source link

fix: Avoid re-running build.rs on every build, even when nothing changed #359

Closed refi64 closed 1 month ago

refi64 commented 1 month ago

Issue # (if available)

Description of changes

from commit message:

Because build.rs depends on the bundle/ directory, whenever it also writes into it, the directory's timestamp is updated. This leads Cargo to always consider it outdated and re-run build.rs every time.

To fix this, separate the inputs to build.rs (the JS files) into a separate directory, bundle/js/, and move the compiled .lrt files to bundle/lrt/. This will keep their timestamps separate.

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

richarddavison commented 1 month ago

@refi64 CI is failing because it requires som files in bundle/js to generate compression dict, see: https://github.com/awslabs/llrt/blob/80daaadabeb314e06ebff0574da562c362e08e2a/.github/workflows/ci.yml#L31C10-L33C15 This feels a bit hacky, but I don't want project to build if the required js files haven't been provided.

refi64 commented 1 month ago

@richarddavison ah thanks, was just trying to figure out why I couldn't repro it on my end :sweat_smile: looks like that's the only use of bundle/ in the CI scripts so I think it should be working now.