<#18277 `pants --loop` with an invalid BUILD file ...
# github-notifications
q
#18277 `pants --loop` with an invalid BUILD file will loop forever Issue created by huonw Describe the bug If a BUILD file is invalid (e.g. fails to parse), any
pants --loop
invocation will spew "Failed to parse ./BUILD" errors (or similar) forever. Reproducer:
Copy code
cd $(mktemp -d)
cat > pants.toml <<EOF
[GLOBAL]
pants_version = "2.14.0"

backend_packages = [
  "pants.backend.shell",
]

[anonymous-telemetry]
enabled = false
EOF

echo 'invalid code' > BUILD

pants --loop run :whatever
Copy code
...
12:33:12.45 [ERROR] 1 Exception encountered:

  MappingError: Failed to parse ./BUILD:
invalid syntax (<string>, line 1)

12:33:12.45 [ERROR] 1 Exception encountered:

  MappingError: Failed to parse ./BUILD:
invalid syntax (<string>, line 1)

12:33:12.45 [ERROR] 1 Exception encountered:

  MappingError: Failed to parse ./BUILD:
invalid syntax (<string>, line 1)
...
Pants version 2.14.0, 2.16.0.dev6 OS macOS Additional info A similar invalid spec bug: #18276. Other infinite
--loop
bugs: #16727, #18275 pantsbuild/pants
u