Module scan

Module scan 

Source
Expand description

Package dependency scanning and resolution.

This module provides the Scan struct for discovering package dependencies and building a directed acyclic graph (DAG) for build ordering.

§Scan Process

  1. Create a scan sandbox
  2. Run make pbulk-index on each package to discover dependencies
  3. Recursively discover all transitive dependencies
  4. Resolve dependency patterns to specific package versions
  5. Verify no circular dependencies exist
  6. Return buildable and skipped package lists

§Skip Reasons

Packages may be skipped for several reasons:

  • PKG_SKIP_REASON - Package explicitly marked to skip on this platform
  • PKG_FAIL_REASON - Package expected to fail on this platform
  • Unresolved dependencies - Required dependency not found
  • Circular dependencies - Package has a dependency cycle

§Example

use bob::{Config, Database, RunContext, Scan};
use pkgsrc::PkgPath;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;

let config = Config::load(None, false)?;
let db_path = config.logdir().join("bob").join("bob.db");
let db = Database::open(&db_path)?;
let mut scan = Scan::new(&config);

scan.add(&PkgPath::new("mail/mutt")?);
scan.add(&PkgPath::new("www/curl")?);

let ctx = RunContext::new(Arc::new(AtomicBool::new(false)));
scan.start(&ctx, &db)?;  // Discover dependencies
let result = scan.resolve(&db)?;

println!("Buildable: {}", result.buildable.len());
println!("Skipped: {}", result.skipped.len());

Structs§

ResolvedIndex
A resolved package index entry with dependency information.
Scan
Package dependency scanner.
ScanFailure
Information about a package that failed to scan.
ScanResult
Result of scanning and resolving packages.
SkippedPackage
Information about a package that was skipped during scanning.

Enums§

SkipReason
Reason why a package was excluded from the build.

Functions§

find_cycle