Skip to content

Commit

Permalink
build: Fix CI and docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-auer committed Nov 24, 2021
1 parent 18e4b0b commit 5531c0c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Install libcurl-dev
run: sudo apt-get install -y libcurl4-openssl-dev

- uses: actions/checkout@v2
with:
submodules: recursive
Expand Down Expand Up @@ -109,6 +112,9 @@ jobs:
- 6379:6379

steps:
- name: Install libcurl-dev
run: sudo apt-get install -y libcurl4-openssl-dev

- uses: actions/checkout@v2
with:
submodules: recursive
Expand Down Expand Up @@ -200,6 +206,9 @@ jobs:
- 9092:9092

steps:
- name: Install libcurl-dev
run: sudo apt-get install -y libcurl4-openssl-dev

- uses: actions/checkout@v2
with:
submodules: recursive
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
RUSTDOCFLAGS: -Dbroken_intra_doc_links

steps:
- name: Install libcurl-dev
run: sudo apt-get install -y libcurl4-openssl-dev

- uses: actions/checkout@v2
with:
submodules: recursive
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ENV BUILD_TARGET=${BUILD_ARCH}-unknown-linux-gnu
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl build-essential git zip cmake \
# below required for sentry-native
clang libcurl4-openssl-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -29,7 +31,7 @@ WORKDIR /work
FROM getsentry/sentry-cli:1 AS sentry-cli
FROM relay-deps AS relay-builder

ARG RELAY_FEATURES=ssl,processing
ARG RELAY_FEATURES=ssl,processing,crash-handler
ENV RELAY_FEATURES=${RELAY_FEATURES}

COPY --from=sentry-cli /bin/sentry-cli /bin/sentry-cli
Expand Down
2 changes: 1 addition & 1 deletion relay-crash/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
match std::env::var("CARGO_CFG_TARGET_OS").unwrap().as_str() {
"macos" => println!("cargo:rustc-link-lib=dylib=c++"),
"linux" => println!("cargo:rustc-link-lib=dylib=stdc++"),
os => unimplemented!("crash-handler is not supported on {}", os),
_ => return, // allow building with --all-features, fail during runtime
}

println!("cargo:rustc-link-lib=curl");
Expand Down
11 changes: 10 additions & 1 deletion relay-crash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
//!
//! Use [`CrashHandler`] to configure and install a crash handler.
use std::{ffi::CString, path::Path};
use std::path::Path;

#[cfg(unix)]
mod native {
// Code generated by bindgen contains some warnings and also offends the linter. Ignore all of
// that since they do not have a consequence on the functions used for relay-crash.
Expand Down Expand Up @@ -54,7 +55,10 @@ impl<'a> CrashHandler<'a> {
}

/// Installs the crash handler in the process if a Sentry DSN is set.
#[cfg(unix)]
pub fn install(&self) {
use std::ffi::CString;

unsafe {
let options = native::sentry_options_new();

Expand All @@ -77,4 +81,9 @@ impl<'a> CrashHandler<'a> {
native::sentry_init(options);
}
}

#[cfg(not(unix))]
pub fn install(&self) {
unimplemented!("crash handler not supported on this platform");
}
}

0 comments on commit 5531c0c

Please sign in to comment.