Skip to content

Commit f31f708

Browse files
committed
Fix CI Linux dependencies and clippy warnings
1 parent 8cf3e67 commit f31f708

4 files changed

Lines changed: 41 additions & 12 deletions

File tree

.github/workflows/fast-pr.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030

31+
- name: Install system libraries
32+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
33+
3134
- name: Install Rust toolchain
3235
uses: dtolnay/rust-toolchain@stable
3336
with:
@@ -43,6 +46,9 @@ jobs:
4346
- name: Checkout code
4447
uses: actions/checkout@v4
4548

49+
- name: Install system libraries
50+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
51+
4652
- name: Install Rust toolchain
4753
uses: dtolnay/rust-toolchain@stable
4854
with:
@@ -61,6 +67,9 @@ jobs:
6167
- name: Checkout code
6268
uses: actions/checkout@v4
6369

70+
- name: Install system libraries
71+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
72+
6473
- name: Install Rust toolchain
6574
uses: dtolnay/rust-toolchain@stable
6675

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jobs:
3737
- name: Checkout code
3838
uses: actions/checkout@v4
3939

40+
- name: Install system libraries
41+
if: runner.os == 'Linux'
42+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
43+
4044
- name: Install Rust toolchain
4145
uses: dtolnay/rust-toolchain@stable
4246
with:
@@ -84,6 +88,10 @@ jobs:
8488
- name: Checkout code
8589
uses: actions/checkout@v4
8690

91+
- name: Install system libraries
92+
if: runner.os == 'Linux'
93+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
94+
8795
- name: Install Rust toolchain
8896
uses: dtolnay/rust-toolchain@stable
8997
with:
@@ -126,6 +134,10 @@ jobs:
126134
- name: Checkout code
127135
uses: actions/checkout@v4
128136

137+
- name: Install system libraries
138+
if: matrix.os == 'ubuntu-latest'
139+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
140+
129141
- name: Install Rust toolchain
130142
uses: dtolnay/rust-toolchain@stable
131143
with:
@@ -154,6 +166,9 @@ jobs:
154166
- name: Checkout code
155167
uses: actions/checkout@v4
156168

169+
- name: Install system libraries
170+
run: sudo apt-get update && sudo apt-get install -y pkg-config libfontconfig1-dev
171+
157172
- name: Install Rust toolchain
158173
uses: dtolnay/rust-toolchain@stable
159174

