Skip to content
Merged
Show file tree
Hide file tree
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
165 changes: 158 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ humansize = "2.1"
oci-spec = "0.10"
purl = { version = "0.1.6", default-features = false }
reqwest = { version = "0.13", features = ["json"] }
rstest = "0.27"
secrecy = "0.10"
regex = "1.13"
rstest = "0.29"
secrecy = "0.10"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
snafu = "0.9"
spdx = "0.13"
strum = { version = "0.28", features = ["derive"] }
sysinfo = { version = "0.40", default-features = false }
tempfile = "3.27"
time = { version = "0.3", features = ["parsing", "formatting"] }
tokio = { version = "1.53", features = ["rt", "macros", "process"] }
Expand Down
1 change: 1 addition & 0 deletions rust/boil/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ serde.workspace = true
serde_json.workspace = true
snafu.workspace = true
strum.workspace = true
sysinfo = { workspace = true, features = ["system"] }
time.workspace = true
tokio.workspace = true
toml.workspace = true
Expand Down
11 changes: 9 additions & 2 deletions rust/boil/src/cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{
use clap::{Args, ValueHint, value_parser};
use snafu::{ResultExt, Snafu, ensure};
use strum::EnumDiscriminants;
use sysinfo::System;
use url::Host;

use crate::{
Expand Down Expand Up @@ -37,6 +38,8 @@ pub struct BuildArguments {
pub vendor_version: String,

/// Target platform of the image.
///
/// Defaults to the system's architecture or linux/amd64 if unknown/not supported.
#[arg(
short, long,
short_alias = 'a', alias = "architecture",
Expand Down Expand Up @@ -144,9 +147,13 @@ pub struct BuildArguments {
}

impl BuildArguments {
// TODO: Auto-detect this
fn default_architecture() -> TargetPlatform {
TargetPlatform::Linux(Architecture::Amd64)
// NOTE (@Techassi): This is sadly not an enum we could match on, so we kind of have to
// treat this like free-form text. As such, we match on both aarch64 and arm64.
match System::cpu_arch().as_str() {
"aarch64" | "arm64" => TargetPlatform::Linux(Architecture::Arm64),
_ => TargetPlatform::Linux(Architecture::Amd64),
}
}

fn default_target_containerfile() -> PathBuf {
Expand Down
Loading