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

Fix problems from async build process #38

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

detjensrobert
Copy link
Contributor

The deploy command needs to call build, and this was causing problems with nested Tokio runtimes. This fixes the problem by making the last bits of the build process (artifact extraction) properly async instead of blocking with #[tokio::main].

This exposed a couple other problems from running artifacts in 'parallel'; asset containers can have name collisions. This adds a new dependency fastrand to create a discriminator to prevent collisions. (Rust does not have rand generation in the stable stdlib yet.)

Additionally, I added an Iterator trait to use futures::try_join_all() as a chained method instead of a wrapper. This makes awaiting many futures cleaner to follow.

These were causing nested tokio runtime panics when calling `build()` from
`deploy()`. All of the callers are async functions anyway, so these can be
true async functions now.

Signed-off-by: Robert Detjens <[email protected]>
This is cleaner than needing to wrap the whole iterator in a call to
futures::try_join_all().

Signed-off-by: Robert Detjens <[email protected]>
Signed-off-by: Robert Detjens <[email protected]>
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.

1 participant