File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,7 +49,22 @@ RUN echo -------------------
4949RUN git clone --branch jackstrohm_node20_fibers --depth 1 https://github.com/asana/node-fibers.git node-fibers
5050
5151WORKDIR /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
5262RUN 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
5368RUN npm test || true
5469RUN rm bin/repl
5570RUN find .
Original file line number Diff line number Diff line change @@ -38,9 +38,11 @@ RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
3838WORKDIR /usr/src/node
3939COPY . .
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
4446RUN make -j4 install DESTDIR=./node-install
4547
4648CMD ["bash"]
You can’t perform that action at this time.
0 commit comments