Skip to content

Commit

Permalink
fix: Remove debug prints that slipped in
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jul 30, 2024
1 parent 53f0c8e commit d8e234e
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions rubicon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,26 +423,21 @@ macro_rules! compatibility_check {
}

pub fn check_compatibility() {
eprintln!("Entering check_compatibility function");
let imported: &[(&str, &str)] = &[
("rustc-version", $crate::RUBICON_RUSTC_VERSION),
("target-triple", $crate::RUBICON_TARGET_TRIPLE),
$($feature)*
];
let exported = unsafe { COMPATIBILITY_INFO };

eprintln!("Comparing imported and exported compatibility info");
let missing: Vec<_> = imported.iter().filter(|&item| !exported.contains(item)).collect();
let extra: Vec<_> = exported.iter().filter(|&item| !imported.contains(item)).collect();

if missing.is_empty() && extra.is_empty() {
eprintln!("No compatibility issues found");

// all good
return;
}

eprintln!("Compatibility issues detected, preparing error message");
let so_name = get_shared_object_name().unwrap_or("unknown_so".to_string());
// get only the last bit of the path
let so_name = so_name.rsplit('/').next().unwrap_or("unknown_so");
Expand All @@ -455,7 +450,6 @@ macro_rules! compatibility_check {

error_message.push_str(&format!("{} has an incompatible configuration for {}.\n\n", blue(so_name), red(env!("CARGO_PKG_NAME"))));

eprintln!("Calculating column widths for grid display");
// Compute max lengths for alignment
let max_exported_len = exported.iter().map(|(k, v)| format!("{}={}", k, v).len()).max().unwrap_or(0);
let max_ref_len = imported.iter().map(|(k, v)| format!("{}={}", k, v).len()).max().unwrap_or(0);
Expand Down Expand Up @@ -523,7 +517,6 @@ macro_rules! compatibility_check {
}
}

eprintln!("Creating grid for compatibility info display");
let mut grid = Grid::new();

// Add header
Expand Down Expand Up @@ -553,7 +546,6 @@ macro_rules! compatibility_check {
grid.add_row(vec![key_column, binary_column, module_column]);
}

eprintln!("Writing grid to error message");
grid.write_to(&mut error_message);

struct MessageBox {
Expand Down Expand Up @@ -603,7 +595,6 @@ macro_rules! compatibility_check {

error_message.push_str("More info: \x1b[4m\x1b[34mhttps://crates.io/crates/rubicon\x1b[0m\n");

eprintln!("Creating message box for additional information");
let mut message_box = MessageBox::new();
message_box.add_line(format!("To fix this issue, {} needs to enable", blue(so_name)));
message_box.add_line(format!("the same cargo features as {} for crate {}.", blue(&exe_name), red(env!("CARGO_PKG_NAME"))));
Expand All @@ -614,7 +605,6 @@ macro_rules! compatibility_check {
message_box.write_to(&mut error_message);
error_message.push_str("\n\x1b[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\x1b[0m\n");

eprintln!("Panicking with error message");
panic!("{}", error_message);
}
};
Expand Down

0 comments on commit d8e234e

Please sign in to comment.