bob/
lib.rs

1/*
2 * Copyright (c) 2025 Jonathan Perkin <jonathan@perkin.org.uk>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17//! Bob is a pkgsrc package builder that automates building packages in isolated
18//! sandbox environments with parallel build support, dependency resolution, and
19//! comprehensive reporting.
20//!
21//! # Overview
22//!
23//! Bob provides:
24//!
25//! - Automatic sandbox setup with platform-specific implementations for Linux,
26//!   macOS, NetBSD, and illumos
27//! - Dependency scanning and DAG-based resolution for correct build ordering
28//! - Parallel scans and builds in separate sandboxes
29//! - Terminal UI showing real-time build progress
30//! - HTML reports of build results
31//! - Lua-based configuration for flexibility
32//!
33//! # Quick Start
34//!
35//! ```console
36//! $ bob init /path/to/config      # Create configuration directory
37//! $ cd /path/to/config
38//! $ vi config.lua                 # Customise to taste
39//! $ bob build                     # Build packages
40//! ```
41//!
42//! # Modules
43//!
44//! - [`action`] - Sandbox action types for configuring filesystem mounts, copies,
45//!   symlinks, and custom commands
46//! - [`build`] - Parallel package builds and result types
47//! - [`config`] - Configuration file parsing (Lua format)
48//! - [`report`] - HTML build report generation
49//! - [`sandbox`] - Sandbox creation, execution, and management
50//! - [`scan`] - Package dependency scanning and resolution
51//!
52//! # Configuration
53//!
54//! Bob uses Lua configuration files. See the [`config`] module for details on
55//! configuration options.  The default file generated by `bob init` is
56//! designed to work out of the box with minimal changes on supported operating
57//! systems, but you are likely to want to customise it further.
58
59pub mod action;
60pub mod build;
61pub mod config;
62pub mod report;
63pub mod sandbox;
64pub mod scan;
65
66// Internal modules - exposed for binary use but not primary API
67mod init;
68pub mod logging;
69mod status;
70mod tui;
71
72// Re-export main types for convenience
73pub use action::{Action, ActionType, FSType};
74pub use build::{Build, BuildOutcome, BuildResult, BuildSummary};
75pub use config::{Config, Options, Pkgsrc, Sandboxes};
76pub use report::write_html_report;
77pub use sandbox::Sandbox;
78pub use scan::{Scan, ScanResult, SkipReason, SkippedPackage};
79
80// Re-export init for CLI use
81pub use init::Init;