-
Notifications
You must be signed in to change notification settings - Fork 16
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
Make scrypt test dep optional and not required on darwin #85
Conversation
See the following for more information: - NixOS/nixpkgs#351305 - #84
@@ -30,9 +31,7 @@ testScrypt = testGroup "scrypt" | |||
checkPassword | |||
extractParams | |||
testsParams8Rounds | |||
#ifndef IS_MAC_OS | |||
, testProperty "scrypt <-> cryptonite" $ withMaxSuccess 10 checkScrypt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel like acting we're testing something when we're not is a good idea.
I'd prefer:
#ifndef darwin_HOST_OS
, testProperty "scrypt <-> cryptonite" $ withMaxSuccess 10 checkScrypt
#endif
And just not defining checkScrypt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I've changed this back in b5a96ef.
password/password.cabal
Outdated
|
||
-- The scrypt package is optionally used in tests to ensure compatibility | ||
-- between password and scrypt. However, scrypt doesn't work on OSX, so | ||
-- we only add the scrypt dependency if we're not building on OSX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not enough. scrypt requires x86_64
with SSE2 instruction set, so also aarch64-linux etc. aren't available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we should be using x86_64_HOST_ARCH
?
Is that also the reason it doesn't work on OSX? Or can darwin
also be x86_64
sometimes? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. x86_64-darwin works fine (with a new enough CPU). aarch64-darwin is broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for the clarification here, I've updated the tests to only run on x86_64 in b5a96ef.
`password` contains a test that the Scrypt support in `password` is compatible with the actual `scrypt` Haskell package. However, the `scrypt` Haskell package only runs on x86_64 (with the SSE2 instruction set). This commit updates the Scrypt compatibility tests in `password` to only be included if we're building on x86_64. See #85 (review) for more information.
Looks good 👍 You could also include a version bump + Changelog addition. (-> |
Thanks! I've tagged and released as https://hackage.haskell.org/package/password-3.1.0.1 |
This is a slight improvement on #84.
I've also confirmed that
stack test --flag password:-scrypt password
builds without problems (on Linux at least).See the following for more information: