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

Add new 'mock' feature for 'mock-mount-s3' binary #1030

Merged

Conversation

dannycjones
Copy link
Contributor

Description of change

Without this change, we get a compilation error due to missing dependencies:

   Compiling mountpoint-s3-crt v0.9.0 (/Users/djonesoa/devel/mountpoint-s3/mountpoint-s3-crt)
error[E0432]: unresolved import `futures::executor::ThreadPool`
   --> mountpoint-s3/src/bin/mock-mount-s3.rs:13:5
    |
13  | use futures::executor::ThreadPool;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ThreadPool` in `executor`
    |
note: found an item that was configured out
   --> /Users/djonesoa/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-0.3.30/src/lib.rs:203:32
    |
203 |     pub use futures_executor::{ThreadPool, ThreadPoolBuilder};
    |                                ^^^^^^^^^^
    = note: the item is gated behind the `thread-pool` feature

For more information about this error, try `rustc --explain E0432`.
error: could not compile `mountpoint-s3` (bin "mock-mount-s3") due to 1 previous error

This change adds a new mock feature to the mountpoint-s3 crate, which implies both mountpoint-s3-client/mock and futures/thread-pool. We mark the mock-mount-s3 client as requiring the mock feature, so building will fail as follows:

❯ cargo run --bin mock-mount-s3 -- sthree-test ~/mnt/s3                
error: target `mock-mount-s3` in package `mountpoint-s3` requires the features: `mock`
Consider enabling them by passing, e.g., `--features="mock"`

By building with the feature enabled, building completes.

❯ cargo build --bin mock-mount-s3 --features mock   
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s

Relevant issues: #1018

Does this change impact existing behavior?

It changes the features required to build the mock-mount-s3 binary. This is not stable.

Does this change need a changelog entry in any of the crates?

No, this is not customer facing behavior.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).

Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
Copy link
Contributor

@monthonk monthonk left a comment

Choose a reason for hiding this comment

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

LGTM. Happy to merge after the conflict is resolved.

Signed-off-by: Daniel Carl Jones <djonesoa@amazon.com>
@dannycjones dannycjones added this pull request to the merge queue Sep 24, 2024
Merged via the queue into awslabs:main with commit ed4735d Sep 24, 2024
23 checks passed
@dannycjones dannycjones deleted the mock-client-fix-required-features branch September 24, 2024 15:07
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