Demonstrate how to vendor LLVM and deps with deps.py
This repository has been archived on 2026-11-21. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 70.4%
  • C++ 15.1%
  • Starlark 14.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-21 11:24:14 +01:00
build implement all of it 2026-11-21 11:24:14 +01:00
shell implement all of it 2026-11-21 11:24:14 +01:00
third_party implement all of it 2026-11-21 11:24:14 +01:00
.buckconfig implement all of it 2026-11-21 11:24:14 +01:00
.buckroot setup done 2026-11-21 10:54:00 +01:00
.clangd implement all of it 2026-11-21 11:24:14 +01:00
.gitignore implement all of it 2026-11-21 11:24:14 +01:00
BUCK implement all of it 2026-11-21 11:24:14 +01:00
DEPS.json implement all of it 2026-11-21 11:24:14 +01:00
deps.py setup done 2026-11-21 10:54:00 +01:00
README implement all of it 2026-11-21 11:24:14 +01:00

A minimal GNU Readline shell built with Buck2.

Build and run:

    buck2 build //:shell --show-output
    buck2 run //:shell
    buck2 run //:shell -- -c 'pwd'
    buck2 test //shell:smoke_test

The default build output is a deployment directory containing real copies
of shell, libc++.so.1, libc++abi.so.1, and libunwind.so.1. Copy its contents
to the target together. The executable uses RUNPATH=$ORIGIN, set on the
binary target in shell/BUCK; it does not depend on a Buck symlink tree.

The toolchains use the vendored LLVM distribution and bootstrap Python.
The shell uses C++23 with -Wall, -Wextra, and -Wpedantic. Readline and the
ncurses termlib subset build directly as Buck C libraries; no upstream
configure or Make build runs under Buck. Linux x86-64 / glibc is the current
supported configuration. System C headers, startup objects, loader, libc,
libm, and libatomic remain platform dependencies. Terminal descriptions
come from the target's terminfo database.

Refresh clangd's compilation database after changing build declarations:

    buck2 run compdb

The //:compdb alias runs a wrapper with vendored Python and invokes the
vendored Prelude's recursive compilation_database.bxl generator. Buck2
itself must be available on PATH. compile_commands.json is generated and
ignored by Git; .clangd points at the repository root. Optional target
arguments select another dependency graph:

    buck2 run compdb -- //shell:shell_binary

For an editor, use third_party/llvm-build/bin/clangd to match the compiler.

The shell currently supports command execution through PATH, quoted and
escaped arguments, in-memory Readline history, and cd, pwd, history, exit.
It accepts interactive input, one command per input line, or -c command.
Pipelines, redirections, expansions, scripting, and job control are not yet
implemented. Unquoted shell operators are rejected explicitly.