1
0
Fork
You've already forked blue
0
forked from lapislazuli/blue
BLUE - Build Language User Extensible. A generic build-system crafted entirely in Guile.
  • Scheme 99.9%
Olivier Dion ab79d7634b
fix: Autocomplete regression tests
Signed-off-by: Olivier Dion <olivier.dion@polymtl.ca>
2026年03月05日 13:32:07 -05:00
.builds Re-introduce debian/ubuntu woodpecker CI 2026年01月26日 08:50:08 -05:00
.woodpecker Make installcheck robust 2026年02月13日 14:35:35 -05:00
aux pre-inst-env: Add BLUE_BLUEPRINT 2026年02月12日 13:28:39 -05:00
blue fix: Autocomplete regression tests 2026年03月05日 13:32:07 -05:00
blueprint ui: Introduce meta-commands 2026年03月04日 21:04:57 -05:00
docs docs: Add Info manual template 2025年10月16日 17:11:21 +02:00
examples build: Refactor buildable API and add requirements slot 2026年03月03日 17:20:37 -05:00
share/bash-completion/completions ui: Introduce meta-commands 2026年03月04日 21:04:57 -05:00
tests fix: Autocomplete regression tests 2026年03月05日 13:32:07 -05:00
.dir-locals.el dir-locals: Modify syntax of % to be like ' 2025年10月13日 14:43:53 -04:00
.envrc chore: Update '.envrc' to use 'manifest.scm' 2025年10月24日 17:56:03 +02:00
.gitattributes Add git attributes 2025年05月13日 18:19:09 -04:00
.gitignore gitignore: Ignore coverage files 2026年02月21日 13:42:58 -05:00
.mailmap Add .mailmap 2025年05月13日 18:19:11 -04:00
blueprint.scm Deprecate find-binary in favor of find-executable 2026年02月09日 21:04:32 -05:00
bootstrap bootstrap: Remove useless bits 2025年12月18日 12:19:53 -05:00
channels.scm chore: Update 'channels.scm' and 'manifest.scm' 2025年12月18日 20:34:17 +01:00
CONTRIBUTING CONTRIBUTING: Typos. 2026年02月10日 18:11:36 +01:00
COPYING Move to LGPL-3.0-or-later 2025年05月14日 13:14:15 -04:00
guix.scm Guix: Fix Guix command and definition 2026年01月22日 13:21:56 -05:00
LICENSE docs: Update license copyright 2025年10月16日 17:10:12 +02:00
manifest.scm chore: Update 'channels.scm' and 'manifest.scm' 2025年12月18日 20:34:17 +01:00
README Add README 2025年05月16日 09:21:18 -04:00
README.org Bump README AGAIN 2026年01月29日 20:54:47 -05:00

BLUE - Build Language User Extensible

Arch: https://builds.sr.ht/~old/blue/commits/main/arch.yml.svg Debian: https://builds.sr.ht/~old/blue/commits/main/debian.yml.svg Fedora: https://builds.sr.ht/~old/blue/commits/main/fedora.yml.svg Ubuntu: https://builds.sr.ht/~old/blue/commits/main/ubuntu.yml.svg Woodpecker: https://ci.codeberg.org/api/badges/14738/status.svg

BLUE is an acronym for Build Language User Extensible. It is a self-hosting build-system fully written in Guile.

As opposed to other build-systems, BLUE works as a library that can be used by projects to manage their builds. It is entirely self-contained and can be embedded into existing projects. It provides an optional clean and extensible CLI.

BLUE aims to reduce frictions from the build-system by providing a very-rich extensible API with clear error messages and documentation.

(define hello
 (c-binary
 (inputs "main.c")
 (outputs "hello")))
(blueprint
 (buildables (list hello)))

Features

Core

  • Self-hosting (BLUE builds itself)
  • Timestamp dependency tracking
  • Single dependency on Guile
  • Extensible through GOOPS (Guile equivalent of CLOS)
  • Declarative and functional
  • Embeddable as a library
  • Parallel builds using Guile fibers
  • Out-of-tree builds

Computation System

