From 3cce5d8551a82406788fd60a0d8460f72af39640 Mon Sep 17 00:00:00 2001 From: Andrew Calcutt Date: Sun, 15 Mar 2026 17:28:06 -0400 Subject: [PATCH] Fix linux-coverage CI job failures (#4174) --- .bazelrc | 7 +++++++ test/storage/server.js | 22 ++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.bazelrc b/.bazelrc index 5e94e68de..4c13fd848 100644 --- a/.bazelrc +++ b/.bazelrc @@ -10,5 +10,12 @@ coverage --experimental_ui_max_stdouterr_bytes=10485760 common:macos --linkopt=-L/opt/homebrew/lib +# Ensure GCC is used consistently for toolchain detection and compilation on Linux. +# This prevents a mismatch where local_config_cc detects one GCC version but compilation +# pulls headers from another, causing "absolute path inclusion" errors in Bazel's +# strict include checker (seen on Ubuntu 24.04 with rules_cc 0.2.x / Bazel 8.5+). +build:linux --repo_env=CC=gcc +build:linux --repo_env=CXX=g++ + # disables telemetry https://github.com/aspect-build/tools_telemetry common --repo_env=ASPECT_TOOLS_TELEMETRY= diff --git a/test/storage/server.js b/test/storage/server.js index 04ccc430b..b5ad06337 100755 --- a/test/storage/server.js +++ b/test/storage/server.js @@ -36,7 +36,7 @@ app.get('/test', function (req, res) { res.send(content); }); -app.get('/stale/*', function() { +app.get('/stale/*path', function() { // Never respond. }); @@ -169,18 +169,28 @@ app.get('/delayed', function(req, res) { }); -app.get('/load/:number(\\d+)', function(req, res) { - res.send('Request ' + req.params.number); +app.get('/load/:number', function(req, res) { + const number = parseInt(req.params.number, 10); + if (isNaN(number)) { + res.status(400).send('Bad Request'); + return; + } + res.send('Request ' + number); }); -app.get('/online/:style(*)', function(req, res) { - const file = path.join(import.meta.dirname, "../fixtures/map/online", req.params.style); +app.get('/online/*style', function(req, res) { + const stylePath = [].concat(req.params.style).join('/'); + const file = path.join(import.meta.dirname, "../fixtures/map/online", stylePath); res.sendFile(file); // Set disposition and send it. // res.status(200).send(); // res.send('Request ' + req.params.style); }); -var server = app.listen(3000, function () { +var server = app.listen(3000, function (error) { + if (error) { + process.stderr.write('Failed to start server: ' + error.message + '\n'); + process.exit(1); + } // Tell parent that we're now listening. process.stdout.write("OK"); });