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

Update ahash requirement from 0.7.0 to 0.8.3 #7420

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 30, 2023

Updates the requirements on ahash to permit the latest version.

Release notes

Sourced from ahash's releases.

Version 0.8.3

Add inline flag to getSeeds: tkaitchuck/aHash#149

Commits

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
> **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Updates the requirements on [ahash](https://github.com/tkaitchuck/ahash) to permit the latest version.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](tkaitchuck/aHash@v0.7.6...v0.8.3)

---
updated-dependencies:
- dependency-name: ahash
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the C-Dependencies A change to the crates that Bevy depends on label Jan 30, 2023
@halotroop2288
Copy link

halotroop2288 commented Feb 20, 2023

Since they reduced the visibility of new_with_keys to pub(crate), would this be a valid replacement?

Old

#[inline]
fn build_hasher(&self) -> AHasher {
    AHasher::new_with_keys(
        0b1001010111101110000001001100010000000011001001101011001001111000,
        0b1100111101101011011110001011010100000100001111100011010011010101,
    )
}

New

#[inline]
fn build_hasher(&self) -> AHasher {
    let mut hasher = BuildHasher::build_hasher(self);
    hasher.write_u64(1001010111101110000001001100010000000011001001101011001001111000);
    hasher.write_u64(0b1100111101101011011110001011010100000100001111100011010011010101);
    return hasher;
}

(I don't know a lot about hashing, I'm just trying to solve a dependency issue 😅)

@mockersf
Copy link
Member

@stefnotch
Copy link

stefnotch commented Mar 18, 2023

The with_seeds method almost has the same behaviour, the question is whether one needs the exactly same behaviour. I'm guessing not.

The old version did the following
https://docs.rs/ahash/0.7.6/src/ahash/aes_hash.rs.html#53-62

with_seeds does this
https://docs.rs/ahash/0.8.3/src/ahash/random_state.rs.html#308-315
and the build_hasher method calls
https://docs.rs/ahash/0.8.3/src/ahash/aes_hash.rs.html#72-79

What's the difference? Well, the old version xors the keys with the PI constant, while the new version uses the PI2 constant.

@mockersf
Copy link
Member

closing in favour of #8623

@mockersf mockersf closed this May 16, 2023
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github May 16, 2023

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/cargo/ahash-0.8.3 branch May 16, 2023 23:06
alice-i-cecile pushed a commit that referenced this pull request May 23, 2023
# Objective

- Update `ahash` and `hashbrown`
- Alternative to #5700 and #7420

## Solution

- Update the dependencies

This is a breaking change because we were creating two fixed hashers
with
[`AHasher::new_with_keys`](https://docs.rs/ahash/0.7.6/ahash/struct.AHasher.html#method.new_with_keys),
which was a method that existed only for testing purpose and has been
removed from public.

I replaced it with
[`RandomState::with_seeds`](https://docs.rs/ahash/0.8.3/ahash/random_state/struct.RandomState.html#method.with_seeds)
which is the proper way to get a fixed hasher (see [this
table](https://docs.rs/ahash/0.8.3/ahash/random_state/struct.RandomState.html)).
This means that hashes won't be the same across versions

---

## Migration Guide

- If you were using hashes to an asset or using one of the fixed hasher
exposed by Bevy with a previous version, you will have to update the
hashes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Dependencies A change to the crates that Bevy depends on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants