hadlink uses redo as its build system, which aligns with the project's embedded/minimalist philosophy.
- Why redo?
- Prerequisites
- Building
- Development Workflow
- Build Scripts
- Continuous Integration
- Troubleshooting
- Advanced Usage
- References
- Simple, declarative build scripts
- Correct dependency tracking
- No complex syntax or DSL
- Scripts are just shell scripts
- Minimal, auditable
- Fast and reliable
This project uses dinkelk/redo (MIT), a Haskell implementation that is actively maintained and aligns with the project's toolchain.
Install redo (dinkelk's Haskell implementation):
# Clone and build
git clone https://github.com/dinkelk/redo.git
cd redo && ./do
export PATH=$PATH:$(pwd)/binOr if available via your package manager, install from there.
Stack - Haskell build tool
curl -sSL https://get.haskellstack.org/ | sh
# Or: sudo pacman -S stack (Arch)redo allThis builds the SPARK core library, then all Haskell components.
redo testRuns the property-based test suite.
redo proveRequires Alire with gnatprove. The spark-core/ directory is an Alire project:
cd spark-core
alr build # Build SPARK library
alr exec -- gnatprove -P hadlink_core.gpr # Run formal proofsredo cleanredo tracks dependencies automatically:
# Edit source files
vim haskell/src/Types.hs
# Rebuild only what changed
redo allredo generate-secretCreates a deployment secret in deploy/docker/secret.key.
All build logic lives in .do files:
all.do- Build all componentstest.do- Run testsprove.do- Run SPARK proofsclean.do- Clean artifactsdefault.do- Show helpgenerate-secret.do- Generate deployment secretrun-shorten.do- Run shorten daemon locally
Follow redo conventions:
#!/bin/bash
# Brief description
exec >&2 # Redirect script output to stderr
# Add dependencies
redo-ifchange dependency1 dependency2
# Do the work
echo "Building..."
actual_build_command
# Mark as done
touch "$3"Example CI configuration using redo:
# .gitlab-ci.yml
image: haskell:9.2
before_script:
- git clone https://github.com/dinkelk/redo.git
- cd redo && ./do && cd ..
- export PATH=$PATH:$(pwd)/redo/bin
test:
script:
- redo all
- redo test
- redo prove # if SPARK availableInstall redo from https://github.com/dinkelk/redo
Requirements:
- Haskell Stack
- Run
./doin the redo repository
Clean and rebuild:
redo clean
redo allEnsure .do files are executable:
chmod +x *.do haskell/*.doredo supports parallel execution:
redo -j4 allredo -v allredo -x all # Show commands as they executeYou can also use Stack directly:
cd haskell
stack build # Build
stack test # Test
stack exec hadlink # Run
stack clean # Clean- dinkelk/redo - This implementation
- DJB's redo design - Original design notes
- apenwarr/redo - Python implementation