Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@
# build has no randomness without JavaScript glue. Fingerprints and diffs never use it, so it's left unsupported.
[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="unsupported"']

# Tests run queued jobs and event listeners inline (a sync queue), so a build's processing can process another build
# inside it (a merge commit's build woken when the pull request's head build concludes). A debug build's `process`
# keeps a large frame on the stack (about 0.5 MB per nested run): the deepest test needs about 2.5 MB, past the 2 MB
# test threads get by default. Keep this tight, so a new deep stack still fails here. Release builds use far smaller
# frames, and production runs each job on its own.
[env]
RUST_MIN_STACK = "4194304"
11 changes: 11 additions & 0 deletions app/src/domain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,14 @@ pub mod reviews;
pub mod shutdown;
pub mod snapshots;
pub mod summary;

/// `Box::pin(make())`, with the future built in this function's stack frame rather than the caller's.
///
/// A debug build gives every temporary of an async fn its own slot in its poll's stack frame, a future it boxes at once
/// included, so an async fn that awaits many steps has a frame the size of all of them. Built here, the caller's frame
/// holds a pointer. Tests run queued jobs and event listeners inline (a sync queue), so a build's processing runs inside
/// the request that finalized it, and a merge commit's build inside its pull request's (`processing::finished`): use
/// this for the steps on that path, which overflowed the test threads' 2 MB stacks when they were built in place.
pub fn boxed<F: std::future::Future>(make: impl FnOnce() -> F) -> std::pin::Pin<Box<F>> {
Box::pin(make())
}
Loading
Loading