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

caching_session: use custom hasher instead of ahash in tests #625

Merged
merged 1 commit into from Jan 21, 2023

Conversation

piodul
Copy link
Collaborator

@piodul piodul commented Jan 12, 2023

Currently, we are importing the ahash crate for only one reason: to test that CachingSession works with custom hasher implementations. The custom hasher quality doesn't matter at all in this test, so it's very easy to write own implementation for testing purposes, rendering the dependency on ahash obsolete.

The change was prompted by a report from one of our users which use a fork of the driver and managed to trigger a bug in cargo - most likely this one: rust-lang/cargo#7463 . The most likely cause was that the project specified a different, non-compatible version of ahash in the dependencies than the one in scylla's dev-dependencies. While it doesn't fix the cargo bug and it can still happen with other dev-dependencies, the bug should no longer happen with conflicting ahash. Moreover, removing an unneeded depdencency from a project is a good motivation in itself.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I added appropriate Fixes: annotations to PR description.

@cvybhu
Copy link
Contributor

cvybhu commented Jan 13, 2023

Please rebase on top of latest main to fix the CI checks

@piodul
Copy link
Collaborator Author

piodul commented Jan 16, 2023

@cvybhu rebased, ping

Copy link
Member

@avelanarius avelanarius left a comment

Choose a reason for hiding this comment

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

Minor nit: the commit message could mention the motivation for the change (was it that clippy crashes when trying to analyse ahash?)

piodul added a commit to piodul/scylla-rust-driver that referenced this pull request Jan 18, 2023
Currently, we are importing the `ahash` crate for only one reason: to
test that CachingSession works with custom hasher implementations. The
custom hasher quality doesn't matter at all in this test, so it's very
easy to write own implementation for testing purposes, rendering the
dependency on `ahash` obsolete.

The change was prompted by a report from one of our users which use a
fork of the driver and managed to trigger a bug in cargo - most likely
this one: scylladb#625 .
The most likely cause was that the project specified a different,
non-compatible version of ahash in the dependencies than the one in
scylla's dev-dependencies. While it doesn't fix the cargo bug and it can
still happen with other dev-dependencies, the bug should no longer
happen with conflicting `ahash`. Moreover, removing an unneeded
depdencency from a project is a good motivation in itself.
@piodul
Copy link
Collaborator Author

piodul commented Jan 18, 2023

@avelanarius No, it was actually a bug in cargo's resolver which can prevent a dependent project from building at all. Added more info to the commit description.

Currently, we are importing the `ahash` crate for only one reason: to
test that CachingSession works with custom hasher implementations. The
custom hasher quality doesn't matter at all in this test, so it's very
easy to write own implementation for testing purposes, rendering the
dependency on `ahash` obsolete.

The change was prompted by a report from one of our users which use a
fork of the driver and managed to trigger a bug in cargo - most likely
this one: rust-lang/cargo#7463 .
The most likely cause was that the project specified a different,
non-compatible version of ahash in the dependencies than the one in
scylla's dev-dependencies. While it doesn't fix the cargo bug and it can
still happen with other dev-dependencies, the bug should no longer
happen with conflicting `ahash`. Moreover, removing an unneeded
depdencency from a project is a good motivation in itself.
@avelanarius
Copy link
Member

In the updated commit message:

The change was prompted by a report from one of our users which use a
fork of the driver and managed to trigger a bug in cargo - most likely
this one: #625 .

Shouldn't the link lead somewhere else?

@piodul
Copy link
Collaborator Author

piodul commented Jan 18, 2023

Shouldn't the link lead somewhere else?

Yes, I realized that and already pushed a commit with corrected message.

@piodul
Copy link
Collaborator Author

piodul commented Jan 20, 2023

@cvybhu ping

@cvybhu cvybhu merged commit ce96544 into scylladb:main Jan 21, 2023
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.

None yet

3 participants