Skip to content

fix: delay profile/rc loading until after input backend attached#879

Merged
reubeno merged 2 commits into
mainfrom
delay-profile-loading
Dec 27, 2025
Merged

fix: delay profile/rc loading until after input backend attached#879
reubeno merged 2 commits into
mainfrom
delay-profile-loading

Conversation

@reubeno
Copy link
Copy Markdown
Owner

@reubeno reubeno commented Dec 27, 2025

This is required to allow builtins like bind to succeed when run under profile/rc.

@reubeno reubeno force-pushed the delay-profile-loading branch from 8ca2ff2 to 41e5a78 Compare December 27, 2025 08:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 27, 2025

Public API changes for crate: brush-core

Removed items

-pub brush_core::CreateOptions::no_profile: bool
-pub brush_core::CreateOptions::no_rc: bool
-pub brush_core::CreateOptions::rc_file: core::option::Option<std::path::PathBuf>
-pub type brush_core::ShellBuilderState::NoProfile
-pub type brush_core::ShellBuilderState::NoRc
-pub type brush_core::ShellBuilderState::RcFile

Added items

+pub enum brush_core::ProfileLoadBehavior
+pub brush_core::ProfileLoadBehavior::LoadDefault
+pub brush_core::ProfileLoadBehavior::Skip
+impl brush_core::ProfileLoadBehavior
+pub const fn brush_core::ProfileLoadBehavior::skip(&self) -> bool
+pub enum brush_core::RcLoadBehavior
+pub brush_core::RcLoadBehavior::LoadCustom(std::path::PathBuf)
+pub brush_core::RcLoadBehavior::LoadDefault
+pub brush_core::RcLoadBehavior::Skip
+impl brush_core::RcLoadBehavior
+pub const fn brush_core::RcLoadBehavior::skip(&self) -> bool
+pub brush_core::CreateOptions::profile: brush_core::ProfileLoadBehavior
+pub brush_core::CreateOptions::rc: brush_core::RcLoadBehavior
+pub type brush_core::ShellBuilderState::Profile
+pub type brush_core::ShellBuilderState::Rc

Changed items

-pub async fn brush_core::Shell::load_config(&mut self, skip_profile: bool, skip_rc: bool, rc_file: core::option::Option<&std::path::Path>) -> core::result::Result<(), brush_core::error::Error>
+pub async fn brush_core::Shell::load_config(&mut self, profile_behavior: &brush_core::ProfileLoadBehavior, rc_behavior: &brush_core::RcLoadBehavior) -> core::result::Result<(), brush_core::error::Error>

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 18.76 μs 17.51 μs -1.26 μs 🟢 -6.69%
eval_arithmetic 0.14 μs 0.14 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.61 μs 1.64 μs 0.02 μs ⚪ Unchanged
for_loop 22.25 μs 21.94 μs -0.31 μs ⚪ Unchanged
function_call 2.29 μs 2.27 μs -0.02 μs ⚪ Unchanged
instantiate_shell 53.52 μs 54.18 μs 0.67 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 24450.38 μs 24791.13 μs 340.76 μs ⚪ Unchanged
parse_bash_completion 2013.52 μs 2021.48 μs 7.96 μs ⚪ Unchanged
parse_sample_script 1.97 μs 1.94 μs -0.03 μs 🟢 -1.57%
run_echo_builtin_command 15.54 μs 15.43 μs -0.11 μs ⚪ Unchanged
tokenize_sample_script 3.48 μs 3.53 μs 0.05 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/expansion.rs 🟢 94.44% 🟢 94.52% 🟢 0.08%
brush-core/src/shell.rs 🟢 82.87% 🟢 84.6% 🟢 1.73%
brush-shell/src/entry.rs 🟢 84.52% 🟢 85.39% 🟢 0.87%
Overall Coverage 🟢 74.08% 🟢 74.19% 🟢 0.11%

Minimum allowed coverage is 70%, this run produced 74.19%

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1546 73.30
❗️ Error 19 0.90
❌ Fail 190 9.01
⏩ Skip 339 16.07
❎ Expected Fail 13 0.62
✔️ Unexpected Pass 2 0.09
📊 Total 2109 100.00

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 27, 2025

Test Results

    3 files     26 suites   9m 17s ⏱️
1 455 tests 1 455 ✅ 0 💤 0 ❌
4 345 runs  4 345 ✅ 0 💤 0 ❌

Results for commit 264f2f5.

♻️ This comment has been updated with latest results.

@reubeno reubeno force-pushed the delay-profile-loading branch from d086505 to 264f2f5 Compare December 27, 2025 09:00
@reubeno reubeno merged commit f7cd8c6 into main Dec 27, 2025
43 checks passed
@reubeno reubeno deleted the delay-profile-loading branch December 27, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant