@stll/oxlint-config 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -42,9 +42,11 @@ apt_install() (
|
|
|
42
42
|
local package
|
|
43
43
|
for package in "$@"; do
|
|
44
44
|
if [[ "$package" == */* ]]; then
|
|
45
|
-
# apt cannot fetch local archives with --download-only
|
|
46
|
-
#
|
|
47
|
-
|
|
45
|
+
# apt cannot fetch local archives with --download-only, so their installs
|
|
46
|
+
# stay one call. Package triggers can be slow on cloud filesystems; the
|
|
47
|
+
# longer whole-call deadline covers them while Acquire timeouts still
|
|
48
|
+
# bound each network request.
|
|
49
|
+
APT_DEADLINE=600 DEBIAN_FRONTEND=noninteractive apt_network install -y --no-install-recommends "$@"
|
|
48
50
|
return
|
|
49
51
|
fi
|
|
50
52
|
done
|
|
@@ -273,22 +275,33 @@ const renderCloudServiceInstall = ({ services, postgres, valkey, valkeyArtifacts
|
|
|
273
275
|
//#region src/cloud-setup-network.ts
|
|
274
276
|
/** Shared deadlines cover retries and package-manager subprocesses. */
|
|
275
277
|
const renderCloudNetwork = () => String.raw`
|
|
278
|
+
release_log_holders() {
|
|
279
|
+
# Processes left by package scripts may still hold a step log after the command exits.
|
|
280
|
+
# Setup starts its own services later, so end them rather than let them write into a
|
|
281
|
+
# deleted log for their whole lifetime.
|
|
282
|
+
# One find over all descriptor links; no process per descriptor.
|
|
283
|
+
local log="$1" root="${"$"}{CLOUD_PROC_ROOT:-/proc}" fd pid
|
|
284
|
+
while IFS= read -r fd; do
|
|
285
|
+
pid="${"$"}{fd%/fd/*}"
|
|
286
|
+
pid="${"$"}{pid##*/}"
|
|
287
|
+
[[ "$pid" =~ ^[0-9]+$ && "$pid" != "$$" ]] || continue
|
|
288
|
+
kill -TERM "$pid" 2>/dev/null || true
|
|
289
|
+
done < <(find "$root" -mindepth 3 -maxdepth 3 -path "$root/[0-9]*/fd/*" -lname "$log" 2>/dev/null)
|
|
290
|
+
}
|
|
276
291
|
network_run() (
|
|
277
292
|
local host="$1" seconds="$2" status=0
|
|
278
293
|
shift 2
|
|
279
|
-
set -o pipefail
|
|
280
294
|
network_log="$(mktemp)" || return "$?"
|
|
281
295
|
trap 'rm -f -- "$network_log"' EXIT
|
|
282
296
|
trap 'exit 129' HUP
|
|
283
297
|
trap 'exit 130' INT
|
|
284
298
|
trap 'exit 143' TERM
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
[[ "$status" != 0 ]] || fail 'Cannot capture network command output'
|
|
299
|
+
# Output goes to a file, never a pipe: package scripts may leave processes that keep
|
|
300
|
+
# inherited descriptors open, and a pipe reader would wait for them past the command.
|
|
301
|
+
timeout --signal=TERM --kill-after=5s "$seconds"s "$@" > "$network_log" 2>&1 || status=$?
|
|
302
|
+
release_log_holders "$network_log"
|
|
303
|
+
cat -- "$network_log" || fail 'Cannot capture network command output'
|
|
304
|
+
[[ "$status" != 0 ]] || return 0
|
|
292
305
|
if [[ "$status" == 124 || "$status" == 137 || "$status" == 28 ]] || grep -Eiq 'timed[[:space:]-]+out|time[[:space:]-]+out|timeout[[:space:]]+(was[[:space:]]+)?(reached|expired)|(connection|operation|socket)[[:space:]-]+timeout' "$network_log"; then
|
|
293
306
|
fail "download timed out: $host"
|
|
294
307
|
fi
|
|
@@ -305,7 +318,8 @@ apt_network() {
|
|
|
305
318
|
# --print-uris reads configured indexes without contacting their servers.
|
|
306
319
|
hosts="$(set -o pipefail; apt-get --print-uris update | awk -F/ '/^\047https?:\/\// { host=$3; sub(/.*@/, "", host); if (!seen[host]++) { printf "%s%s", separator, host; separator="," } }')" || return "$?"
|
|
307
320
|
[[ -n "$hosts" ]] || hosts='configured APT hosts'
|
|
308
|
-
|
|
321
|
+
# APT_DEADLINE: whole-call seconds; callers that also unpack packages may extend it.
|
|
322
|
+
network_run "$hosts" "${"$"}{APT_DEADLINE:-180}" apt-get -o Acquire::http::Timeout=20 -o Acquire::https::Timeout=20 -o Acquire::Retries=3 -o APT::Update::Error-Mode=any "$@"
|
|
309
323
|
}
|
|
310
324
|
apt_refresh_for() {
|
|
311
325
|
# Skip the refresh only when the install downloads nothing: then no package
|