Repository navigation
Description
Describe the bug
As of 05e1f5c, building crypton fails.
To Reproduce
Install cabal locally with:
$ cabal install cabal-install:exe:cabal --overwrite-policy=always
Grab the source for crypton and try to build it:
$ cabal build all --enable-tests --enable-benchmarks -j
Warning: this is a debug build of cabal-install with assertions enabled.
Build profile: -w ghc-9.8.4 -O1
In order, the following will be built (use -v for more details):
- crypton-1.1.4 (lib) (first run)
- crypton-1.1.4 (test:test-crypton) (first run)
- crypton-1.1.4 (bench:bench-crypton) (first run)
Preprocessing library for crypton-1.1.4...
Building library for crypton-1.1.4...
In file included from cbits/argon2/core.c:43,
from cbits/argon2/argon2.c:23:0: error:
cbits/argon2/opt.c:25:10: error:
fatal error: blake2/blake2.h: No such file or directory
25 | #include "blake2/blake2.h"
| ^~~~~~~~~~~~~~~~~
|
25 | #include "blake2/blake2.h"
| ^
compilation terminated.
`gcc' failed in phase `C Compiler'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build crypton-1.1.4 (which is required by test:test-crypton from crypton-1.1.4 and bench:bench-crypton from crypton-1.1.4).
Expected behavior
That cabal can build crypton as it was able to do prior to 05e1f5c, a package that includes the sources that cannot be found when compiling.
$ tree -P 'blake2.h' --prune
.
└── cbits
└── blake2
├── ref
│ └── blake2.h
└── sse
└── blake2.h
5 directories, 2 files
When this C header file can't be found, I first tried installing libb2, as Google's AI suggests but then found the header was included in the package so tried cabal-install-3.16.1.0 and that was able to build crypton.
To fix this error, you need to install the development files for libb2, which provides the BLAKE2 hashing function headers. The exact package manager command depends entirely on your operating system.Quick Fix by Operating SystemFind your operating system below and run the designated command in your terminal:Ubuntu / Debian / Mint
sudo apt-get update sudo apt-get install libb2-dev
System information
Ubuntu 25.10
Activity
philderbeast commentedon Jun 20, 2026
Here's my bisect to find the commit that introduced the problem:
ffaf1 commentedon Jun 20, 2026
I am silly, I stumbled into this but tohught it was a
cryptonissue kazu-yamamoto/crypton/issues/75Nice find. This is obviously a problem for the release @ulysses4ever
ulysses4ever commentedon Jun 20, 2026
Right...
I thought there was a whole-Hackage check for that patch.
@zlonast could you investigate?
zlonast commentedon Jun 21, 2026
I reran the
clc-stackageand can say that it works on9.12.4I think we need to make a minimal example and understand why, by transmitting more information, we somehow lose it.
zlonast commentedon Jun 21, 2026
I think the error only exists in
9.8.4and olderulysses4ever commentedon Jun 21, 2026
Do you mean 9.8.4 and older (9.12 is "later" and you say it works, so that's a contradiction somewhere)? These are still in our story window. Unless we can come up with a quick fix, we'll have to revert...
zlonast commentedon Jun 21, 2026
I found a one-line solution.
The downside is that I'll have to look again to see what was changed in older versions of ghc.
zlonast commentedon Jun 22, 2026
GHCignores-optPfor non-Haskell files and since 9.10. (-optPis acpp-options)Cabaldidn't send this flag to source files before.cryptonis bug hell.#include "blake2/blake2.h"is a pure bug, withlibb2-devit can be#include <blake2.h>or
#include "blake2/ref/blake2.h"or#include "blake2/sse/blake2.h"cryptonhave in.cabal:but I really suspect that they want:
zlonast commentedon Jun 22, 2026
Discussions about this on ghc: Regression starting GHC 8.8:
-optPpreprocessor options passed to C compilerFix in ghc 9.10: Revert "Pass preprocessor options to C compiler when building foreign C files
I think we should close that cabal issue: Regression over 3.6 concerning ghc-options -pgmP -optP