BLUE features a lazy evaluation system with special reader syntax for delayed computations. This enables configuration values that depend on other values to be resolved at the right time, similar to how GNU Autotools handles directory variables.

 ;; #%~ delays evaluation
 ;; #%? asks the computation environment for a value
 ;; #%, undelays (evaluates at definition time)
 (define my-path
 #%~(string-append #%?prefix "/share"))
 ;; yield: /usr/local/share
 (run-with-states '((prefix . "/usr/local"))
 (run-computation my-path))
 ;;; yield: /usr/share
 (run-with-states '((prefix . "/usr"))
 (run-computation my-path))

Language Support

  • C/C++ (with automatic dependency detection via pkg-config)
  • Guile Scheme modules
  • Multiple frontend languages

    • Guile Scheme
    • Wisp (TODO)

Developer Experience

  • Syntax-highlighted source code in error messages
  • S-expression diffing for debugging configuration changes
  • Terminal hyperlinks for clickable file paths (in supported terminals)
  • Profiling support (--profile=stat, --profile=gc, --profile=trace)
  • Built-in REPL for interactive debugging (blue repl)
  • Code coverage reporting with LCOV integration

Integration

  • JSON serialization for external tool integration
  • Emacs integration via blue.el

Quick Start

Requirements

The only dependency of BLUE is Guile >= 3.0.7.

Supported Platforms

  • GNU Linux with epoll(2)

Installation

Get the sources.

Setup

Ensure dependencies are met.

In order to build this project a sufficient new version of Guile has to be installed, refer to requirements.

If using Guix, the recommended development environment can be instantiated through the following command:

guix time-machine -C channels.scm -- shell -m manifest.scm

Direnv

The project provides a .envrc file to automate the deployment of the development environment. In order to use this file, direnv as well as guix must be installed.

Bootstrap

If not using the .envrc file, then BLUE needs to be bootstrapped. This can be done by running the following commands:

mkdir build
cd build
../bootstrap

This creates the pre-inst-env wrapper script. Commands can be executed within the BLUE environment by prefixing them with ./pre-inst-env:

./pre-inst-env blue configure
./pre-inst-env blue build

Configure

BLUE itself requires a configuration to work.

blue configure

This caches the result of the system information in the BLUE store.

This step mimics the GNU Autotools workflow. Therefore, the user can expect to be able to configure the project through the standard directory variables mandated by the GNU project (e.g. '–prefix=<install-path>').

Hacking BLUE

BLUE can now build, check and install itself!

blue build -- check -- install -- installcheck

A Simple Example

Here is a complete blueprint for building a C program with a static library:

(use-modules
 (blue stencils c)
 (blue types blueprint))
(define libhello
 (c-binary
 (inputs "hello.c")
 (outputs "libhello.a")
 (library? #t)
 (shared? #f)))
(define hello
 (c-binary
 (inputs (list "main.c" libhello))
 (outputs "hello")))
(blueprint
 (buildables (list hello)))

BLUE automatically handles dependency ordering, compiler flag propagation, and incremental rebuilds based on timestamps.

Custom Commands

Blueprints can define custom commands that integrate with BLUE's CLI:

(define-command (hello-command args)
 ((invoke "hello")
 (category 'misc)
 (synopsis "Print hello")
 (help "Print hello on the terminal and exit."))
 (display "hello\n"))
(blueprint
 (commands (list hello-command)))

Then run with blue hello.

Built-in Commands

blue configure # Resolve dependencies and configuration
blue build # Build all buildables
blue check # Run all testables
blue clean # Remove build artifacts
blue repl # Start interactive REPL
blue help [COMMAND] # Show help for a command

Useful Options

blue --color=never ... # Disable colored output
blue --jobs=4 ... # Limit parallel jobs
blue --dry-run ... # Show what would be done
blue --profile ... # Profile the execution
blue --log-level=debug ... # Verbose logging

Examples

See EXAMPLES for internal documentation.

Ported Software

dwm
dynamic window manager
Shepherd
The GNU Daemon Shepherd
st
simple terminal

Templates

test-hello
Hello world
test-hello-embedded
Hello world with BLUE embedded

Contributing

Status

BLUE is currently in pre-alpha. The core functionality works and BLUE successfully builds itself, but APIs may change.

Related Software

blue.el
Emacs interface to BLUE
bluebox
Guix channels with the BLUE build system

Projects Using BLUE

Contact

IRC channel: #blue on irc.libera.chat.

Bug tracker: Issues

CI: Woodpecker

License

For your freedom and ours

BLUE is free software licensed under the LGPL-3.0-or-later.