Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hermit to provide a (mostly) consistent build environment #700

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/binary-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
Expand All @@ -33,21 +31,25 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Init Hermit
uses: cashapp/activate-hermit@v1

- name: Display Python version
- name: Install Clang
ivmaykov marked this conversation as resolved.
Show resolved Hide resolved
run: |
python -c "import sys; print(sys.version)"
sudo apt-get update
sudo apt install clang -y

- name: Install build dependencies
- name: Install python packages
run: |
scripts/ubuntu_install_protobuf.sh
cd ${{ github.workspace }}
pip install --upgrade pip
pip install -r ./core/requirements.txt

- name: Build subzero CORE
run: |
cd ${{ github.workspace }}
export CC=`which clang`
export CXX=`which clang++`
scripts/build_core.sh

# Run binary static analysis
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/clang-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
Expand All @@ -33,23 +31,27 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Init Hermit
uses: cashapp/activate-hermit@v1

- name: Display Python version
- name: Install clang and clang-tools
run: |
python -c "import sys; print(sys.version)"
sudo apt-get update
sudo apt install clang clang-tools -y

- name: Install build dependencies
run: scripts/ubuntu_install_protobuf.sh
- name: Install python packages
run: |
cd ${{ github.workspace }}
pip install --upgrade pip
pip install -r ./core/requirements.txt

- name: Install clang tools
# Build CORE
- name: Build Subzero Core
run: |
sudo apt-get update
sudo apt-get install clang-tools-14 -y
sudo ln -sf /usr/bin/clang-check-14 /usr/bin/clang-check
cd ${{ github.workspace }}
export CC=`which clang`
export CXX=`which clang++`
./scripts/build_core.sh

# Run static analysis
- name: Run clang static analysis
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
language: ['cpp', 'java']
python-version: [3.9]
python-version: [3.12]

steps:
- name: Checkout repository
Expand All @@ -36,18 +36,21 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Init Hermit
uses: cashapp/activate-hermit@v1

- name: Display Python version
- if: ${{ matrix.language == 'cpp' }}
name: Install Clang
run: |
python -c "import sys; print(sys.version)"
sudo apt-get update
sudo apt install clang -y

- if: ${{ matrix.language == 'cpp' }}
name: Install dependencies
run: scripts/ubuntu_install_protobuf.sh
name: Install python packages
run: |
cd ${{ github.workspace }}
pip install --upgrade pip
pip install -r ./core/requirements.txt

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand All @@ -67,7 +70,11 @@ jobs:
# Use custom build process for C/C++
- if: ${{ matrix.language == 'cpp' }}
name: Build Subzero Core (C/C++)
run: scripts/build_core.sh
run: |
cd ${{ github.workspace }}
export CC=`which clang`
export CXX=`which clang++`
./scripts/build_core.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
29 changes: 12 additions & 17 deletions .github/workflows/fuzzing-regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
Expand All @@ -33,30 +31,27 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Init Hermit
uses: cashapp/activate-hermit@v1

- name: Display Python version
- name: Install Clang
run: |
python -c "import sys; print(sys.version)"

- name: Install dependencies
run: scripts/ubuntu_install_protobuf.sh
sudo apt-get update
sudo apt install clang -y

- name: Setup Clang
uses: egor-tensin/[email protected]
with:
version: latest
platform: x64
- name: Install python packages
run: |
cd ${{ github.workspace }}
pip install --upgrade pip
pip install -r ./core/requirements.txt

# Build CORE with ASAN, UBSAN, and libfuzzer
- name: Build Subzero Core (ASAN+UBSAN+FUZZER)
run: |
cd ${{ github.workspace }}
export CC=`which clang`
export CXX=`which clang++`
scripts/build_core.sh -DENABLE_ASAN=ON -DENABLE_UBSAN=ON -DENABLE_FUZZER=ON
./scripts/build_core.sh -DENABLE_ASAN=ON -DENABLE_UBSAN=ON -DENABLE_FUZZER=ON

- name: Run Subzero CORE Fuzzing regression test
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/java-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
Expand All @@ -33,11 +31,11 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Init Hermit
uses: cashapp/activate-hermit@v1

# Unit tests for Java
- name: Run Unit tests
run: |
cd ${{ github.workspace }}/java
./gradlew test --info
gradle test --info
37 changes: 19 additions & 18 deletions .github/workflows/signtx-test-asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
Expand All @@ -33,30 +31,33 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: |
python -c "import sys; print(sys.version)"

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Install dependencies
run: scripts/ubuntu_install_protobuf.sh
- name: Init Hermit
uses: cashapp/activate-hermit@v1

# Build Java targets
- name: Build Java
run: |
cd ${{ github.workspace }}/java
./gradlew clean build --info
gradle build --info

- name: Install Clang
run: |
sudo apt-get update
sudo apt install clang -y

- name: Install python packages
run: |
cd ${{ github.workspace }}
pip install --upgrade pip
pip install -r ./core/requirements.txt

# Build CORE with ASAN
- name: Build Subzero Core with ASAN
run: scripts/build_core.sh -DENABLE_ASAN=ON
run: |
cd ${{ github.workspace }}
export CC=`which clang`
export CXX=`which clang++`
./scripts/build_core.sh -DENABLE_ASAN=ON

- name: Run Subzero CORE with ASAN
run: |
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/signtx-test-msan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:

strategy:
fail-fast: false
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
Expand All @@ -33,39 +31,33 @@ jobs:
fetch-depth: 2
submodules: 'recursive'

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Display Python version
run: |
python -c "import sys; print(sys.version)"

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Install dependencies
run: scripts/ubuntu_install_protobuf.sh
- name: Init Hermit
uses: cashapp/activate-hermit@v1

# Build Java targets
- name: Build Java
run: |
cd ${{ github.workspace }}/java
./gradlew clean build --info
gradle build --info

- name: Setup Clang (for MSAN)
uses: egor-tensin/[email protected]
with:
version: latest
platform: x64
- name: Install Clang
run: |
sudo apt-get update
sudo apt install clang -y

- name: Install python packages
run: |
cd ${{ github.workspace }}
pip install --upgrade pip
pip install -r ./core/requirements.txt

# Build CORE with MSAN
- name: Build Subzero Core with MSAN
run: |
cd ${{ github.workspace }}
export CC=`which clang`
export CXX=`which clang++`
scripts/build_core.sh -DENABLE_MSAN=ON
./scripts/build_core.sh -DENABLE_MSAN=ON

- name: Run Subzero CORE with MSAN
run: |
Expand Down
Loading
Loading