diff --git a/.github/workflows/build-rhel7.yml b/.github/workflows/build-rhel7.yml index e9c3436..aa9118d 100644 --- a/.github/workflows/build-rhel7.yml +++ b/.github/workflows/build-rhel7.yml @@ -55,12 +55,12 @@ jobs: - run: ls -la /root - run: rustc --version - run: cargo --version - - run: mkdir /build - run: yum install -y git - - run: git clone https://github.com/paulscherrerinstitute/daqingest.git + - run: mkdir /build + - run: git clone --branch dev https://github.com/paulscherrerinstitute/daqbuffer.git + working-directory: /build + - run: git clone --branch dev https://github.com/paulscherrerinstitute/daqingest.git working-directory: /build - - run: git checkout dev - working-directory: /build/daqingest - run: cargo build working-directory: /build/daqingest diff --git a/Cargo.toml b/Cargo.toml index 5824053..16f7b42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,10 +3,13 @@ members = ["log", "netfetch", "daqingest"] resolver = "2" [profile.release] -opt-level = 3 +opt-level = 2 debug = 0 overflow-checks = false debug-assertions = false lto = "thin" codegen-units = 64 incremental = true + +[patch.crates-io] +thiserror = { git = "https://github.com/dominikwerder/thiserror.git" } diff --git a/dbpg/src/lib.rs b/dbpg/src/lib.rs index 1f5fe7c..0b7eba0 100644 --- a/dbpg/src/lib.rs +++ b/dbpg/src/lib.rs @@ -6,5 +6,6 @@ pub mod pool; pub mod schema; pub mod seriesbychannel; pub mod seriesid; +pub mod testerr; pub use tokio_postgres as postgres; diff --git a/dbpg/src/testerr.rs b/dbpg/src/testerr.rs new file mode 100644 index 0000000..12e9409 --- /dev/null +++ b/dbpg/src/testerr.rs @@ -0,0 +1,31 @@ +use err::thiserror; +use err::ThisError; +use std::fmt; + +#[derive(Debug)] +struct TestError { + msg: String, +} + +impl fmt::Display for TestError { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + write!(fmt, "{}", self.msg) + } +} + +impl std::error::Error for TestError {} + +#[derive(Debug, ThisError)] +enum Error { + Postgres(#[from] tokio_postgres::Error), + Dummy(#[from] TestError), +} + +#[test] +fn err_msg_01() { + let err: Error = TestError { + msg: "some-error".into(), + } + .into(); + assert_eq!(err.to_string(), "Error::Dummy(some-error)") +} diff --git a/ingest-linux/Cargo.toml b/ingest-linux/Cargo.toml index 5b9ed24..a1496f1 100644 --- a/ingest-linux/Cargo.toml +++ b/ingest-linux/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" [dependencies] libc = "0.2" -thiserror = "1.0.47" +thiserror = "1.0.41" log = { path = "../log" } taskrun = { path = "../../daqbuffer/crates/taskrun" }