Bootstrap the rustc-stable-hash crate#1
Conversation
|
Has this been discussed somewhere? I think extracting something into a separate repo warrants an MCP, if just for visibility. |
|
@michaelwoerister There was the team PR rust-lang/team#1472, but apart from that, not really. Only some private discussions. |
|
Thanks, @Urgau! |
There was a problem hiding this comment.
you should probably test a big-endian target too, e.g. powerpc-unknown-linux-gnu. project-portable-simd uses cross for testing that kind of stuff:
https://github.com/rust-lang/portable-simd/blob/7cd6f95a13d742e482e3b4070d2c01e7b8d8bbfd/.github/workflows/ci.yml
There was a problem hiding this comment.
Yes, we should. I mentioned in the PR description that I plan to expand the CI/targets in a follow-up PR.
So as to keep this is PR minimal and focused on just bootstraping the crate.
The portable-simd CI seems like a fairly good starting point. Thanks for pointing that out.
There was a problem hiding this comment.
Since the tests are not computationally expensive, miri might also be a viable choice for testing a big endian platform.
There was a problem hiding this comment.
The currently (limited) CI already uses Miri to test a 32 bit target (i686-unknown-linux-gnu), so it's totally an option.
There was a problem hiding this comment.
I completely reworked the CI. It is now more extensive.
It now test nightly/stable on Linux/MacOS/Windows.
As well as 32-bits/64-bits on little-endian/big-endian targets with Miri.
|
stupid question: does this repository need to have the history of the existing impl from rust-lang/rust imported? or at least mabye linked to (like "this is a copy of [this hash] in rust-lang/rust" somehow? |
WaffleLapkin
left a comment
There was a problem hiding this comment.
+1 to #1 (comment).
Maybe a CHANGELOG.md with the following?
# Unreleased
- import stable hasher implementation from rustc ([afurdatiphg](link to commit))as well as the `DebugStrictAdd` and `DebugStrictSub` from rustc.
WaffleLapkin
left a comment
There was a problem hiding this comment.
All my concerns are resolved.
I think this can be merged now. (but the publication and usage in rustc should wait until MCP completes)
This PR create the
rustc-stable-hashcrate and import theStableHasher(struct),StableHasherResult(trait) andSipHasher128(struct) fromrustc_data_structuresalong with their respective tests. All of those should be removed from rustc when it starts using this crate.This PR also setup a very minimal CI (copied from rustc-hash), it will need to more coverage, it particular of big endian targets.Also well as importing the Code of Conduct and licenses files.
r? @WaffleLapkin