I want to use mold instead of lld on github actions ci/cd and I don't know how to make it work as my tests are failing because they cannot locate the mold binary.
jobs:
build-mold:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name : mold
run : |
sudo apt update
sudo apt-get install -y build-essential git clang cmake libstdc++-10-dev libssl-dev libxxhash-dev zlib1g-dev pkg-config
git clone https://github.com/rui314/mold.git
cd mold
git checkout v1.1.1
make -j$(nproc) CXX=clang++
sudo make install
export PATH="$PATH:/usr/local/bin/:/usr/lib/ccache:/usr/local/opt/ccache/libexec"
So far I've tried this, before adding my test section, and the installation goes through fine, but my tests are still failing due to linker not being found in path. Also, is this the way to do it because apt update and building and installing mold takes quite some time before the task is finished.
Instead of building mold by yourself, you may want to wget a binary distribution from the release note page (see the bottom of https://github.com/rui314/mold/releases/tag/v1.1.1) and extract it into
/usr.