pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.31k stars 636 forks source link

lockfiles only work if pants.backend.python is activated #14876

Closed ryanking closed 2 years ago

ryanking commented 2 years ago

Describe the bug

In a repo which does not use python (terraform & go) I had troubled getting lockfiles generated.

Unknown flag --resolve on global scope
Did you mean --level?
Use `./pants help` to get help.
11:57:54.70 [ERROR] Unknown flags --resolve on global scope

Use --print-stacktrace for more error details and/or -ldebug for more logs. 
See https://www.pantsbuild.org/v2.9/docs/troubleshooting for common issues.
Consider reaching out for help: https://www.pantsbuild.org/v2.9/docs/getting-help

Once i added pants.backend.python to backend_packages the command worked.

Pants version 2.9.0

OS Mac

Eric-Arellano commented 2 years ago

What were you trying to generate lockfiles for? Pants does not generate lockfiles for Go or Terraform yet. When you don't have pants.backend.{python,java,scala} activated, then Pants should not be showing the generate-lockfiles goal with ./pants help goals.

ryanking commented 2 years ago

I was trying to generate a lockfile for the terraform hcl2 parser (so that I could upgrade the library version).

@tdyas suggested ./pants generate-lockfiles --resolve=terraform-hcl2-parser to do that, which fails. I don't know if help was listing it or not.

Eric-Arellano commented 2 years ago

Ahhh that makes sense. Thanks for filing this! So we need to register the Python generate-lockfiles rules for Terraform & I think Docker because they use PythonTool. Go does not need it.

Eric-Arellano commented 2 years ago

See https://github.com/pantsbuild/pants/pull/15453. Thanks for the report!!