refactor(xtask): rename ProjectProfile to ProjectConfig
What changed, and why it matters
This commit is a simple rename from 'ProjectProfile' to 'ProjectConfig' in two Rust source files. It only changes variable names, struct names, and error messages. There is no change to program logic, security behavior, or how data is handled.
No security action needed. Treat as routine code maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
Pure refactoring commit. The struct ProjectProfile is renamed to ProjectConfig, and all references, local variables, and error context strings are updated accordingly in core/embed/xtask/src/config.rs and core/embed/xtask/src/postbuild.rs. No functional code paths, parsing logic, feature resolution, or binary post-processing behavior is altered.
Changed components
core/embed/xtask/src/config.rscore/embed/xtask/src/postbuild.rsInspect captured patch +18 / −18
diff --git a/core/embed/xtask/src/config.rs b/core/embed/xtask/src/config.rs
index 70f325f3..6449ffa7 100644
--- a/core/embed/xtask/src/config.rs
+++ b/core/embed/xtask/src/config.rs
@@ -135,7 +135,7 @@ impl BoardConfig {
}
#[derive(Deserialize)]
-pub struct ProjectProfile {
+pub struct ProjectConfig {
pub uses: Vec<String>,
pub elf_sections: Vec<String>,
/// Body sections used when the model has secmon and the binary needs a
@@ -152,7 +152,7 @@ pub struct ProjectProfile {
pub split_part2_sections: Option<Vec<String>>,
}
-impl ProjectProfile {
+impl ProjectConfig {
pub fn load(project: Project) -> Result<Self> {
let pkg = project.package_name(false);
let path = workspace_dir()?
@@ -160,9 +160,9 @@ impl ProjectProfile {
.join(pkg)
.join("project.toml");
let content = std::fs::read_to_string(&path)
- .with_context(|| format!("Failed to read project profile: {}", path.display()))?;
+ .with_context(|| format!("Failed to read project config: {}", path.display()))?;
toml::from_str(&content)
- .with_context(|| format!("Failed to parse project profile: {}", path.display()))
+ .with_context(|| format!("Failed to parse project config: {}", path.display()))
}
}
@@ -184,7 +184,7 @@ pub fn resolve_board_features(
emulator: bool,
) -> Result<BoardFeatures> {
let board_config = BoardConfig::load(&model_config.model_id, board_id)?;
- let project_profile = ProjectProfile::load(project)?;
+ let project_config = ProjectConfig::load(project)?;
let pkg = project.package_name(false);
let model_override = model_config
.project_overrides
@@ -192,19 +192,19 @@ pub fn resolve_board_features(
.cloned()
.unwrap_or_default();
- let uses: HashSet<&str> = project_profile.uses.iter().map(|s| s.as_str()).collect();
+ let uses: HashSet<&str> = project_config.uses.iter().map(|s| s.as_str()).collect();
let exclude: HashSet<&str> = model_override.exclude.iter().map(|s| s.as_str()).collect();
let mut features = Vec::new();
- // Model-intrinsic features filtered by project profile then model exceptions
+ // Model-intrinsic features filtered by project config then model exceptions
for f in &model_config.features {
if uses.contains(f.as_str()) && !exclude.contains(f.as_str()) {
features.push(f.clone());
}
}
- // Board peripheral features filtered by project profile then model exceptions
+ // Board peripheral features filtered by project config then model exceptions
for periph in &board_config.peripherals {
if uses.contains(periph.name.as_str()) && !exclude.contains(periph.name.as_str()) {
features.push(periph.name.clone());
diff --git a/core/embed/xtask/src/postbuild.rs b/core/embed/xtask/src/postbuild.rs
index 93a9ea94..0abd68e3 100644
--- a/core/embed/xtask/src/postbuild.rs
+++ b/core/embed/xtask/src/postbuild.rs
@@ -4,7 +4,7 @@ use std::{fs, process};
use anyhow::{Context, Result, ensure};
use crate::args::Project;
-use crate::config::{ModelConfig, ProjectProfile};
+use crate::config::{ModelConfig, ProjectConfig};
use crate::helpers;
use crate::model::Model;
@@ -17,7 +17,7 @@ pub fn elf_to_bin(
model_config: &ModelConfig,
use_dev_keys: bool,
) -> Result<PathBuf> {
- let project_profile = ProjectProfile::load(project)?;
+ let project_config = ProjectConfig::load(project)?;
match project {
Project::Firmware => {
@@ -25,12 +25,12 @@ pub fn elf_to_bin(
// STM32F4 firmware flash is non-contiguous — two banks separated
// by the storage area must be extracted and concatenated.
// Part1 uses the same elf_sections as the flat (non-split) path.
- let pad_to = project_profile
+ let pad_to = project_config
.split_pad_to
.as_deref()
.ok_or_else(|| anyhow::anyhow!("firmware project.toml missing split_pad_to"))?;
let part2_sections =
- project_profile
+ project_config
.split_part2_sections
.as_ref()
.ok_or_else(|| {
@@ -39,13 +39,13 @@ pub fn elf_to_bin(
let part1 = objcopy_ex(
source,
"part1",
- &project_profile.elf_sections,
+ &project_config.elf_sections,
["--pad-to", pad_to],
)?;
let part2 = objcopy_ex(source, "part2", part2_sections, [] as [&str; 0])?;
concat_files(part1.with_extension("ubin"), [part1, part2])
} else {
- objcopy(source, &project_profile.elf_sections)
+ objcopy(source, &project_config.elf_sections)
}
}
@@ -54,14 +54,14 @@ pub fn elf_to_bin(
// On secmon models prodtest is a secmon-signed body with a plain
// vendor header prepended. The body is signed before concatenation.
let body_sections =
- project_profile
+ project_config
.secmon_body_sections
.as_ref()
.ok_or_else(|| {
anyhow::anyhow!("prodtest project.toml missing secmon_body_sections")
})?;
let header_sections =
- project_profile
+ project_config
.secmon_header_sections
.as_ref()
.ok_or_else(|| {
@@ -73,11 +73,11 @@ pub fn elf_to_bin(
objcopy_ex(source, "header.bin", header_sections, [] as [&str; 0])?;
concat_files(source.with_extension("bin"), [header_bin, body_bin])
} else {
- objcopy(source, &project_profile.elf_sections)
+ objcopy(source, &project_config.elf_sections)
}
}
- _ => objcopy(source, &project_profile.elf_sections),
+ _ => objcopy(source, &project_config.elf_sections),
}
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.