Skip to content

Commit 2f03aa4

Browse files
committed
chore: set UV_USE_IO_URING=0 on npm builds
There's currently a bad interaction between the nodejs version in the archives and the kernel, causing an infinite hang during 'npm install': - npm/cli#4028 - amazonlinux/amazon-linux-2023#856 For now we need to disable libuv's use of io_uring because this hanging wrecks spread runs; this should be able to be reverted in a few months (as of April 2025).
1 parent 2139bcd commit 2f03aa4

File tree

5 files changed

+27
-7
lines changed

5 files changed

+27
-7
lines changed

docs/tutorial/code/node-app/rockcraft.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ parts:
2323
npm-include-node: True
2424
npm-node-version: "21.1.0"
2525
source: src/
26+
build-environment:
27+
# NOTE: There's currently a bad interaction between the nodejs version in the
28+
# archives and the kernel, causing an infinite hang during 'npm install':
29+
# - https://github.com/npm/cli/issues/4028
30+
# - https://github.com/amazonlinux/amazon-linux-2023/issues/856
31+
# For now we need to disable libuv's use of io_uring; this should be able to
32+
# be reverted in a few months (as of April 2025).
33+
- UV_USE_IO_URING: "0"

rockcraft/extensions/expressjs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ def _gen_install_app_part(self) -> dict[str, Any]:
152152
install_app_part["npm-node-version"] = self._user_install_app_part.get(
153153
"npm-node-version"
154154
)
155+
156+
# NOTE: There's currently a bad interaction between the nodejs version in the
157+
# archives and the kernel, causing an infinite hang during 'npm install':
158+
# - https://github.com/npm/cli/issues/4028
159+
# - https://github.com/amazonlinux/amazon-linux-2023/issues/856
160+
# For now we need to disable libuv's use of io_uring; this should be able to
161+
# be reverted in a few months (as of April 2025).
162+
install_app_part["build-environment"] = [{"UV_USE_IO_URING": "0"}]
155163
return install_app_part
156164

157165
def _gen_app_build_packages(self) -> list[str]:

spread.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ backends:
2828
- ubuntu-20.04-64:
2929
workers: 1
3030
storage: 40G
31-
- ubuntu-22.04-64:
31+
- ubuntu-24.04-64:
3232
workers: 4
3333
storage: 40G
3434
- fedora-39-64:
@@ -142,7 +142,7 @@ suites:
142142
tests/spread/rockcraft/:
143143
summary: tests for rockcraft core functionality, independent of host system
144144
systems:
145-
- ubuntu-22.04-64
145+
- ubuntu-24.04-64
146146

147147
tests/spread/foreign/:
148148
summary: tests that rockcraft and rocks work on different host systems

tests/spread/rockcraft/extension-expressjs/task.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ execute: |
1414
express app
1515
cd app && npm install && cd ..
1616
17-
run_rockcraft init --name "${NAME}" --profile expressjs-framework
18-
sed -i "s/^base: .*/base: ${SCENARIO//-/@}/g" rockcraft.yaml
19-
if [ "${SCENARIO}" != "bare" ]; then
20-
sed -i "s/^build-base: .*/build-base: ${SCENARIO//-/@}/g" rockcraft.yaml
21-
fi
17+
# run_rockcraft init --name "${NAME}" --profile expressjs-framework
18+
# sed -i "s/^base: .*/base: ${SCENARIO//-/@}/g" rockcraft.yaml
19+
# if [ "${SCENARIO}" != "bare" ]; then
20+
# sed -i "s/^build-base: .*/build-base: ${SCENARIO//-/@}/g" rockcraft.yaml
21+
# fi
2222
2323
function run_test() {
2424
# rockcraft clean is required here because the cached layer writes to npmrc

tests/unit/extensions/test_expressjs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def package_json_file(app_path):
8888
),
8989
"build-packages": ["nodejs", "npm"],
9090
"stage-packages": ["ca-certificates_data", "nodejs_bins"],
91+
"build-environment": [{"UV_USE_IO_URING": "0"}],
9192
},
9293
"expressjs-framework/runtime": {
9394
"plugin": "nil",
@@ -129,6 +130,7 @@ def package_json_file(app_path):
129130
"plugin": "npm",
130131
"source": "app/",
131132
"stage-packages": ["ca-certificates_data"],
133+
"build-environment": [{"UV_USE_IO_URING": "0"}],
132134
}
133135
},
134136
"platforms": {
@@ -180,6 +182,7 @@ def package_json_file(app_path):
180182
"ca-certificates_data",
181183
"coreutils_bins",
182184
],
185+
"build-environment": [{"UV_USE_IO_URING": "0"}],
183186
},
184187
"expressjs-framework/runtime": {
185188
"plugin": "nil",
@@ -235,6 +238,7 @@ def package_json_file(app_path):
235238
"ca-certificates_data",
236239
"coreutils_bins",
237240
],
241+
"build-environment": [{"UV_USE_IO_URING": "0"}],
238242
},
239243
"expressjs-framework/runtime": {
240244
"plugin": "nil",

0 commit comments

Comments
 (0)