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: ensure cosign client can be sent between threads #275

Conversation

flavio
Copy link
Member

@flavio flavio commented Jun 1, 2023

After d9b198a got merged, the Sync and Send supertraits got removed from the ClientCapabilities trait. This was done to ensure the code could build when the wasm32 target is used.

Unfortunately, this makes impossible to send the cosign client between threads. This causes an error like the following one:

error: future cannot be sent between threads safely
the trait `Send` is not implemented for `(dyn sigstore::registry::ClientCapabilities + 'static)`

This commit fixes the issue by introducing conditional compilation checks.

After d9b198a got merged, the
`Sync` and `Send` supertraits got removed from the `ClientCapabilities`
trait. This was done to ensure the code could build when the `wasm32`
target is used.

Unfortunately, this makes impossible to send the cosign client between
threads. This causes an error like the following one:

```
error: future cannot be sent between threads safely
the trait `Send` is not implemented for `(dyn sigstore::registry::ClientCapabilities + 'static)`
```

This commit fixes the issue by introducing conditional compilation
checks.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@flavio
Copy link
Member Author

flavio commented Jun 1, 2023

Once this is merged I would like to tag the v0.7.1 release

@flavio flavio requested a review from a team June 1, 2023 13:17
@Xynnn007
Copy link
Member

Xynnn007 commented Jun 1, 2023

Hey I love this PR. Before this we have to create a temporary runtime to handle this

Copy link
Collaborator

@viccuad viccuad left a comment

Choose a reason for hiding this comment

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

LGTM!

@flavio flavio merged commit bb90618 into sigstore:main Jun 1, 2023
@flavio flavio deleted the fix-cosign-client-cannot-be-sent-across-threads-error branch June 1, 2023 15:02
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.

3 participants