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 minimal versions #1108

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Fix minimal versions #1108

merged 2 commits into from
Sep 18, 2023

Conversation

nepalez
Copy link
Contributor

@nepalez nepalez commented Sep 15, 2023

Here I checked and then fixed minimal versions for transitive dependencies of the async-nats.

cargo +nightly update -Zminimal-versions
cargo check --package async-nats --all-targets

After the fixes it got green.

See detailed explanations in the commit messages

The version 0.3.0 incorrectly uses ed25519-dalek.

To reproduce the problem:

    cargo +nightly update -Z minimal-versions
    cargo check --package async-nats --all-targets

Returned the following:

    error[E0599]: no associated item named `BYTE_SIZE` found for struct `ed25519_dalek::Signature` in the current scope
       --> /home/nepalez/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nkeys-0.3.0/src/lib.rs:257:58
        |
    257 |         let mut fixedsig = [0; ed25519_dalek::Signature::BYTE_SIZE];
        |                                                          ^^^^^^^^^ associated item not found in `Signature`

    error[E0599]: no function or associated item named `from_bytes` found for struct `ed25519_dalek::Signature` in the current scope
       --> /home/nepalez/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nkeys-0.3.0/src/lib.rs:259:47
        |
    259 |         let insig = ed25519_dalek::Signature::from_bytes(&fixedsig)?;
        |                                               ^^^^^^^^^^ function or associated item not found in `Signature`
        |
        = help: items from traits can only be used if the trait is in scope
In the crate tokio-rustls-0.24.0 the dependency
from the crate rustls is too loose (0.21.0).

To reproduce the problem:

    cargo +nightly update -Z minimal-versions
    cargo check --package async-nats --all-targets

which fails with errors:

    error[E0599]: no method named `add_trust_anchors` found for struct `RootCertStore` in the current scope
       --> async-nats/src/tls.rs:108:28
        |
    108 |                 root_store.add_trust_anchors(trust_anchors);
        |                            ^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `add_server_trust_anchors`

    error[E0599]: no method named `with_client_auth_cert` found for struct `ConfigBuilder` in the current scope
       --> async-nats/src/tls.rs:117:29
        |
    117 |                     builder.with_client_auth_cert(cert, key).map_err(|_| {
        |                             ^^^^^^^^^^^^^^^^^^^^^ help: there is a method with a similar name: `with_no_client_auth`

The first error evades after updating rustls to 0.21.5,
the second one requires 0.21.6.
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

Thanks for your contribution!

@Jarema Jarema merged commit 77bf038 into nats-io:main Sep 18, 2023
13 checks passed
@Jarema Jarema mentioned this pull request Sep 21, 2023
@nepalez nepalez deleted the fix-minimal-versions branch September 22, 2023 12:47
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