Demonstrate how to vendor LLVM and deps with
deps.py
- Python 70.4%
- C++ 15.1%
- Starlark 14.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| build | ||
| shell | ||
| third_party | ||
| .buckconfig | ||
| .buckroot | ||
| .clangd | ||
| .gitignore | ||
| BUCK | ||
| DEPS.json | ||
| deps.py | ||
| README | ||
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.