From 9caba822a7ee78496bb84e0805c33180a78c2d81 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:08:18 -0800 Subject: [PATCH 01/17] rolled back to gcc 9 to see if our mutex lock stops using the modern __pthread_key_create glibc function, not available in Ubuntu 18. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe76def..3e6bbf6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,8 +44,8 @@ jobs: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release cmake --build ${{github.workspace}}/build env: - CC: gcc-10 - CXX: g++-10 + CC: gcc-9 + CXX: g++-9 - name: Upload Linux build uses: actions/upload-artifact@v2 with: From 17703a953ef72363a2516eb604af3af7e16f8fdc Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:10:40 -0800 Subject: [PATCH 02/17] add printout of ldd to build script/ --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e6bbf6..debd244 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,7 @@ jobs: run: | cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release cmake --build ${{github.workspace}}/build + ldd -v ${{github.workspace}}/build/Analyzers/*.so env: CC: gcc-9 CXX: g++-9 From 8f49670c23e5fd94ccea71f4c21db5ea68445208 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:17:13 -0800 Subject: [PATCH 03/17] quick test: container --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index debd244..9119124 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,8 @@ jobs: path: ${{github.workspace}}/build/Analyzers/*.so linux: runs-on: ubuntu-latest + container: + image: quay.io/pypa/manylinux2014_x86_64 steps: - uses: actions/checkout@v2 - name: Build From 324041b595f2ce46683b621bc7587dd9ee346467 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:21:08 -0800 Subject: [PATCH 04/17] removed envs --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9119124..606a304 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,9 +46,6 @@ jobs: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release cmake --build ${{github.workspace}}/build ldd -v ${{github.workspace}}/build/Analyzers/*.so - env: - CC: gcc-9 - CXX: g++-9 - name: Upload Linux build uses: actions/upload-artifact@v2 with: From 5966b342f76da8f793fa8735dec3db8fe361ab9a Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:29:59 -0800 Subject: [PATCH 05/17] check if upload v3 fixes container upload. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 606a304..5ebd0e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,7 @@ jobs: cmake --build ${{github.workspace}}/build ldd -v ${{github.workspace}}/build/Analyzers/*.so - name: Upload Linux build - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: linux path: ${{github.workspace}}/build/Analyzers/*.so From 52c3ed325ec8ae04dfcfa57cc0dc18d64e81a4e3 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:33:00 -0800 Subject: [PATCH 06/17] debug --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ebd0e6..198a3a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,10 @@ jobs: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release cmake --build ${{github.workspace}}/build ldd -v ${{github.workspace}}/build/Analyzers/*.so + pwd + echo "${{github.workspace}}" + echo "find!" + find . - name: Upload Linux build uses: actions/upload-artifact@v3 with: From dd113f57f2e2fb1c1f704728af86da23c65f7e8e Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:35:46 -0800 Subject: [PATCH 07/17] more debug --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 198a3a9..741c5f0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,9 +43,9 @@ jobs: - uses: actions/checkout@v2 - name: Build run: | - cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release - cmake --build ${{github.workspace}}/build - ldd -v ${{github.workspace}}/build/Analyzers/*.so + cmake -B build -DCMAKE_BUILD_TYPE=Release + cmake --build build + ldd -v build/Analyzers/*.so pwd echo "${{github.workspace}}" echo "find!" From 90bab3932f51a465a37ebc84207fc55e9bd3ab94 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:39:36 -0800 Subject: [PATCH 08/17] quick test if rolling back to v2 still works. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 741c5f0..bda60f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,7 @@ jobs: echo "find!" find . - name: Upload Linux build - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v2 with: name: linux path: ${{github.workspace}}/build/Analyzers/*.so From 577b4a9484901f48485acd9a07142aa17b73e546 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:44:35 -0800 Subject: [PATCH 09/17] test ubuntu 18.04 container. --- .github/workflows/build.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bda60f5..18a43fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,7 +38,7 @@ jobs: linux: runs-on: ubuntu-latest container: - image: quay.io/pypa/manylinux2014_x86_64 + image: ubuntu:18.04 steps: - uses: actions/checkout@v2 - name: Build @@ -46,15 +46,22 @@ jobs: cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build ldd -v build/Analyzers/*.so - pwd - echo "${{github.workspace}}" - echo "find!" - find . - name: Upload Linux build uses: actions/upload-artifact@v2 with: name: linux path: ${{github.workspace}}/build/Analyzers/*.so + manylinux: + runs-on: ubuntu-latest + container: + image: quay.io/pypa/manylinux2014_x86_64 + steps: + - uses: actions/checkout@v2 + - name: Build + run: | + cmake -B build -DCMAKE_BUILD_TYPE=Release + cmake --build build + ldd -v build/Analyzers/*.so publish: needs: [windows, macos, linux] runs-on: ubuntu-latest From 92f7cfd16e73e2c54d631d3927bc34a849130f6a Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Wed, 11 Jan 2023 17:46:08 -0800 Subject: [PATCH 10/17] debug --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18a43fb..c6a0813 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,10 @@ jobs: - uses: actions/checkout@v2 - name: Build run: | + pwd + find . + cmake --version + gcc --version cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build ldd -v build/Analyzers/*.so From 6463ab51798cd5a205ec5d69d0bedb0a0b5661dc Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 09:30:33 -0700 Subject: [PATCH 11/17] attempt to upload docker build --- .github/workflows/build.yml | 111 +++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f1cfe7..086ae80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,39 +9,39 @@ on: branches: [master] jobs: - windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: | - cmake -B ${{github.workspace}}/build -A x64 - cmake --build ${{github.workspace}}/build --config Release - - name: Upload windows build - uses: actions/upload-artifact@v2 - with: - name: windows - path: ${{github.workspace}}/build/Analyzers/Release/*.dll - macos: - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Build - run: | - cmake -B ${{github.workspace}}/build/x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 - cmake --build ${{github.workspace}}/build/x86_64 - cmake -B ${{github.workspace}}/build/arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 - cmake --build ${{github.workspace}}/build/arm64 - - name: Upload MacOS x86_64 build - uses: actions/upload-artifact@v2 - with: - name: macos_x86_64 - path: ${{github.workspace}}/build/x86_64/Analyzers/*.so - - name: Upload MacOS arm64 build - uses: actions/upload-artifact@v2 - with: - name: macos_arm64 - path: ${{github.workspace}}/build/arm64/Analyzers/*.so + # windows: + # runs-on: windows-latest + # steps: + # - uses: actions/checkout@v2 + # - name: Build + # run: | + # cmake -B ${{github.workspace}}/build -A x64 + # cmake --build ${{github.workspace}}/build --config Release + # - name: Upload windows build + # uses: actions/upload-artifact@v2 + # with: + # name: windows + # path: ${{github.workspace}}/build/Analyzers/Release/*.dll + # macos: + # runs-on: macos-latest + # steps: + # - uses: actions/checkout@v2 + # - name: Build + # run: | + # cmake -B ${{github.workspace}}/build/x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 + # cmake --build ${{github.workspace}}/build/x86_64 + # cmake -B ${{github.workspace}}/build/arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 + # cmake --build ${{github.workspace}}/build/arm64 + # - name: Upload MacOS x86_64 build + # uses: actions/upload-artifact@v2 + # with: + # name: macos_x86_64 + # path: ${{github.workspace}}/build/x86_64/Analyzers/*.so + # - name: Upload MacOS arm64 build + # uses: actions/upload-artifact@v2 + # with: + # name: macos_arm64 + # path: ${{github.workspace}}/build/arm64/Analyzers/*.so linux: runs-on: ubuntu-latest container: @@ -73,24 +73,29 @@ jobs: cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build ldd -v build/Analyzers/*.so - publish: - needs: [windows, macos, linux] - runs-on: ubuntu-latest - steps: - - name: download individual builds - uses: actions/download-artifact@v2 - with: - path: ${{github.workspace}}/artifacts - - name: zip - run: | - cd ${{github.workspace}}/artifacts - zip -r ${{github.workspace}}/analyzer.zip . - - uses: actions/upload-artifact@v2 - with: - name: all-platforms - path: ${{github.workspace}}/artifacts/** - - name: create release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') + - name: Upload Container Linux build + uses: actions/upload-artifact@v2 with: - files: ${{github.workspace}}/analyzer.zip \ No newline at end of file + name: linux-container + path: ${{github.workspace}}/build/Analyzers/*.so + # publish: + # needs: [windows, macos, linux] + # runs-on: ubuntu-latest + # steps: + # - name: download individual builds + # uses: actions/download-artifact@v2 + # with: + # path: ${{github.workspace}}/artifacts + # - name: zip + # run: | + # cd ${{github.workspace}}/artifacts + # zip -r ${{github.workspace}}/analyzer.zip . + # - uses: actions/upload-artifact@v2 + # with: + # name: all-platforms + # path: ${{github.workspace}}/artifacts/** + # - name: create release + # uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # files: ${{github.workspace}}/analyzer.zip \ No newline at end of file From b22cc4b1dd1b75aaccef79c1e405b88f72d86e14 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 10:04:58 -0700 Subject: [PATCH 12/17] switch to many linux only. --- .github/workflows/build.yml | 123 +++++++++++++++--------------------- 1 file changed, 51 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 086ae80..102c87d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,60 +9,40 @@ on: branches: [master] jobs: - # windows: - # runs-on: windows-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Build - # run: | - # cmake -B ${{github.workspace}}/build -A x64 - # cmake --build ${{github.workspace}}/build --config Release - # - name: Upload windows build - # uses: actions/upload-artifact@v2 - # with: - # name: windows - # path: ${{github.workspace}}/build/Analyzers/Release/*.dll - # macos: - # runs-on: macos-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Build - # run: | - # cmake -B ${{github.workspace}}/build/x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 - # cmake --build ${{github.workspace}}/build/x86_64 - # cmake -B ${{github.workspace}}/build/arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 - # cmake --build ${{github.workspace}}/build/arm64 - # - name: Upload MacOS x86_64 build - # uses: actions/upload-artifact@v2 - # with: - # name: macos_x86_64 - # path: ${{github.workspace}}/build/x86_64/Analyzers/*.so - # - name: Upload MacOS arm64 build - # uses: actions/upload-artifact@v2 - # with: - # name: macos_arm64 - # path: ${{github.workspace}}/build/arm64/Analyzers/*.so - linux: - runs-on: ubuntu-latest - container: - image: ubuntu:18.04 + windows: + runs-on: windows-latest steps: - uses: actions/checkout@v2 - name: Build run: | - pwd - find . - cmake --version - gcc --version - cmake -B build -DCMAKE_BUILD_TYPE=Release - cmake --build build - ldd -v build/Analyzers/*.so - - name: Upload Linux build + cmake -B ${{github.workspace}}/build -A x64 + cmake --build ${{github.workspace}}/build --config Release + - name: Upload windows build uses: actions/upload-artifact@v2 with: - name: linux - path: ${{github.workspace}}/build/Analyzers/*.so - manylinux: + name: windows + path: ${{github.workspace}}/build/Analyzers/Release/*.dll + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: | + cmake -B ${{github.workspace}}/build/x86_64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 + cmake --build ${{github.workspace}}/build/x86_64 + cmake -B ${{github.workspace}}/build/arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 + cmake --build ${{github.workspace}}/build/arm64 + - name: Upload MacOS x86_64 build + uses: actions/upload-artifact@v2 + with: + name: macos_x86_64 + path: ${{github.workspace}}/build/x86_64/Analyzers/*.so + - name: Upload MacOS arm64 build + uses: actions/upload-artifact@v2 + with: + name: macos_arm64 + path: ${{github.workspace}}/build/arm64/Analyzers/*.so + linux: runs-on: ubuntu-latest container: image: quay.io/pypa/manylinux2014_x86_64 @@ -72,30 +52,29 @@ jobs: run: | cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build - ldd -v build/Analyzers/*.so - - name: Upload Container Linux build + - name: Upload Linux x86_64 build uses: actions/upload-artifact@v2 with: - name: linux-container + name: linux path: ${{github.workspace}}/build/Analyzers/*.so - # publish: - # needs: [windows, macos, linux] - # runs-on: ubuntu-latest - # steps: - # - name: download individual builds - # uses: actions/download-artifact@v2 - # with: - # path: ${{github.workspace}}/artifacts - # - name: zip - # run: | - # cd ${{github.workspace}}/artifacts - # zip -r ${{github.workspace}}/analyzer.zip . - # - uses: actions/upload-artifact@v2 - # with: - # name: all-platforms - # path: ${{github.workspace}}/artifacts/** - # - name: create release - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # files: ${{github.workspace}}/analyzer.zip \ No newline at end of file + publish: + needs: [windows, macos, linux] + runs-on: ubuntu-latest + steps: + - name: download individual builds + uses: actions/download-artifact@v2 + with: + path: ${{github.workspace}}/artifacts + - name: zip + run: | + cd ${{github.workspace}}/artifacts + zip -r ${{github.workspace}}/analyzer.zip . + - uses: actions/upload-artifact@v2 + with: + name: all-platforms + path: ${{github.workspace}}/artifacts/** + - name: create release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ${{github.workspace}}/analyzer.zip \ No newline at end of file From 5af8b218885b19d24406a5e5942f5ad8acb6da64 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 10:07:43 -0700 Subject: [PATCH 13/17] cleanup --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 102c87d..4e42fa4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: run: | cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build - - name: Upload Linux x86_64 build + - name: Upload Linux build uses: actions/upload-artifact@v2 with: name: linux From 42896eff8e0a6a5f29bd6ff17150cad3c8cd04a4 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 11:14:10 -0700 Subject: [PATCH 14/17] switching to direct docker build. --- .github/workflows/build.yml | 7 +++--- ci/linux/Dockerfile | 47 +++++++++++++++++++++++++++++++++++++ ci/linux/build.sh | 7 ++++++ ci/linux/docker-build.sh | 7 ++++++ ci/linux/docker-run.sh | 8 +++++++ 5 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 ci/linux/Dockerfile create mode 100644 ci/linux/build.sh create mode 100644 ci/linux/docker-build.sh create mode 100644 ci/linux/docker-run.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e42fa4..8453030 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,14 +44,13 @@ jobs: path: ${{github.workspace}}/build/arm64/Analyzers/*.so linux: runs-on: ubuntu-latest - container: - image: quay.io/pypa/manylinux2014_x86_64 steps: - uses: actions/checkout@v2 - name: Build run: | - cmake -B build -DCMAKE_BUILD_TYPE=Release - cmake --build build + ./ci/linux/docker-build.sh + ./ci/linux/docker-run.sh + find . - name: Upload Linux build uses: actions/upload-artifact@v2 with: diff --git a/ci/linux/Dockerfile b/ci/linux/Dockerfile new file mode 100644 index 0000000..7dc826e --- /dev/null +++ b/ci/linux/Dockerfile @@ -0,0 +1,47 @@ +# Dockerfile for building Saleae analyzers on linux +# This allows us to maintain support for older distros while building on recent distros. + +# Use Ubuntu 18.04 as the base image +FROM ubuntu:18.04 + +# Set environment variables to avoid any interactive prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive + +# UID and GID are generally used to create a user with the same user and group ids as the user building this Docker image +ARG UID +ARG GID + +# Ensure args are set +RUN test -n "$UID" +RUN test -n "$GID" + +# Create user +RUN groupadd -g ${GID} docker +RUN useradd -m -u ${UID} -g docker docker + +# Update cmake +RUN apt-get update + +# Add repository for latest cmake +RUN apt-get -y install ca-certificates gpg wget software-properties-common +RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null +RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null + +RUN apt-get -y install software-properties-common + +# Add repository for GCC 10 +RUN add-apt-repository ppa:ubuntu-toolchain-r/test + +RUN apt-get update + +RUN apt-get -y install cmake git +RUN apt-get -y install gcc-10 g++-10 + +ENV CXX=g++-10 +ENV CC=gcc-10 + +RUN mkdir -p /workspace/analyzer +RUN chown docker:docker /workspace + +# Set working directory +WORKDIR /workspace/analyzer \ No newline at end of file diff --git a/ci/linux/build.sh b/ci/linux/build.sh new file mode 100644 index 0000000..8da08fb --- /dev/null +++ b/ci/linux/build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +mkdir build +pushd build +cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . +popd \ No newline at end of file diff --git a/ci/linux/docker-build.sh b/ci/linux/docker-build.sh new file mode 100644 index 0000000..c966cf1 --- /dev/null +++ b/ci/linux/docker-build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Path to THIS script +SCRIPT_PATH=`dirname $0` +SCRIPT_PATH=`readlink -e $SCRIPT_PATH` + +docker build --build-arg UID=`id -u` --build-arg GID=`id -g` -t analyzer-build $SCRIPT_PATH \ No newline at end of file diff --git a/ci/linux/docker-run.sh b/ci/linux/docker-run.sh new file mode 100644 index 0000000..f32adea --- /dev/null +++ b/ci/linux/docker-run.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# Path to THIS script +SCRIPT_PATH=$(dirname $0) +SCRIPT_PATH=$(readlink -e $SCRIPT_PATH) +REPO_ROOT=$SCRIPT_PATH/../.. + +echo docker run --rm -v${REPO_ROOT}:/workspace/analyzer -u docker:docker analyzer-build ./ci/linux/build.sh \ No newline at end of file From e061088da70d3403d25f10f5ed967b3d787e2a5f Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 11:20:22 -0700 Subject: [PATCH 15/17] set executable flags. --- ci/linux/build.sh | 0 ci/linux/docker-build.sh | 0 ci/linux/docker-run.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ci/linux/build.sh mode change 100644 => 100755 ci/linux/docker-build.sh mode change 100644 => 100755 ci/linux/docker-run.sh diff --git a/ci/linux/build.sh b/ci/linux/build.sh old mode 100644 new mode 100755 diff --git a/ci/linux/docker-build.sh b/ci/linux/docker-build.sh old mode 100644 new mode 100755 diff --git a/ci/linux/docker-run.sh b/ci/linux/docker-run.sh old mode 100644 new mode 100755 From 1b8b56859c8c7b2b92aecdb56f17fb1db3636b55 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 11:24:48 -0700 Subject: [PATCH 16/17] facepalm --- ci/linux/docker-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/linux/docker-run.sh b/ci/linux/docker-run.sh index f32adea..8e0a924 100755 --- a/ci/linux/docker-run.sh +++ b/ci/linux/docker-run.sh @@ -5,4 +5,4 @@ SCRIPT_PATH=$(dirname $0) SCRIPT_PATH=$(readlink -e $SCRIPT_PATH) REPO_ROOT=$SCRIPT_PATH/../.. -echo docker run --rm -v${REPO_ROOT}:/workspace/analyzer -u docker:docker analyzer-build ./ci/linux/build.sh \ No newline at end of file +docker run --rm -v${REPO_ROOT}:/workspace/analyzer -u docker:docker analyzer-build ./ci/linux/build.sh \ No newline at end of file From 24bd24ec24198462a76a0d465c276d3e62662c4f Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 11 Jul 2023 11:37:32 -0700 Subject: [PATCH 17/17] cleanup debug, added readme, added comments. --- .github/workflows/build.yml | 1 - ci/linux/Dockerfile | 3 ++- ci/linux/build.sh | 1 + ci/linux/docker-build.sh | 4 ++++ ci/linux/docker-run.sh | 2 ++ ci/linux/readme.md | 13 +++++++++++++ 6 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 ci/linux/readme.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8453030..a7dae44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,6 @@ jobs: run: | ./ci/linux/docker-build.sh ./ci/linux/docker-run.sh - find . - name: Upload Linux build uses: actions/upload-artifact@v2 with: diff --git a/ci/linux/Dockerfile b/ci/linux/Dockerfile index 7dc826e..8313a76 100644 --- a/ci/linux/Dockerfile +++ b/ci/linux/Dockerfile @@ -19,7 +19,7 @@ RUN test -n "$GID" RUN groupadd -g ${GID} docker RUN useradd -m -u ${UID} -g docker docker -# Update cmake +# Update for cmake RUN apt-get update # Add repository for latest cmake @@ -37,6 +37,7 @@ RUN apt-get update RUN apt-get -y install cmake git RUN apt-get -y install gcc-10 g++-10 +# set CXX and CC so cmake uses gcc 10 as the default compiler. ENV CXX=g++-10 ENV CC=gcc-10 diff --git a/ci/linux/build.sh b/ci/linux/build.sh index 8da08fb..e010e07 100755 --- a/ci/linux/build.sh +++ b/ci/linux/build.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +# This is run from within the docker container to build the analyer. mkdir build pushd build cmake -DCMAKE_BUILD_TYPE=Release .. diff --git a/ci/linux/docker-build.sh b/ci/linux/docker-build.sh index c966cf1..7fc94d6 100755 --- a/ci/linux/docker-build.sh +++ b/ci/linux/docker-build.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# This script builds the docker image using the Dockerfile in this directory. + +# We pass in the user and group ID, so that later when we run docker, we can ensure that all created files are owned by the current user. + # Path to THIS script SCRIPT_PATH=`dirname $0` SCRIPT_PATH=`readlink -e $SCRIPT_PATH` diff --git a/ci/linux/docker-run.sh b/ci/linux/docker-run.sh index 8e0a924..ced87d8 100755 --- a/ci/linux/docker-run.sh +++ b/ci/linux/docker-run.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +# This script runs the build.sh script within the docker image, mounting the current repository as a volume. + # Path to THIS script SCRIPT_PATH=$(dirname $0) SCRIPT_PATH=$(readlink -e $SCRIPT_PATH) diff --git a/ci/linux/readme.md b/ci/linux/readme.md new file mode 100644 index 0000000..832ba98 --- /dev/null +++ b/ci/linux/readme.md @@ -0,0 +1,13 @@ +# Linux Analyzer CI Build + +In order to maintain compatibility with older distributions of Linux, we build our release binaries using docker. + +This allows us to control the glibc and libstdc++ dependencies of our binaries, and ensure that they will run on older distributions. + +This is done in two steps. + +First, we create a docker image. the Dockerfile and docker-build.sh configure the image with the necessary software. + +Second, we run the image using docker-run.sh and build.sh. + +This can be done locally, but it is not required for local development.