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

codetable: fix build for blake2s and blake2b features #348

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

cyphar
Copy link
Contributor

@cyphar cyphar commented Oct 30, 2023

In the refactor where each hasher was moved to a separate feature, the conditional compilation of derive_write! was written such that enabling only blake2 hashing will result in compilation errors:

error: cannot find macro `derive_write` in this scope
  --> /home/cyphar/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multihash-codetable-0.1.0/src/hasher_impl.rs:59:9
   |
59 |         derive_write!($name);
   |         ^^^^^^^^^^^^
...
65 |     derive_hasher_blake!(blake2b_simd, Blake2bHasher);
   |     ------------------------------------------------- in this macro invocation
   |
   = note: this error originates in the macro `derive_hasher_blake` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `multihash-codetable` (lib) due to previous error

Fixes: 954e523 ("refactor!: split crates into multiple to isolate breaking changes")
Signed-off-by: Aleksa Sarai [email protected]

In the refactor where each hasher was moved to a separate feature, the
conditional compilation of derive_write! was written such that enabling
only blake2 hashing will result in compilation errors:

    error: cannot find macro `derive_write` in this scope
      --> /home/cyphar/.cargo/registry/src/index.crates.io-6f17d22bba15001f/multihash-codetable-0.1.0/src/hasher_impl.rs:59:9
       |
    59 |         derive_write!($name);
       |         ^^^^^^^^^^^^
    ...
    65 |     derive_hasher_blake!(blake2b_simd, Blake2bHasher);
       |     ------------------------------------------------- in this macro invocation
       |
       = note: this error originates in the macro `derive_hasher_blake` (in Nightly builds, run with -Z macro-backtrace for more info)

    error: could not compile `multihash-codetable` (lib) due to previous error

Fixes: 954e523 ("refactor!: split crates into multiple to isolate breaking changes")
Signed-off-by: Aleksa Sarai <[email protected]>
Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

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

Good catch, thanks a lot!

@vmx vmx merged commit 6403518 into multiformats:master Oct 30, 2023
9 checks passed
@cyphar cyphar deleted the codetable-fix-blake2-build branch October 30, 2023 09:43
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