From a623c40f3ba0f090f67372c23bc4c5cf9b80b592 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:58:38 -0500 Subject: [PATCH] Initial work to setup external libdwarf for CI --- .github/workflows/build.yml | 94 ++++++++++++++++++++++++++++++++++--- .github/workflows/test.yml | 94 ++++++++++++++++++++++++++++++++++--- ci/build-in-all-configs.py | 6 ++- ci/test-all-configs.py | 4 ++ 4 files changed, 185 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 212d1d0..b88dc25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,18 +10,51 @@ jobs: steps: - uses: actions/checkout@v2 - name: dependencies - run: sudo apt install gcc-10 g++-10 libgcc-10-dev + run: | + sudo apt install gcc-10 g++-10 libgcc-10-dev + pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + make -j + sudo make install + cd ../../cpptrace - name: build run: | - pip3 install colorama python3 ci/build-in-all-configs.py build-macos: runs-on: macos-13 steps: - uses: actions/checkout@v2 - - name: build + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + make -j + sudo make install + cd ../../cpptrace + - name: build + run: | python3 ci/build-in-all-configs.py build-windows-msvc: runs-on: windows-2019 @@ -29,9 +62,25 @@ jobs: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: build + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + msbuild INSTALL.vcxproj + cd ../../cpptrace + - name: build + run: | python3 ci/build-in-all-configs.py --msvc-only build-windows-clang: runs-on: windows-2019 @@ -39,9 +88,25 @@ jobs: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: build + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + msbuild INSTALL.vcxproj + cd ../../cpptrace + - name: build + run: | python3 ci/build-in-all-configs.py --clang-only build-windows-mingw: runs-on: windows-2019 @@ -49,7 +114,24 @@ jobs: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: build + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE -G"Unix Makefiles" + make -j + sudo make install + cd ../../cpptrace + - name: build + run: | python3 ci/build-in-all-configs.py --mingw-only diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9a4d4c..d5fa204 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,18 +12,51 @@ jobs: steps: - uses: actions/checkout@v2 - name: dependencies - run: sudo apt install gcc-10 g++-10 libgcc-10-dev + run: | + sudo apt install gcc-10 g++-10 libgcc-10-dev + pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + make -j + sudo make install + cd ../../cpptrace - name: build and test run: | - pip3 install colorama python3 ci/test-all-configs.py test-macos: runs-on: macos-13 steps: - uses: actions/checkout@v2 - - name: build and test + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + make -j + sudo make install + cd ../../cpptrace + - name: dependencies run: | pip3 install colorama + - name: build and test + run: | python3 ci/test-all-configs.py test-windows-msvc: runs-on: windows-2019 @@ -31,9 +64,25 @@ jobs: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: build and test + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + msbuild INSTALL.vcxproj + cd ../../cpptrace + - name: build and test + run: | python3 ci/test-all-configs.py --msvc-only test-windows-clang: runs-on: windows-2019 @@ -41,9 +90,25 @@ jobs: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: build and test + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE + msbuild INSTALL.vcxproj + cd ../../cpptrace + - name: build and test + run: | python3 ci/test-all-configs.py --clang-only test-windows-mingw: runs-on: windows-2019 @@ -51,7 +116,24 @@ jobs: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: build and test + - name: dependencies run: | pip3 install colorama + - name: libdwarf + run: | + cd .. + mkdir libdwarf + cd libdwarf + git init + git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git + git fetch --depth 1 origin 8b163d80aa30afd37027e826f6e8becd8e62ee2f + git checkout FETCH_HEAD + mkdir build + cd build + cmake .. -DPIC_ALWAYS=TRUE -BUILD_DWARFDUMP=FALSE -G"Unix Makefiles" + make -j + sudo make install + cd ../../cpptrace + - name: build and test + run: | python3 ci/test-all-configs.py --mingw-only diff --git a/ci/build-in-all-configs.py b/ci/build-in-all-configs.py index c5d3caf..9e7aa35 100644 --- a/ci/build-in-all-configs.py +++ b/ci/build-in-all-configs.py @@ -53,6 +53,7 @@ def build(matrix): f"-DCMAKE_BUILD_TYPE={matrix['target']}", f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-D{matrix['unwind']}=On", f"-D{matrix['symbols']}=On", f"-D{matrix['demangle']}=On", @@ -67,6 +68,7 @@ def build(matrix): f"-DCMAKE_BUILD_TYPE={matrix['target']}", f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-D{matrix['unwind']}=On", f"-D{matrix['symbols']}=On", f"-D{matrix['demangle']}=On", @@ -102,6 +104,7 @@ def build_full_or_auto(matrix): f"-DCMAKE_BUILD_TYPE={matrix['target']}", f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h", ] if matrix["config"] != "": @@ -115,7 +118,8 @@ def build_full_or_auto(matrix): "..", f"-DCMAKE_BUILD_TYPE={matrix['target']}", f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", - f"-DCMAKE_CXX_STANDARD={matrix['std']}" + f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", ] if matrix["config"] != "": args.append(f"{matrix['config']}") diff --git a/ci/test-all-configs.py b/ci/test-all-configs.py index 6fb8320..4170356 100644 --- a/ci/test-all-configs.py +++ b/ci/test-all-configs.py @@ -154,6 +154,7 @@ def build(matrix): f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_C_COMPILER={get_c_compiler_counterpart(matrix['compiler'])}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-D{matrix['unwind']}=On", f"-D{matrix['symbols']}=On", f"-D{matrix['demangle']}=On", @@ -173,6 +174,7 @@ def build(matrix): f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_C_COMPILER={get_c_compiler_counterpart(matrix['compiler'])}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-D{matrix['unwind']}=On", f"-D{matrix['symbols']}=On", f"-D{matrix['demangle']}=On", @@ -197,6 +199,7 @@ def build_full_or_auto(matrix): f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_C_COMPILER={get_c_compiler_counterpart(matrix['compiler'])}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", f"-DCPPTRACE_BACKTRACE_PATH=/usr/lib/gcc/x86_64-linux-gnu/10/include/backtrace.h", "-DCPPTRACE_BUILD_TEST=On" ] @@ -213,6 +216,7 @@ def build_full_or_auto(matrix): f"-DCMAKE_CXX_COMPILER={matrix['compiler']}", f"-DCMAKE_C_COMPILER={get_c_compiler_counterpart(matrix['compiler'])}", f"-DCMAKE_CXX_STANDARD={matrix['std']}", + f"-DCPPTRACE_USE_EXTERNAL_LIBDWARF=On", "-DCPPTRACE_BUILD_TEST=On" ] if matrix["config"] != "":