Skip to content
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

Fix nix build #853

Merged
merged 20 commits into from
Dec 22, 2024
Merged
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
5 changes: 1 addition & 4 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@ name: Nix Build
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- '**/*.rs'
- '.github/workflows/nix-build.yml'
@@ -26,5 +24,4 @@ jobs:
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: DeterminateSystems/flake-checker-action@main
- name: Run `nix build`
run: nix build --max-jobs auto --build-max-jobs auto --print-build-logs
- run: nix build --max-jobs auto --build-max-jobs auto --print-build-logs
2 changes: 1 addition & 1 deletion frontends/rioterm/src/context/grid.rs
Original file line number Diff line number Diff line change
@@ -991,7 +991,7 @@ pub mod test {

assert_eq!(context_dimension.columns, 66);
assert_eq!(context_dimension.lines, 88);
let rich_text_id = 1;
let rich_text_id = 0;
let route_id = 0;
let context = create_mock_context(
VoidListener {},
40 changes: 38 additions & 2 deletions frontends/rioterm/src/context/mod.rs
Original file line number Diff line number Diff line change
@@ -181,7 +181,7 @@ pub struct ContextManager<T: EventListener> {
pub titles: ContextManagerTitles,
}

pub fn create_mock_context<T: rio_backend::event::EventListener>(
pub fn create_dead_context<T: rio_backend::event::EventListener>(
event_proxy: T,
window_id: WindowId,
route_id: usize,
@@ -213,6 +213,42 @@ pub fn create_mock_context<T: rio_backend::event::EventListener>(
}
}

#[cfg(test)]
pub fn create_mock_context<
T: rio_backend::event::EventListener + Clone + std::marker::Send + 'static,
>(
event_proxy: T,
window_id: WindowId,
route_id: usize,
rich_text_id: usize,
dimension: ContextDimension,
) -> Context<T> {
let config = ContextManagerConfig {
#[cfg(not(target_os = "windows"))]
use_fork: true,
working_dir: None,
shell: Shell {
program: std::env::var("SHELL").unwrap_or("bash".to_string()),
args: vec![],
},
spawn_performer: false,
is_native: false,
should_update_titles: false,
use_current_path: false,
split_color: [0., 0., 0., 0.],
};
ContextManager::create_context(
(&Cursor::default(), false),
event_proxy.clone(),
window_id,
route_id,
rich_text_id,
dimension,
&config,
)
.unwrap()
}

impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
#[inline]
fn create_context(
@@ -358,7 +394,7 @@ impl<T: EventListener + Clone + std::marker::Send + 'static> ContextManager<T> {
window_id,
);

create_mock_context(
create_dead_context(
event_proxy.clone(),
window_id,
route_id,