(manifest: &BuildManifest)
| 311 | pub enum StdlibPolicy { |
| 312 | None, |
| 313 | ForTarget, |
| 314 | Explicit(TargetMode), |
| 315 | } |
| 316 | |
| 317 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 318 | pub enum ImportClosurePolicy { |
| 319 | Disabled, |
| 320 | Enabled { mangle_symbols: bool }, |
| 321 | } |
| 322 | |
| 323 | #[derive(Clone, Debug, PartialEq, Eq)] |
| 324 | pub struct BuildPlan { |
| 325 | pub name: String, |
| 326 | pub target: TargetMode, |
| 327 | pub entry: Option<String>, |
| 328 | pub stdlib: StdlibPolicy, |
| 329 | pub import_closure: ImportClosurePolicy, |
| 330 | pub root: String, |
| 331 | pub extra_objects: Vec<String>, |
| 332 | pub abi_exports: Vec<String>, |
| 333 | pub has_source_prelude: bool, |
| 334 | } |
| 335 | |
| 336 | #[derive(Clone, Debug)] |
| 337 | pub struct BuiltUnit { |
| 338 | pub name: String, |
| 339 | pub assembled: AssembledOutput, |
| 340 | } |
| 341 | |
| 342 | #[derive(Clone, Debug)] |
| 343 | pub struct BuildArtifacts { |
| 344 | pub plan: BuildPlan, |
| 345 | pub units: Vec<BuiltUnit>, |
| 346 | pub linked: AssembledOutput, |
| 347 | } |
| 348 | |
| 349 | #[derive(Debug)] |
| 350 | pub enum BuildError { |
| 351 | Io(std::io::Error), |
| 352 | Manifest(String), |
| 353 | Compile(CompilationError), |
| 354 | Assemble(String), |
| 355 | Link(LinkerError), |
| 356 | } |
| 357 | |
| 358 | impl fmt::Display for BuildError { |
| 359 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 360 | match self { |
| 361 | Self::Io(err) => write!(f, "I/O error: {err}"), |
| 362 | Self::Manifest(err) => write!(f, "manifest error: {err}"), |
| 363 | Self::Compile(err) => write!(f, "{err}"), |
| 364 | Self::Assemble(err) => write!(f, "assembler error: {err}"), |
| 365 | Self::Link(err) => write!(f, "{err}"), |
| 366 | } |
| 367 | } |
| 368 | } |
| 369 |
nothing calls this directly
no test coverage detected