-
Notifications
You must be signed in to change notification settings - Fork 1
feat(clean): add standalone framework cache cleanup #1101
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,22 +95,54 @@ pub async fn run_sequential_build_with_libs( | |
| // libs → link), but each phase fans out file compilation across `jobs` | ||
| // threads via `compile_sources_parallel`. | ||
| let jobs = crate::parallel::effective_jobs(params.jobs); | ||
| let core_cache = crate::framework_core_cache::FrameworkCoreCache::new( | ||
| ¶ms.project_dir, | ||
| platform_label, | ||
| ¶ms.env_name, | ||
| params.profile, | ||
| compiler, | ||
| &core_and_variant, | ||
| &user_overlay, | ||
| ); | ||
| if params.clean_all { | ||
| let _g = perf.phase("core-cache-remove"); | ||
| match core_cache.remove() { | ||
| Ok(()) => tracing::info!( | ||
| "removed framework core cache key={} at {}", | ||
| core_cache.key(), | ||
| core_cache.path().display() | ||
| ), | ||
| Err(error) => tracing::warn!( | ||
| "failed to remove framework core cache key={} at {}: {}", | ||
| core_cache.key(), | ||
| core_cache.path().display(), | ||
| error | ||
| ), | ||
| } | ||
| } | ||
|
Comment on lines
+107
to
+122
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Fail
📍 Affects 3 files
🤖 Prompt for AI Agents |
||
| if params.clean_only { | ||
| if params.build_dir.exists() { | ||
| std::fs::remove_dir_all(¶ms.build_dir)?; | ||
| } | ||
| return Ok(BuildResult { | ||
| success: true, | ||
| firmware_path: None, | ||
| elf_path: None, | ||
| size_info: None, | ||
| symbol_map: None, | ||
| build_time_secs: start.elapsed().as_secs_f64(), | ||
| message: format!( | ||
| "cleaned {} ({})", | ||
| params.env_name, | ||
| params.profile.as_dir_name() | ||
| ), | ||
| compile_database_path: None, | ||
| build_log: ctx.build_log, | ||
| }); | ||
| } | ||
| let build_log_mutex = std::sync::Mutex::new(ctx.build_log); | ||
|
|
||
| let core_cache = if params.clean { | ||
| None | ||
| } else { | ||
| Some(crate::framework_core_cache::FrameworkCoreCache::new( | ||
| ¶ms.project_dir, | ||
| platform_label, | ||
| ¶ms.env_name, | ||
| params.profile, | ||
| compiler, | ||
| &core_and_variant, | ||
| &user_overlay, | ||
| )) | ||
| }; | ||
| if let Some(cache) = core_cache.as_ref() { | ||
| { | ||
| let cache = &core_cache; | ||
| let _g = perf.phase("core-cache-hydrate"); | ||
| match cache.hydrate( | ||
| &ctx.core_build_dir, | ||
|
|
@@ -165,7 +197,8 @@ pub async fn run_sequential_build_with_libs( | |
| .await? | ||
| }; | ||
| core_objects.extend(variant_objects); | ||
| if let Some(cache) = core_cache.as_ref() { | ||
| { | ||
| let cache = &core_cache; | ||
| let _g = perf.phase("core-cache-store"); | ||
| match cache.store(&ctx.core_build_dir) { | ||
| Ok(stats) if stats.copied > 0 => tracing::info!( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Escape the pipe in the command name.
sketch|allcreates an extra table cell, so the “See more” value is dropped.Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[style] ~15-~15: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...ld
| |fbuild clean sketch|all` | You want to remove one environment/profile's projec...(REP_WANT_TO_VB)
🪛 markdownlint-cli2 (0.23.0)
[warning] 15-15: Table column count
Expected: 3; Actual: 4; Too many cells, extra data will be missing
(MD056, table-column-count)
🤖 Prompt for AI Agents
Source: Linters/SAST tools