Skip to content

Add BuildPattern::AlwaysLazy to enable lazy building for both debug and release.#257

Open
lgarron wants to merge 1 commit intobaoyachi:masterfrom
lgarron:AlwaysLazy
Open

Add BuildPattern::AlwaysLazy to enable lazy building for both debug and release.#257
lgarron wants to merge 1 commit intobaoyachi:masterfrom
lgarron:AlwaysLazy

Conversation

@lgarron
Copy link
Copy Markdown

@lgarron lgarron commented Mar 23, 2026

This allows developers to benefit from shadow-rs when incremental release builds are necessary for development: #232

AlwaysLazy is a bit of a funky name. It would be more intuitive for Lazy to be something like LazyInDebug, so that Lazy is… simply "lazy". But that would be a breaking change to the build API at this point.

This introduces a bit of a footgun, because it allows the timestamp for a release build to be arbitrarily far out of date. A better middle ground might be to support rounding to a recent timestamp like midnight UTC (similar to what Chromium implemented: https://chromium.googlesource.com/chromium/src.git/+/08d91b75212b6592f05ff993d5a71c0f5a546563 ). But AlwaysLazy is a simple fix that unblocks shadow-rs for some use cases with minimal code changes for now.

… and release.

This allows developers to benefit from `shadow-rs` when incremental release builds are necessary for development: baoyachi#232

`AlwaysLazy` is a bit of a funky name. It would be more intuitive for `Lazy` to be something like `LazyInDebug`, so that `Lazy` is… simply "lazy". But that would be a breaking change to the build API at this point.

This introduces a bit of a footgun, because it allows the timestamp for a release build to be arbitrarily far out of date. A better middle ground might be to support rounding to a recent timestamp like midnight UTC (similar to what Chromium implemented: https://chromium.googlesource.com/chromium/src.git/+/08d91b75212b6592f05ff993d5a71c0f5a546563 ). But `AlwaysLazy` is a simple fix that unblocks `shadow-rs` for some use cases with  minimal code changes for now.
@baoyachi
Copy link
Copy Markdown
Owner

@lgarron Why not use SOURCE_DATE_EPOCH env arg instead of this. See:#252

@lgarron
Copy link
Copy Markdown
Author

lgarron commented Apr 1, 2026

@lgarron Why not use SOURCE_DATE_EPOCH env arg instead of this. See:#252

I tried a few things and couldn't get it to produce a fast no-op for release mode. I'd be glad to know if there is a way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants