Skip to content

Commit

Permalink
Fix CI failure: update libdatadog_profiling.so SONAME (#624)
Browse files Browse the repository at this point in the history
  • Loading branch information
gleocadie authored Sep 12, 2024
1 parent 30b7bc4 commit 0c03f15
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,12 @@ jobs:
if: matrix.platform != 'windows-latest'
run: |
set -e
rm -rf examples/ffi/build
mkdir examples/ffi/build
cd examples/ffi/build
# Add BUILD_SYMBOLIZER variable only for Linux platforms
if [[ "${{ matrix.platform }}" == "ubuntu-latest" ]]; then
cmake -S .. -DDatadog_ROOT=$LIBDD_OUTPUT_FOLDER -DBUILD_SYMBOLIZER=true
cmake --build .
cmake --build .
./symbolizer
else
cmake -S .. -DDatadog_ROOT=$LIBDD_OUTPUT_FOLDER
Expand Down
2 changes: 2 additions & 0 deletions builder/build/arch/apple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ pub fn strip_libraries(lib_path: &str) {

strip.wait().expect("Failed to strip library");
}

pub fn fix_soname(_lib_path: &str) {}
9 changes: 9 additions & 0 deletions builder/build/arch/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@ pub fn strip_libraries(lib_path: &str) {

debug.wait().expect("Failed to set debuglink");
}

pub fn fix_soname(lib_path: &str) {
Command::new("patchelf")
.arg("--set-soname")
.arg(PROF_DYNAMIC_LIB)
.arg(lib_path.to_owned() + "/" + PROF_DYNAMIC_LIB)
.spawn()
.expect("failed to change the soname");
}
9 changes: 9 additions & 0 deletions builder/build/arch/musl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,12 @@ pub fn strip_libraries(lib_path: &str) {

debug.wait().expect("Failed to set debuglink");
}

pub fn fix_soname(lib_path: &str) {
Command::new("patchelf")
.arg("--set-soname")
.arg(PROF_DYNAMIC_LIB)
.arg(lib_path)
.spawn()
.expect("failed to change the soname");
}
1 change: 1 addition & 0 deletions builder/build/arch/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ pub const BUILD_CRASHTRACKER: bool = false;

pub fn fix_rpath(_lib_path: &str) {}
pub fn strip_libraries(_lib_path: &str) {}
pub fn fix_soname(_lib_path: &str) {}
2 changes: 2 additions & 0 deletions builder/build/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ impl Profiling {
.collect();
fs::copy(from_static, to_static).expect("unable to copy static lib");

arch::fix_soname(&self.target_lib);

// Generate debug information
arch::strip_libraries(&self.target_lib);
Ok(())
Expand Down

0 comments on commit 0c03f15

Please sign in to comment.