Skip to content

Commit 9777612

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Fix getdeps introducting a space after a colon which confuses the parser
Summary: Fix YAML syntax error in the generated GitHub Actions workflow cachelib/public_tld/.github/workflows/getdeps_linux.yml that prevented the linux CI job from loading (Invalid workflow file ... line 161). The breakage was on every run: step containing --extra-cmake-defines '{"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"}'. The run: value is an unquoted YAML plain scalar, and the ": " (colon + space) inside the JSON was parsed as a mapping key/value separator, producing mapping values are not allowed here. GitHub reported the failing step's first line (161); the actual offending byte was on line 168 col 196, with the same pattern repeated on all 36 build steps. Two changes: 1. Quick fix to the generated workflow (cachelib/public_tld/.github/workflows/getdeps_linux.yml) — rewrite the inline JSON in compact form ({"CMAKE_CXX_COMPILER_LAUNCHER":"sccache"}, no space after :) across all 36 occurrences. This unblocks CI immediately. 2. Durable fix in the generator (opensource/fbcode_builder/getdeps.py, cmake_arg_for) — pass separators=(",", ":") to json.dumps, so future regenerations of any project's workflow (cachelib, folly, fbthrift, watchman, etc.) emit YAML-safe compact JSON. Both layers are needed: without (1) CI fails today; without (2) the next time anyone runs update-all-github-actions.sh the bug returns. Reviewed By: vj7-byte, alikhtarov Differential Revision: D104263446 fbshipit-source-id: 9ff90b341ba5d1aaf64d10ab77b3f6e3552c2398
1 parent 05d6265 commit 9777612

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

build/fbcode_builder/getdeps.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,11 @@ def cmake_arg_for(name):
12421242
merged = dict(extra_cmake_defines)
12431243
merged.update(per_package_defines.get(name, {}))
12441244
if merged:
1245-
return " --extra-cmake-defines '" + json.dumps(merged) + "'"
1245+
return (
1246+
" --extra-cmake-defines '"
1247+
+ json.dumps(merged, separators=(",", ":"))
1248+
+ "'"
1249+
)
12461250
return ""
12471251

12481252
build_type_arg = ""

0 commit comments

Comments
 (0)