Solutions to common problems with hx.
Quick Diagnostics
Start with the doctor:
hx doctorThis checks:
- Toolchain installation
- Version compatibility
- Project configuration
- System dependencies
Installation Issues
hx Command Not Found
After installation:
bash: hx: command not foundSolution: Add to PATH
# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
# Reload shell
source ~/.bashrcPermission Denied
error: Permission denied installing to /usr/local/binSolution: Use user-local install
curl -fsSL https://get.arcanist.sh/hx | sh -s -- --prefix ~/.localToolchain Issues
GHC Not Found
error: GHC not found in PATHSolution: Install GHC
hx toolchain install --ghc 9.8.2GHC Version Mismatch
error: GHC version mismatch
required: 9.8.2 (from hx.toml)
found: 9.6.4Solution: Install and use correct version
hx toolchain install --ghc 9.8.2
hx toolchain use --ghc 9.8.2HLS Incompatibility
warning: HLS 2.6.0 may not support GHC 9.10.1Solution: Check HLS compatibility or use supported GHC
# Use compatible GHC version
hx toolchain use --ghc 9.8.2Build Issues
Package Not Found
error: Could not resolve dependencies
unknown package: some-packageSolution: Update package index
cabal update
hx lockDependency Conflict
error: Dependency conflict
package-a requires text <2
package-b requires text >=2Solutions:
Update conflicting package:
hx update package-aCheck for newer versions:
hx outdatedUse allow-newer (escape hatch):
-- cabal.project allow-newer: package-a:text
Build Fails After GHC Upgrade
error: Module 'Foo' is not loadedSolution: Clean and rebuild
hx clean
hx buildOut of Memory
error: ghc: out of memorySolutions:
Reduce parallelism:
hx build -j1Increase heap size:
hx build --ghc-options="+RTS -M8G -RTS"Enable split sections:
[build] split-sections = true
Lockfile Issues
Lockfile Out of Sync
error: hx.lock is out of sync with hx.tomlSolution: Regenerate lockfile
hx lockLockfile Merge Conflict
After git merge:
CONFLICT (content): Merge conflict in hx.lockSolution: Regenerate
# Accept one version
git checkout --ours hx.lock
# Regenerate
hx lock
# Verify
hx buildChecksum Mismatch
error: Package checksum mismatch
expected: abc123...
got: def456...Solution: Force regenerate
hx lock --force
hx syncConfiguration Issues
Invalid hx.toml
error: Failed to parse hx.toml
line 5: expected string, found integerSolution: Check TOML syntax
# Strings need quotes
[project]
name = "my-project" # Correct
name = my-project # WrongUnknown Configuration Key
warning: Unknown key 'build.optimize' in hx.tomlSolution: Check documentation for correct keys
# Correct key
[build]
release = true
# Not: optimize = trueTest Issues
Tests Not Found
No tests to runSolution: Check test configuration
test-suite my-tests
type: exitcode-stdio-1.0
main-is: Spec.hs
hs-source-dirs: testVerify test file exists and has correct module:
-- test/Spec.hs
module Main where
import Test.Hspec
main :: IO ()
main = hspec specTest Timeout
error: Test timed out after 60sSolution: Increase timeout
hx test -- --timeout 120sWatch Mode Issues
Changes Not Detected
Watching for changes...
# But saves don't trigger rebuildSolutions:
Use polling mode:
hx watch build --pollCheck watch limits (Linux):
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf sudo sysctl -p
Too Many Rebuilds
Solution: Increase debounce
hx watch build --debounce 500Platform-Specific Issues
Linux: Missing Libraries
error: libgmp.so: cannot open shared object fileSolution: Install system dependencies
# Ubuntu/Debian
sudo apt install libgmp-dev libncurses-dev
# Fedora
sudo dnf install gmp-devel ncurses-develmacOS: Library Not Loaded
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylibSolution: Install via Homebrew
brew install gmpWindows: Long Path Issues
error: The specified path, file name, or both are too longSolution: Enable long paths
# Run as Administrator
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -ForceGetting Help
Verbose Output
hx build --verboseShows full command and output.
Debug Mode
HX_DEBUG=1 hx buildShows internal debugging info.
Reporting Issues
Include in bug reports:
hx --versionhx doctoroutput- Relevant configuration files
- Full error message with
--verbose
File issues at: https://github.com/arcanist-sh/hx/issues
See Also
- hx doctor — Diagnostics
- Installation — Setup guide
- Configuration — Config reference