Skip to content

Commit

Permalink
[Actions] Adding 32-bit Linux builds (#1711)
Browse files Browse the repository at this point in the history
* Trying to build 32 bit version with just gcc multilib without specificically installing i386 libs

* Changing the workflow to use a template from a development branch

* Adding the dependancies for mutlilib

* Trying apt-get to see if it automatically handles the dependancies

* Adding some more dependancies

* Trying the -f flag to fix dependancies

* Trying the apt-get with the fix flag

* Reinstalling gcc 11 before the multilib

* Try with the reinstall flag to make sure everything from gcc is installed

* Install the dependancies to multilib manually

* Trying to specify the versions

* Fixing the versions of libc6

* Using the same order but without versions

* Trying the same in a different job

* Trying to pin the versions

* Allowing downgrades

* Installing more dependancies

* Yet another try

* Making sure the matching multilib version is installed

* Try to update the repositories

* Using the test repository

* Installing packages manually

* Trying with GCC 13

* Trying on Ubuntu 20.04 instead

* Purge GCC 11.4 and install 11.3

* Check available versions of multilib

* Add test repo

* Trying different sources

* Adding the include libraries to find zlib

* Check if the error has something to do with 32 bit or is now also for 64

* Reverting some of the changes

* Trying everything 32 again

* Make sure a valid version of zlib is insalled which alligns with the multilib 11.4

* Adding the library include flags

* Try to install python using the new repos as well

* Installing 32 bit zlib

* Try adding i386 arch to dpkg

* See if it still works without including the libs via flags

* Adding a new matrix option to build both 32 and 64

* Naming sure the naming is correct

* Uploading only the x64 artifacts

* See if moving some of these libs to initial place still works

* Trying if copying is still necessary

* Maybe updates and security repos are not necessary

* Updates repo seems to be necessary, bringing it back

* Moving everything to the retry block

* Simplifying the install packages commands

* Running apt-spy2 fix after adding new repos

* Apparently apt-spy can break manually added repos, so it has to be before that

* Uploading the x86 artifacts alongside with x64 ones to allow building of other modules

* Correcting the artifacts names

* Using the development templates in other repos

* Also for ThunderNanoServicesRDK

* Giving a unique name to the template

* The testing is done, bringing back the master branches

* Adding a 32-bit build also to the tests

* Adding a missing gtest lib install

* Looks like there is no pre-compiled gtest for 32 bit, even on shadow repos

Maybe we could just compile it in the future, but first we have to test how long that takes and think whether it is worth to lose that much time each time we want to run these tests

---------

Co-authored-by: Pierre Wielders <[email protected]>
  • Loading branch information
VeithMetro and pwielders authored Aug 2, 2024
1 parent 199ff00 commit d3b525a
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/Linux build template.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Thunder on Linux
name: Linux build template

on:
workflow_call:
Expand All @@ -11,8 +11,9 @@ jobs:
matrix:
build_type: [Debug, Release, MinSizeRel]
shared_libs: [ON, OFF]
architecture: [32, 64]

name: Build type - ${{matrix.shared_libs == 'OFF' && 'Static ' || ''}}${{matrix.build_type}}
name: Build type - ${{matrix.shared_libs == 'OFF' && 'Static ' || ''}}${{matrix.build_type}}${{matrix.architecture == '32' && ' x86' || ''}}
steps:
# --------- Installing packages ---------
- name: Install necessary packages
Expand All @@ -23,10 +24,12 @@ jobs:
command: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
echo "deb http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list
echo "deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt install python3-pip
pip install jsonref
sudo apt install build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev zlib1g-dev:i386 libssl-dev gcc-11-multilib g++-11-multilib
sudo pip install jsonref
# ----- Checkout & DependsOn regex -----
# --------- Thunder ----------
Expand Down Expand Up @@ -83,6 +86,8 @@ jobs:
- name: Install generators
run: |
cmake -G Ninja -S ThunderTools -B ${{matrix.build_type}}/build/ThunderTools \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
-DCMAKE_INSTALL_PREFIX=${{matrix.build_type}}/install/usr
cmake --build ${{matrix.build_type}}/build/ThunderTools --target install
Expand All @@ -99,7 +104,8 @@ jobs:
- name: Build Thunder
run: |
cmake -G Ninja -S Thunder -B ${{matrix.build_type}}/build/Thunder \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror" \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
-DBUILD_SHARED_LIBS=${{matrix.shared_libs}} \
-DBINDING="127.0.0.1" \
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
Expand All @@ -120,11 +126,11 @@ jobs:
- name: Tar files
if: matrix.shared_libs == 'ON'
run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}}
run: tar -czvf ${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz ${{matrix.build_type}}

- name: Upload
if: matrix.shared_libs == 'ON'
uses: actions/upload-artifact@v4
with:
name: Thunder-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}.tar.gz
name: Thunder-${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}-artifact
path: ${{matrix.build_type}}${{matrix.architecture == '32' && '_x86' || ''}}.tar.gz

0 comments on commit d3b525a

Please sign in to comment.