liveBook · Manning

Build script

Also called build.rs

A build script is an executable program or declarative specification that automates or configures tasks for building software artifacts.

How 3 Manning books explain it

Refactoring to Rust

A Cargo build script is a Rust program run before package compilation to perform build-time configuration or generate source and other artifacts.

How it is used
Uses build-time code generation to configure a greeting and create Rust bindings for C headers.
How deep it goes
Walks through script discovery, file generation, build dependencies, binding filters, and inclusion of generated code.
Examples
Demonstrates a language-selected greeting and generated NGINX bindings.
What you can do after
Build it from scratch to generate Rust source, and apply it via bindgen to create C bindings.

Read how Refactoring to Rust explains build script →

Systems Programming with Zig

A build script is a program or declarative specification that defines how source code and dependencies are configured and compiled.

How it is used
Automates compilation and organizes configurable, modular project builds.
How deep it goes
Builds from a minimal executable script to module dependencies, named test steps, and C header translation.
Examples
Uses a configurable cat utility, a CHIP-8 interpreter with tests, and GLFW header translation.
What you can do after
Apply it via Zig’s build system to create an executable, configure targets, connect modules, and run tests.

Read how Systems Programming with Zig explains build script →

Embedded Software with Rust

A Cargo build script is a Rust program, conventionally named build.rs, that Cargo runs before compiling a package to perform build-time tasks.

How it is used
Automates embedded pre-build tasks when static configuration is insufficient, including linker-script generation and native-code integration.
How deep it goes
Explains automatic execution and demonstrates file generation and C compilation, while deferring advanced Rust-C and assembly workflows.
Examples
Demonstrates generating memory.x, compiling C source with cc, and incorporating separate .S files.
What you can do after
Apply it via Cargo to generate linker inputs or compile C sources as part of a normal build.

Read how Embedded Software with Rust explains build script →

Also covered in

What to know first

Related concepts

Questions about build script

What is build script?

A build script is an executable program or declarative specification that automates or configures tasks for building software artifacts.

Which Manning books explain build script?

Refactoring to Rust, Systems Programming with Zig and Embedded Software with Rust.

What should I know before learning build script?

Manning books that teach build script usually introduce Rust and software testing first.

What is build script also called?

Build script is also called build.rs.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.