Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Turborepo): wire file hashing to grpc server #7868

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

gsoltis
Copy link
Contributor

@gsoltis gsoltis commented Mar 29, 2024

Description

  • Wire up daemon-backed file hashing into the client

Testing Instructions

Existing integration test suite

Closes TURBO-2736

Copy link

vercel bot commented Mar 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-kitchensink-blog 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 11:35pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 11:35pm
examples-svelte-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 11:35pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 11:35pm
turbo-turbo-tracing-next-plugin ❌ Failed (Inspect) Apr 16, 2024 11:35pm
6 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 11:35pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 11:35pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 11:35pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 11:35pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 11:35pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 11:35pm

Copy link
Contributor Author

gsoltis commented Mar 29, 2024

Copy link
Contributor

github-actions bot commented Mar 29, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Mar 29, 2024

🟢 CI successful 🟢

Thanks

@gsoltis gsoltis force-pushed the 03-25-feat_turborepo_file_hash_watching branch from babe8ee to 1ba0d7a Compare April 1, 2024 19:41
@gsoltis gsoltis force-pushed the 03-29-feat_turborepo_wire_file_hashing_to_grpc_server branch from 6d7d52a to ceea917 Compare April 1, 2024 19:41
@gsoltis gsoltis force-pushed the 03-25-feat_turborepo_file_hash_watching branch from 1ba0d7a to de642b3 Compare April 1, 2024 23:40
@gsoltis gsoltis force-pushed the 03-29-feat_turborepo_wire_file_hashing_to_grpc_server branch from ceea917 to 2e706a9 Compare April 1, 2024 23:40
@gsoltis gsoltis force-pushed the 03-25-feat_turborepo_file_hash_watching branch 2 times, most recently from ac229a4 to 93d74a7 Compare April 2, 2024 17:23
@gsoltis gsoltis force-pushed the 03-29-feat_turborepo_wire_file_hashing_to_grpc_server branch from 2e706a9 to cc9adaa Compare April 2, 2024 17:23
@gsoltis gsoltis force-pushed the 03-25-feat_turborepo_file_hash_watching branch from 93d74a7 to 8478cd5 Compare April 2, 2024 17:45
@gsoltis gsoltis force-pushed the 03-29-feat_turborepo_wire_file_hashing_to_grpc_server branch from cc9adaa to 4e290a9 Compare April 2, 2024 17:45
@gsoltis gsoltis force-pushed the 03-25-feat_turborepo_file_hash_watching branch from 8478cd5 to 232ce61 Compare April 2, 2024 19:14
@gsoltis gsoltis force-pushed the 03-29-feat_turborepo_wire_file_hashing_to_grpc_server branch from 4e290a9 to ea03d90 Compare April 2, 2024 19:14
Copy link
Contributor

@NicholasLYang NicholasLYang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one clarification but otherwise looks good

}
}
});
let mut hash_object = match hash_object {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not very important but you could probably use or_else or unwrap_or_else here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at doing that, but it gets awkward since we're starting with an Option, but the fallback calculation produces a Result where we want to short-circuit, but the overall closure returns an Option<Result<_, _>>. ? doesn't really work in that context, so you end up with the match either way.

// active tokio context. Constructing it directly in
// the rayon thread doesn't provide one and will crash at runtime.
handle
.block_on(async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by the docs for this method. It says the method panics "if called within an asynchronous execution context". Does that mean if it's called in an async function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially, yes, if it's running from a task managed by an async runtime, it will panic. In this case, we're running from the rayon threadpool.

@gsoltis gsoltis merged commit 3b8caf0 into main Apr 18, 2024
55 checks passed
@gsoltis gsoltis deleted the 03-29-feat_turborepo_wire_file_hashing_to_grpc_server branch April 18, 2024 20:00
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