Skip to content

Commit a8264fd

Browse files
committed
fix(ci): stabilize builds across platforms
1 parent 0c7caf2 commit a8264fd

File tree

22 files changed

+448
-175
lines changed

22 files changed

+448
-175
lines changed

.github/actions/setup-openssl/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ runs:
4646
if (Test-Path $dir) {
4747
$libPath = Join-Path $dir "lib"
4848
$includePath = Join-Path $dir "include"
49-
if (Test-Path $libPath -and Test-Path $includePath) {
49+
if ((Test-Path $libPath) -and (Test-Path $includePath)) {
5050
$selected = $dir
5151
break
5252
}

.github/workflows/ci-go.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ jobs:
7070
- name: Build Go bindings
7171
run: |
7272
cd packages/go
73-
export LD_LIBRARY_PATH="${PWD}/../../target/release:${LD_LIBRARY_PATH}"
74-
export DYLD_LIBRARY_PATH="${PWD}/../../target/release:${DYLD_LIBRARY_PATH}"
73+
$env:LD_LIBRARY_PATH = "$PWD/../../target/release;$env:LD_LIBRARY_PATH"
74+
$env:DYLD_LIBRARY_PATH = "$PWD/../../target/release;$env:DYLD_LIBRARY_PATH"
7575
go build -v ./...
76+
shell: pwsh
7677

7778
- name: Show sccache stats
7879
run: sccache --show-stats

.github/workflows/ci-node.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
cd crates/kreuzberg-node
8686
pnpm install
8787
pnpm exec napi build --platform --release --target ${{ matrix.target }}
88-
pnpm exec napi artifacts
88+
pnpm exec napi artifacts --output-dir ./artifacts
8989
pnpm exec napi prepublish -t npm --no-gh-release
9090
pnpm pack
9191

.github/workflows/ci-python.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
working-directory: packages/python
8484
command: build
8585
args: --release --strip --out ../../target/wheels
86-
sccache: 'true'
86+
sccache: 'false'
8787
manylinux: auto
8888

8989
- name: Show sccache stats

Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ tasks:
621621
desc: Lint Go code in check-only mode (gofmt + golangci-lint, no fixes)
622622
dir: packages/go
623623
cmds:
624-
- go fmt -l ./... | grep -q . && exit 1 || true
624+
- gofmt -l . | grep -q . && exit 1 || true
625625
- golangci-lint run --config ../../.golangci.yml ./...
626626
go:format:
627627
desc: Format Go code with modifications (gofmt)

crates/kreuzberg/src/mcp/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! use kreuzberg::mcp::start_mcp_server;
1717
//!
1818
//! #[tokio::main]
19-
//! async fn main() -> anyhow::Result<()> {
19+
//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
2020
//! start_mcp_server().await?;
2121
//! Ok(())
2222
//! }

crates/kreuzberg/src/mcp/server.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ impl Default for KreuzbergMcp {
428428
/// use kreuzberg::mcp::start_mcp_server;
429429
///
430430
/// #[tokio::main]
431-
/// async fn main() -> anyhow::Result<()> {
431+
/// async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
432432
/// start_mcp_server().await?;
433433
/// Ok(())
434434
/// }
@@ -444,7 +444,9 @@ pub async fn start_mcp_server() -> Result<(), Box<dyn std::error::Error + Send +
444444
///
445445
/// This variant allows specifying a custom extraction configuration
446446
/// (e.g., loaded from a file) instead of using defaults.
447-
pub async fn start_mcp_server_with_config(config: ExtractionConfig) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
447+
pub async fn start_mcp_server_with_config(
448+
config: ExtractionConfig,
449+
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
448450
let service = KreuzbergMcp::with_config(config).serve(stdio()).await?;
449451

450452
service.waiting().await?;

crates/kreuzberg/src/plugins/extractor.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ pub fn clear_extractors() -> crate::Result<()> {
538538
#[cfg(test)]
539539
mod tests {
540540
use super::*;
541+
use serial_test::serial;
541542

542543
struct MockExtractor {
543544
mime_types: Vec<&'static str>,
@@ -833,6 +834,7 @@ mod tests {
833834
// Tests for public registration APIs
834835

835836
#[test]
837+
#[serial]
836838
fn test_register_extractor() {
837839
use std::sync::Arc;
838840

@@ -847,6 +849,7 @@ mod tests {
847849
}
848850

849851
#[test]
852+
#[serial]
850853
fn test_unregister_extractor() {
851854
use std::sync::Arc;
852855

@@ -861,12 +864,14 @@ mod tests {
861864
}
862865

863866
#[test]
867+
#[serial]
864868
fn test_unregister_nonexistent_extractor() {
865869
let result = super::unregister_extractor("nonexistent-extractor-xyz");
866870
assert!(result.is_ok());
867871
}
868872

869873
#[test]
874+
#[serial]
870875
fn test_list_extractors() {
871876
use std::sync::Arc;
872877

@@ -896,6 +901,7 @@ mod tests {
896901
}
897902

898903
#[test]
904+
#[serial]
899905
fn test_clear_extractors() {
900906
use std::sync::Arc;
901907

@@ -921,6 +927,7 @@ mod tests {
921927
}
922928

923929
#[test]
930+
#[serial]
924931
fn test_register_extractor_with_invalid_name() {
925932
use std::sync::Arc;
926933

@@ -965,6 +972,7 @@ mod tests {
965972
}
966973

967974
#[test]
975+
#[serial]
968976
fn test_register_extractor_with_empty_name() {
969977
use std::sync::Arc;
970978

crates/kreuzberg/tests/api_extract_multipart.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
//! Integration test for the `/extract` API handler using multipart uploads.
33
44
use axum::{
5-
body::{to_bytes, Body},
5+
body::{Body, to_bytes},
66
http::{Request, StatusCode},
77
};
88
use kreuzberg::{
9-
api::{create_router_with_limits, ApiSizeLimits},
109
ExtractionConfig,
10+
api::{ApiSizeLimits, create_router_with_limits},
1111
};
1212
use serde_json::Value;
1313
use tower::ServiceExt;
@@ -30,10 +30,7 @@ Hello world\r\n\
3030
let request = Request::builder()
3131
.method("POST")
3232
.uri("/extract")
33-
.header(
34-
"content-type",
35-
format!("multipart/form-data; boundary={boundary}"),
36-
)
33+
.header("content-type", format!("multipart/form-data; boundary={boundary}"))
3734
.header("content-length", body_bytes.len())
3835
.body(Body::from(body_bytes))
3936
.expect("Failed to build request");

docs/snippets/rust/mcp_server_start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use kreuzberg::{ExtractionConfig, mcp::start_mcp_server_with_config};
33

44
#[tokio::main]
5-
async fn main() -> Result<(), Box<dyn std::error::Error>> {
5+
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
66
let config = ExtractionConfig::discover()?;
77
start_mcp_server_with_config(config).await?;
88
Ok(())

0 commit comments

Comments
 (0)