Skip to content

Commit 3ff2186

Browse files
authored
Allow disable node v8 maglev jit compiler on node24. (#4447)
1 parent 7c0b271 commit 3ff2186

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ TestResults
2727
TestLogs
2828
.DS_Store
2929
.mono
30-
**/*.DotSettings.user
30+
**/*.DotSettings.user
31+
**/*.lscache

src/Runner.Worker/Handlers/NodeScriptActionHandler.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using GitHub.Runner.Sdk;
1313
using GitHub.Runner.Worker.Container;
1414
using GitHub.Runner.Worker.Container.ContainerHooks;
15+
using GitHub.Services.Common;
1516

1617
namespace GitHub.Runner.Worker.Handlers
1718
{
@@ -128,6 +129,15 @@ public async Task RunAsync(ActionRunStage stage)
128129
// file name character on Linux.
129130
string arguments = StepHost.ResolvePathForStepHost(ExecutionContext, StringUtil.Format(@"""{0}""", target.Replace(@"""", @"\""")));
130131

132+
// Disable maglev jit compiler in node.js 24.x.x on x64 Windows until the node.js bug is fixed.
133+
// https://github.com/nodejs/node/issues/62260
134+
if (nodeRuntimeVersion.StartsWith("node24", StringComparison.OrdinalIgnoreCase) &&
135+
(StringUtil.ConvertToBoolean(System.Environment.GetEnvironmentVariable("ACTIONS_RUNNER_DISABLE_NODE_MAGLEV")) || StringUtil.ConvertToBoolean(Environment.GetValueOrDefault("ACTIONS_RUNNER_DISABLE_NODE_MAGLEV"))))
136+
{
137+
Trace.Info("Disable maglev jit compiler in node.js");
138+
arguments = $"--no-maglev {arguments}";
139+
}
140+
131141
#if OS_WINDOWS
132142
// It appears that node.exe outputs UTF8 when not in TTY mode.
133143
Encoding outputEncoding = Encoding.UTF8;

0 commit comments

Comments
 (0)