Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boulder/draft: Default to autotools on unhandled build system #396

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions boulder/src/draft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use fs_err as fs;
use itertools::Itertools;
use moss::Dependency;
use thiserror::Error;
use tui::Styled;
use url::Url;

use crate::util;
Expand Down Expand Up @@ -54,9 +55,13 @@ impl Drafter {
// Remove temp extract dir
fs::remove_dir_all(extract_root)?;

let Some(build_system) = build.detected_system else {
return Err(Error::UnhandledBuildSystem);
};
let build_system = build.detected_system.unwrap_or_else(|| {
println!(
"{} | Unhandled build system! - Defaulting to autotools",
"Warning".yellow()
);
build::System::Autotools
});
Comment on lines +58 to +64
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you're "logging" like this in a consistent format across various PRs.

We should really use log / some logging library like env_logger / fern / etc, and do this properly so they can be filtered out if need be. Then we can have some moss::logging module with some helpers to produce standardized log messages throughout the codebase


let builddeps = builddeps(build.dependencies);
let environment = build_system
Expand Down Expand Up @@ -125,8 +130,6 @@ impl File<'_> {

#[derive(Debug, Error)]
pub enum Error {
#[error("Unhandled build system")]
UnhandledBuildSystem,
#[error("analyzing build system")]
AnalyzeBuildSystem(#[source] build::Error),
#[error("upstream")]
Expand Down
Loading