Skip to content

Commit b4b6b14

Browse files
jpr42charles-lunarg
authored andcommitted
ci: Use PKG_CONFIG_PATH instead of 32 bit pkg-config
ci shouldn't have to use the 32 bit version of pkg-config. I tracked it down the problem is in CMake. Specifically FindPkgConfig.cmake I listed the issue in the yml and docs for reference to make it clear that it is a CMake bug.
1 parent db9bade commit b4b6b14

File tree

2 files changed

+21
-25
lines changed

2 files changed

+21
-25
lines changed

.github/workflows/build.yml

+12-16
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,23 @@ jobs:
122122
- run: |
123123
sudo apt install --yes --no-install-recommends \
124124
gcc-multilib g++-multilib libc6:i386 libc6-dev-i386 libgcc-s1:i386 \
125-
libwayland-dev:i386 libxrandr-dev:i386 pkg-config:i386
125+
libwayland-dev:i386 libxrandr-dev:i386
126126
- run: |
127127
cmake -S. -B build \
128128
-D CMAKE_BUILD_TYPE=${{matrix.config}} \
129129
-D BUILD_TESTS=ON \
130130
-D UPDATE_DEPS=ON \
131131
-D BUILD_WERROR=ON \
132132
-D SYSCONFDIR=/etc/not_vulkan \
133-
-D PKG_CONFIG_EXECUTABLE=/usr/bin/i686-linux-gnu-pkg-config \
133+
-D CMAKE_CXX_FLAGS=-m32 \
134+
-D CMAKE_C_FLAGS=-m32 \
134135
-G Ninja
135136
env:
136-
CFLAGS: -m32
137-
CXXFLAGS: -m32
138-
LDFLAGS: -m32
139-
ASFLAGS: --32
137+
# https://gitlab.kitware.com/cmake/cmake/-/issues/25317
138+
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
140139
- run: cmake --build build
141140
- run: cmake --install build --prefix /tmp
142-
- run: ctest --output-on-failure
143-
working-directory: build/
141+
- run: ctest --output-on-failure --test-dir build/
144142

145143
linux-32-no-asm:
146144
needs: codegen
@@ -159,24 +157,22 @@ jobs:
159157
- run: |
160158
sudo apt install --yes --no-install-recommends \
161159
gcc-multilib g++-multilib libc6:i386 libc6-dev-i386 libgcc-s1:i386 \
162-
libwayland-dev:i386 libxrandr-dev:i386 pkg-config:i386
160+
libwayland-dev:i386 libxrandr-dev:i386
163161
- run: |
164162
cmake -S. -B build \
165163
-D CMAKE_BUILD_TYPE=Release \
166164
-D BUILD_TESTS=ON \
167165
-D UPDATE_DEPS=ON \
168166
-D BUILD_WERROR=ON \
169167
-D USE_GAS=OFF \
170-
-D PKG_CONFIG_EXECUTABLE=/usr/bin/i686-linux-gnu-pkg-config \
168+
-D CMAKE_CXX_FLAGS=-m32 \
169+
-D CMAKE_C_FLAGS=-m32 \
171170
-G Ninja
172171
env:
173-
CFLAGS: -m32
174-
CXXFLAGS: -m32
175-
LDFLAGS: -m32
176-
ASFLAGS: --32
172+
# https://gitlab.kitware.com/cmake/cmake/-/issues/25317
173+
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig
177174
- run: cmake --build build
178-
- run: ctest --output-on-failure -E UnknownFunction
179-
working-directory: build/
175+
- run: ctest --output-on-failure -E UnknownFunction --test-dir build/
180176

181177
windows_vs:
182178
# windows is 2x expensive to run on GitHub machines, so only run if we know something else simple passed as well

BUILD.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -522,22 +522,22 @@ If not already installed, install the following 32-bit development libraries:
522522

523523
`gcc-multilib gcc-multilib g++-multilib libc6:i386 libc6-dev-i386 libgcc-s1:i386 libwayland-dev:i386 libxrandr-dev:i386`
524524

525-
This list may vary depending on your distribution and which windowing systems
526-
you are building for.
525+
This list may vary depending on your distribution and which windowing systems you are building for.
527526

528-
Set up your environment for building 32-bit targets:
527+
Set up your environment for building 32-bit targets when configuring your build:
529528

530-
export CFLAGS=-m32
531-
export CXXFLAGS=-m32
532-
export LDFLAGS=-m32
533-
export ASFLAGS=--32
529+
cmake ... -D CMAKE_CXX_FLAGS=-m32 -D CMAKE_C_FLAGS=-m32
530+
531+
However, you may find that pkg-config picks incorrect libraries. This is due to a CMake implementation issue:
532+
https://gitlab.kitware.com/cmake/cmake/-/issues/25317
534533

535534
Your PKG_CONFIG configuration may be different, depending on your distribution.
536535

536+
You can the `PKG_CONFIG_PATH` environment variable to address this issue.
537+
537538
Finally, build the repository normally as explained above.
538539

539-
These notes are taken from the Github Actions workflow `linux-32` which is run
540-
regularly as a part of CI.
540+
These notes are taken from the Github Actions workflow `linux-32` which is run regularly as a part of CI.
541541

542542
## Building on MacOS
543543

0 commit comments

Comments
 (0)