Skip to content

Commit 3ecc89b

Browse files
singalsulgirdwood
authored andcommitted
workflows: tools: build natively instead of in docker container
The pre-built thesofproject/sof docker image carries an older alsa-lib / alsa-utils that no longer matches the versions required to build the current SOF user-space tools (in particular alsatplg used by the topology2 build). This patch moves the user-space tools build off docker and build it directly on the ubuntu-24.04 runner. - install the toolchain via apt - bootstrap autoconf 2.72 (Ubuntu 24.04 ships 2.71) - build the SOF forks of alsa-lib and alsa-utils at the same pinned commits used by testbench.yml - run scripts/build-tools.sh with PKG_CONFIG_PATH / LD_LIBRARY_PATH / PATH pointed at the freshly built ALSA tree The SOF-alsa-plugin job in the same workflow was already native and is left unchanged. The only consumer of this reusable workflow (daily-tests.yml) is unaffected by the internal switch. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent b6673fc commit 3ecc89b

1 file changed

Lines changed: 56 additions & 10 deletions

File tree

.github/workflows/tools.yml

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,71 @@ permissions:
1313
jobs:
1414
# This is not the same as building every ./build-tools.sh option.
1515
top-level_default_CMake_target_ALL:
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1717
steps:
1818
- uses: actions/checkout@v4
1919
with:
2020
filter: 'tree:0'
21+
path: sof
22+
23+
- name: apt get
24+
run: sudo apt-get update &&
25+
sudo apt-get -y install ninja-build
26+
automake autoconf libtool gettext libasound2-dev
27+
pkg-config
28+
29+
# Ubuntu 24.04 ships autoconf 2.71, but current alsa-lib/alsa-utils
30+
# require >= 2.72. Build a newer autoconf from the GNU release
31+
# tarball and install it into /usr/local (ahead of /usr/bin in PATH).
32+
- name: Install autoconf 2.72
33+
run: |
34+
cd ${GITHUB_WORKSPACE}
35+
wget -q https://ftp.gnu.org/gnu/autoconf/autoconf-2.72.tar.gz
36+
tar xf autoconf-2.72.tar.gz
37+
cd autoconf-2.72
38+
./configure --prefix=/usr/local
39+
make -j"$(nproc)"
40+
sudo make install
41+
hash -r
42+
autoconf --version | head -n1
43+
44+
- name: Build Alsa-lib
45+
run: |
46+
cd ${GITHUB_WORKSPACE}
47+
git clone https://github.com/thesofproject/alsa-lib.git
48+
cd alsa-lib
49+
git checkout 08b532cd3da9ac8f683bcb4e4beb9b74c39c1782 -b build
50+
./gitcompile --prefix=${GITHUB_WORKSPACE}/tools
51+
make install
2152
22-
# The ALSA version in Ubuntu 20.04 is buggy
23-
# (https://github.com/thesofproject/sof/issues/2543) and likely
24-
# getting out of date soon
25-
- name: docker
26-
run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
53+
- name: Build Alsa-utils
54+
run: |
55+
cd ${GITHUB_WORKSPACE}
56+
git clone https://github.com/thesofproject/alsa-utils.git
57+
cd alsa-utils
58+
git checkout 9feb22ba45b48729729c8d194aaf1bc082a6842a -b build
59+
./gitcompile --prefix=${GITHUB_WORKSPACE}/tools \
60+
--with-alsa-prefix=${GITHUB_WORKSPACE}/tools \
61+
--with-alsa-inc-prefix=${GITHUB_WORKSPACE}/tools/include \
62+
--with-sysroot=${GITHUB_WORKSPACE}/tools \
63+
--with-udev-rules-dir=${GITHUB_WORKSPACE}/tools \
64+
PKG_CONFIG_PATH=${GITHUB_WORKSPACE}/tools \
65+
LDFLAGS=-L${GITHUB_WORKSPACE}/tools/lib \
66+
--disable-old-symbols \
67+
--enable-alsatopology \
68+
--with-asound-state-dir=${GITHUB_WORKSPACE}/tools/var/lib/alsa \
69+
--with-systemdsystemunitdir=${GITHUB_WORKSPACE}/tools/lib/systemd/system
70+
make install
2771
2872
# For some reason gcc has more warnings in Release mode
2973
- name: build-tools
30-
run: CMAKE_BUILD_TYPE=Release ./scripts/docker-run.sh
31-
./scripts/build-tools.sh ||
74+
env:
75+
PKG_CONFIG_PATH: ${{ github.workspace }}/tools/lib/pkgconfig
76+
LD_LIBRARY_PATH: ${{ github.workspace }}/tools/lib
77+
PATH: ${{ github.workspace }}/tools/bin:/usr/local/bin:/usr/bin:/bin
78+
run: CMAKE_BUILD_TYPE=Release ./sof/scripts/build-tools.sh ||
3279
VERBOSE=1 NO_PROCESSORS=1 USE_XARGS=no
33-
CMAKE_BUILD_TYPE=Release ./scripts/docker-run.sh
34-
./scripts/build-tools.sh
80+
CMAKE_BUILD_TYPE=Release ./sof/scripts/build-tools.sh
3581

3682

3783
SOF-alsa-plugin:

0 commit comments

Comments
 (0)