Skip to content

Commit 497d1ad

Browse files
Introduce a workaround for libstdc++ problem in CI
1 parent fcf47bc commit 497d1ad

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,43 +44,62 @@ jobs:
4444
steps:
4545
- run: echo $LD_LIBRARY_PATH
4646
- run: find /usr/lib -name libstdc++.so.6
47+
4748
- name: Checkout source code
4849
uses: actions/checkout@v2
50+
4951
- name: Setup Swift
5052
if: runner.os == 'Linux'
5153
uses: swift-actions/setup-swift@v1
54+
5255
- name: Setup Emacs
5356
uses: purcell/setup-emacs@master
5457
with:
5558
version: ${{ matrix.emacs-version }}
59+
5660
- uses: actions/cache@v3
5761
id: cache-cask-packages
5862
with:
5963
path: .cask
6064
key: cache-cask-packages-000
65+
6166
- uses: actions/cache@v3
6267
id: cache-cask-executable
6368
with:
6469
path: ~/.cask
6570
key: cache-cask-executable-000
71+
6672
- name: Setup Cask
6773
uses: cask/setup-cask@master
6874
if: steps.cache-cask-executable.outputs.cache-hit != 'true'
6975
with:
7076
version: snapshot
77+
7178
- run: echo "$HOME/.cask/bin" >> $GITHUB_PATH
79+
7280
- name: Build the test module
7381
run: swift build -c ${{ matrix.configuration }}
82+
7483
- name: Rename .dylib for older Emacs versions
7584
run: cp $BUILD_DIR/libTestModule.dylib $BUILD_DIR/$TEST_LIB
7685
if: matrix.emacs-version != 28.1 && runner.os == 'macOS'
86+
7787
- name: Cask install test dependencies
7888
run: cask install
89+
7990
# Enable tmate debugging of manually-triggered workflows if the input option was provided
8091
- name: Setup tmate session
8192
uses: mxschmitt/action-tmate@v3
8293
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
94+
95+
# A nasty workaround for Swift standard libraries on linux that don't set their RPATH to
96+
# libstdc++ properly. Evidently, it becomes problematic with nix installed Emacs.
97+
- name: Create symlink and set LD_LIBRARY_PATH
98+
run: |
99+
mkdir -p /tmp/libstdc++
100+
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /tmp/libstdc++/libstdc++.so.6
101+
83102
- name: Run tests
84103
run: cask exec ert-runner -l $BUILD_DIR/$TEST_LIB -t emacs-${EMACS_VERSION%.*},emacs-all
85104
env:
86-
LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu
105+
LD_LIBRARY_PATH: /tmp/libstdc++

0 commit comments

Comments
 (0)