Skip to content

Commit 754d8e4

Browse files
Exhaustively document exactly what we're doing in the workflow file…
…and why, and how it may need to change over time.
1 parent 29f41c9 commit 754d8e4

1 file changed

Lines changed: 43 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,49 @@ jobs:
3939
timestamp: ${{ steps.linux-binary-version.outputs.timestamp }}
4040

4141
steps:
42-
# - name: Edit sources.list - Linux
43-
# if: ${{ runner.os == 'Linux' }}
44-
# run: |
45-
# sed -i s/deb.debian.org/archive.debian.org/g /etc/apt/sources.list
46-
# sed -i s/security.debian.org/archive.debian.org/g /etc/apt/sources.list
47-
# sed -i '/security/d' /etc/apt/sources.list
48-
# sed -i '/-updates/d' /etc/apt/sources.list
42+
# We want to build against the oldest version of `glibc` that we can get
43+
# away with. (As of Electron 32, Electron themselves build with a Debian
44+
# 11 image, so the version we target is `glibc` 2.31.) But at some point
45+
# in the recent past, V8 started enforcing use of a compiler that
46+
# understands C++20, and this started affecting Pulsar once it bumped
47+
# past a certain version of Electron.
48+
#
49+
# Debian 11 gives us the `glibc` we want, but its `gcc` doesn't fit the
50+
# bill. (Its C++20 support is experimental and we were never able to make
51+
# it play well with Electron after the v32 bump.)
52+
#
53+
# For this reason, dependencies will build just fine upon initial
54+
# installation, but run the risk of failing when we rebuild them for
55+
# Electron. Electron's V8 version tends to be driven by Chromium; so even
56+
# though Electron 32.2.3 uses Node 20.18.1, it combines it with a much
57+
# higher version of V8 than the standalone Node 20.18.1 used. For this
58+
# exact reason, even a dependency like `@pulsar-edit/fuzzy-native`, which
59+
# builds perfectly well on Node 20.18.1 with C++17, fails at the rebuild
60+
# step because of V8's more stringent requirements.
61+
#
62+
# The way out of this is to decouple the target `glibc` from that of the
63+
# host machine — allowing us to use newer `gcc` on Debian 11 without
64+
# raising the `glibc` floor above 2.31. To do this, we install
65+
# conda-forge's vendored static toolchain.
66+
#
67+
# And since Electron is the only thing mandating C++20 support at the
68+
# moment (the relevant libraries we use still build just fine with C++17
69+
# or less), for now we'll only use these vendored tools for the
70+
# electron-rebuild step. If we should need to use them more widely after
71+
# a future Electron bump, it should be as simple as pointing the relevant
72+
# environment variables to `PULSAR_CC`, `PULSAR_CXX`, etc., for whichever
73+
# other steps require them.
74+
#
75+
# (For instance: the version of V8 that first caused rebuild failures for
76+
# us was 12.8; Node itself didn't start using a version that high until
77+
# 23.0.0. So once we bump to a version of Electron that uses Node 24, I
78+
# expect that we'll need to start using the conda-forge compiler
79+
# toolchain throughout this workflow file. At that point, we should also
80+
# research whether it's worth bumping to a newer Debian image; we don't
81+
# want to set a _higher_ `glibc` floor than Electron themselves, but
82+
# there's no point in targeting a _lower_ `glibc` floor, either. Ideally,
83+
# we'd stay in sync with whatever version of Debian Electron uses for
84+
# Linux builds.)
4985
- name: Install Modern GCC Toolchain - Linux
5086
if: ${{ runner.os == 'Linux' }}
5187
run: |
@@ -213,8 +249,6 @@ jobs:
213249
max_attempts: 3
214250
retry_on: error
215251
command: |
216-
echo "libx11.so lives at:"
217-
dpkg -L libx11-6 | grep '\.so'
218252
yarn build
219253
220254
- name: Build ppm

0 commit comments

Comments
 (0)