src/api/janus_api.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ impl JanusApi {
341341
{
342342
let mut processor = live_processor.lock().unwrap();
343343
if !parsed.ast.baseline_uses.is_empty() {
344-
let (_query_defined_baselines, baseline_quads) =
344+
let (query_defined_baselines_map, baseline_quads) =
345345
evaluate_and_materialize_query_defined_baselines(
346346
&self.storage,
347347
parsed,
348348
&mpsc::channel::<()>().1,
349349
)?;
350350
if let Ok(mut stored) = query_defined_baselines.write() {
351-
*stored = _query_defined_baselines;
351+
*stored = query_defined_baselines_map;
352352
}
353353
materialize_static_quads(&mut processor, &baseline_quads)?;
354354
}
@@ -1193,9 +1193,7 @@ fn parse_literal_term(raw: &str) -> Result<Literal, String> {
11931193
let lexical = unescape_literal_lexical(lexical);
11941194

11951195
if let Some(language) = suffix.strip_prefix('@') {
1196-
return Ok(
1197-
Literal::new_language_tagged_literal(lexical, language).map_err(|e| e.to_string())?
1198-
);
1196+
return Literal::new_language_tagged_literal(lexical, language).map_err(|e| e.to_string());
11991197
}
12001198

12011199
if let Some(datatype_iri) = suffix.strip_prefix("^^") {

src/paper_bench/query_defined_baseline.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use std::{
2222
fs::File,
2323
io::Write,
2424
path::{Path, PathBuf},
25+
convert::TryFrom,
2526
sync::Arc,
2627
thread,
2728
time::{Duration, Instant, SystemTime, UNIX_EPOCH},
@@ -628,7 +629,7 @@ fn write_historical_events(
628629

629630
let event_started = Instant::now();
630631
let sensor_idx = event_idx % baseline_entities_count;
631-
let value = 10 + sensor_idx as i64;
632+
let value = 10 + i64::try_from(sensor_idx).expect("sensor index fits in i64");
632633
let event = RDFEvent::new(
633634
timestamp,
634635
&sensor_iri(sensor_idx),
@@ -669,7 +670,7 @@ fn generate_accelerated_live_events(baseline_entities_count: usize) -> Vec<RDFEv
669670
let mut events = Vec::with_capacity(baseline_entities_count);
670671
for sensor_idx in 0..baseline_entities_count {
671672
let timestamp = 1000 + (sensor_idx as u64 * 10);
672-
let value = 20 + sensor_idx as i64 * 10;
673+
let value = 20 + i64::try_from(sensor_idx).expect("sensor index fits in i64") * 10;
673674
events.push(RDFEvent::new(
674675
timestamp,
675676
&sensor_iri(sensor_idx),
@@ -691,7 +692,7 @@ fn generate_realtime_live_events(
691692
for event_idx in 0..live_event_count {
692693
let sensor_idx = event_idx % baseline_entities_count;
693694
let timestamp = start_timestamp + ((event_idx as f64) * event_interval_ms).round() as u64;
694-
let value = 20 + sensor_idx as i64 * 10;
695+
let value = 20 + i64::try_from(sensor_idx).expect("sensor index fits in i64") * 10;
695696
events.push(RDFEvent::new(
696697
timestamp,
697698
&sensor_iri(sensor_idx),
@@ -832,6 +833,7 @@ GROUP BY ?sensor
832833
)
833834
}
834835

836+
#[allow(clippy::too_many_arguments)]
835837
fn run_single_comparison(
836838
parser: &JanusQLParser,
837839
prepared: &PreparedStorage,
@@ -902,6 +904,7 @@ fn run_single_comparison(
902904
Ok(comparison)
903905
}
904906

907+
#[allow(clippy::too_many_arguments)]
905908
fn run_baseline_variant(
906909
parser: &JanusQLParser,
907910
prepared: &PreparedStorage,
@@ -997,9 +1000,10 @@ fn run_baseline_variant(
9971000
let observed_rows = parse_live_rows(&collected)?;
9981001
log_stage(verbose, "baseline", "done");
9991002
let mut window_semantics_note = if live_replay.mode == LiveReplayMode::Realtime {
1000-
Some(format!(
1003+
Some(
10011004
"Realtime replay reports emitted windows separately from full windows; the first emission is the initial warm-up window and full windows follow at the logical duration horizon."
1002-
))
1005+
.to_string(),
1006+
)
10031007
} else {
10041008
None
10051009
};
@@ -1120,6 +1124,7 @@ fn run_baseline_variant(
11201124
Ok(VariantRunData { metrics })
11211125
}
11221126

1127+
#[allow(clippy::too_many_arguments)]
11231128
fn run_live_only_variant(
11241129
prepared: &PreparedStorage,
11251130
live_replay: &ResolvedLiveReplayConfig,
@@ -1181,9 +1186,10 @@ fn run_live_only_variant(
11811186
let observed_rows = parse_live_rows(&collected)?;
11821187
log_stage(verbose, "live_only", "done");
11831188
let mut window_semantics_note = if live_replay.mode == LiveReplayMode::Realtime {
1184-
Some(format!(
1189+
Some(
11851190
"Realtime replay reports emitted windows separately from full windows; the first emission is the initial warm-up window and full windows follow at the logical duration horizon."
1186-
))
1191+
.to_string(),
1192+
)
11871193
} else {
11881194
None
11891195
};
@@ -1538,6 +1544,7 @@ fn build_correctness_diagnostics(
15381544
}
15391545
}
15401546

1547+
#[allow(clippy::too_many_arguments)]
15411548
fn validate_baseline_rows(
15421549
rows: &[QueryDefinedBaselineObservedRow],
15431550
expected_live_averages: &HashMap<String, f64>,

0 commit comments

Comments
 (0)