Skip to content

Commit

Permalink
plumb
Browse files Browse the repository at this point in the history
  • Loading branch information
nlgripto committed Oct 11, 2024
1 parent 8dbcc2c commit f527f1b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/actions/deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ inputs:
options:
- gcc
- clang
msan-opt:
description: "whether or not to build deps with msan"
required: false
default: 'false'
type: boolean
compiler-version:
description: 'The compiler version to use'
required: true
Expand Down Expand Up @@ -50,6 +55,14 @@ runs:
path: deps-bundle.tar.zst
key: deps-sh-${{ runner.os }}-${{ runner.arch }}-${{ inputs.compiler }}-${{ inputs.compiler-version }}-${{ steps.deps-sh-hash.outputs.HASH }}
clean-key: deps-sh

- id: deps-sh-msan-cache
uses: corca-ai/local-cache@v2
with:
base: "${{ runner.tool_cache }}/cache"
path: deps-bundle-msan.tar.zst
key: deps-sh-${{ runner.os }}-${{ runner.arch }}-${{ inputs.compiler }}-${{ inputs.compiler-version }}-${{ steps.deps-sh-hash.outputs.HASH }}-MSAN
clean-key: deps-sh

- name: Install system level dependencies
shell: bash
Expand All @@ -60,6 +73,11 @@ runs:
run: tar -Izstd -xvf deps-bundle.tar.zst
if: steps.deps-sh-cache.outputs.cache-hit == 'true'

- name: Install MSAN dependencies from cache
shell: bash
run: tar -Izstd -xvf deps-bundle-msan.tar.zst
if: steps.deps-sh-msan-cache.outputs.cache-hit == 'true' && ${{ inputs.msan-opt }}

- name: Install dependencies from scratch
shell: bash
run: |
Expand All @@ -72,3 +90,19 @@ runs:
'${{ inputs.deps-script-path }}' +dev fetch install
'${{ inputs.deps-bundle-path }}'
if: steps.deps-sh-cache.outputs.cache-hit != 'true'

- name: Install MSAN dependencies from scratch
shell: bash
env:
MSAN: 1
run: |
if [[ "${{ inputs.compiler-version }}" != "system" ]]; then
source /opt/${{ inputs.compiler }}/${{ inputs.compiler }}-${{ inputs.compiler-version }}/activate
fi
CC='${{ inputs.compiler }}' \
CXX='${{ inputs.compiler == 'gcc' && 'g++' || 'clang++' }}' \
FD_AUTO_INSTALL_PACKAGES=1 \
'${{ inputs.deps-script-path }}' +dev +msan fetch install
'${{ inputs.deps-bundle-path }}'
if: steps.deps-sh-msan-cache.outputs.cache-hit == 'true' && ${{ inputs.msan-opt }}

5 changes: 4 additions & 1 deletion .github/workflows/clusterfuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ jobs:
submodules: recursive

- uses: ./.github/actions/hugepages
- uses: ./.github/actions/deps
- uses: ./.github/actions/deps # "regular" non-msan dependencies (./opt)
- uses: ./.github/actions/deps # build deps with msan (./opt-msan)
with:
msan-opt: true

- run: sudo apt update && sudo apt install -y zip

Expand Down
15 changes: 11 additions & 4 deletions contrib/deps-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,18 @@ set -e

cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"/..

rm -f deps-bundle.tar.zst
if [ -n "$MSAN" ]; then
bundle="deps-bundle-msan.tar.zst"
prefix="opt-msan"
else
bundle="deps-bundle.tar.zst"
prefix="opt"
fi

tar -Izstd -cf deps-bundle.tar.zst \
./opt/{include,lib}
rm -f "$bundle"

echo "[+] Created deps-bundle.tar.zst"
tar -Izstd -cf "$bundle" "./$prefix"/{include,lib}

echo "[+] Created $bundle"

# Now you can commit this file to blob storage such as Git LFS.

0 comments on commit f527f1b

Please sign in to comment.