Skip to content

Commit 975437d

Browse files
Node 24 Fibers patch dockerfile updates
1 parent f1458dd commit 975437d

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

Dockerfile.Fibers

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,22 @@ RUN echo -------------------
4949
RUN git clone --branch jackstrohm_node20_fibers --depth 1 https://github.com/asana/node-fibers.git node-fibers
5050

5151
WORKDIR /usr/src/node/node-fibers
52+
53+
# Apply V8 v13 API compatibility patches for accessor callbacks
54+
# Change Local<String> to Local<Name> in getter/setter signatures
55+
RUN sed -i 's/GetStarted(Local<String> property/GetStarted(Local<Name> property/g' src/fibers.cc && \
56+
sed -i 's/GetCurrent(Local<String> property/GetCurrent(Local<Name> property/g' src/fibers.cc && \
57+
sed -i 's/GetPoolSize(Local<String> property/GetPoolSize(Local<Name> property/g' src/fibers.cc && \
58+
sed -i 's/SetPoolSize(Local<String> property/SetPoolSize(Local<Name> property/g' src/fibers.cc && \
59+
sed -i 's/GetFibersCreated(Local<String> property/GetFibersCreated(Local<Name> property/g' src/fibers.cc
60+
61+
# Build node-fibers against the custom Node.js headers
5262
RUN npm install --nodedir="/usr/src/node/node-install/usr/local"
63+
64+
# Verify fibers native module loads correctly
65+
RUN node -e "const Fiber = require('./build/Release/fibers.node'); console.log('Fibers native module loaded successfully');"
66+
67+
# Run tests
5368
RUN npm test || true
5469
RUN rm bin/repl
5570
RUN find .

Dockerfile.Node24

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
3838
WORKDIR /usr/src/node
3939
COPY . .
4040

41-
# Disable maglev for fibers compatibility - maglev uses thread_local and stack manipulation
42-
# that conflicts with fiber context switching
43-
RUN ./configure --experimental-enable-pointer-compression --v8-disable-maglev
41+
# Configure Node.js for fibers compatibility:
42+
# - v8_enable_sandbox is already disabled in configure.py (required for ucontext stack switching)
43+
# - Do NOT enable pointer compression (unsupported without sandbox, adds ABI complexity)
44+
# - Disable maglev (its stack manipulation conflicts with fiber context switching)
45+
RUN ./configure --v8-disable-maglev
4446
RUN make -j4 install DESTDIR=./node-install
4547

4648
CMD ["bash"]

0 commit comments

Comments
 (0)