Hey all, just starting to experiment with pants in...
# general
b
Hey all, just starting to experiment with pants in our mixed language: Golang, Python, Javascript monorepo. I am having trouble with the Golang backend trying to do
pants tailor
where it tries to read BUILD.bazel files in our golang/vendor directory and crashing. I found this issue: https://github.com/pantsbuild/pants/issues/14255 but that isn’t exactly the problem I am seeing.
Copy code
% pants tailor ::
11:35:38.54 [INFO] Initializing scheduler...
11:35:43.23 [INFO] Scheduler initialized.
11:35:43.59 [ERROR] 1 Exception encountered:

Engine traceback:
  in `tailor` goal

MappingError: Failed to parse ./golang/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel:
ParseError: golang/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel:1: Name 'load' is not defined.

If you expect to see more symbols activated in the below list, refer to <https://www.pantsbuild.org/v2.18/docs/enabling-backends> for all available backends to activate.

All registered symbols: ['PANTS_VERSION', '__defaults__', '__dependencies_rules__', '__dependents_rules__', '_generator_sources_helper', '_lockfile', '_lockfiles', 'archive', 'build_file_dir', 'docker_environment', 'docker_image', 'env', 'experimental_test_shell_command', 'experimental_wrap_as_go_package_sources', 'experimental_wrap_as_python_sources', 'experimental_wrap_as_resources', 'file', 'files', 'go_binary', 'go_mod', 'go_package', 'go_third_party_package', 'http_source', 'javascript_source', 'javascript_sources', 'javascript_test', 'javascript_tests', 'local_environment', 'node_build_script', 'node_package', 'node_test_script', 'node_third_party_package', 'package_json', 'parametrize', 'per_platform', 'pex_binaries', 'pex_binary', 'pipenv_requirements', 'poetry_requirements', 'protobuf_source', 'protobuf_sources', 'python_artifact', 'python_distribution', 'python_requirement', 'python_requirements', 'python_source', 'python_sources', 'python_test', 'python_test_utils', 'python_tests', 'relocated_files', 'remote_environment', 'resource', 'resources', 'run_shell_command', 'setup_py', 'shell_command', 'shell_source', 'shell_sources', 'shunit2_test', 'shunit2_tests', 'target']
Any ideas on how to resolve this issue? Should I file a ticket or is there some config I am missing in pants.toml?
c
Take a look at https://www.pantsbuild.org/2.18/reference/global-options#build_patterns We set
build_patterns = ["BUILD", "BUILD.pants"]
for similar reasons
πŸ‘€ 1
b
Thanks. That gets past the error but it generates BUILD files in golang/vendor dirs despite have β€œ^/golang/vendor/*” in roots.
c
I don't actually use Golang, so I could be missing something or maybe the linked issue is eventually going to get in the way anyway, but have you tried setting:
Copy code
`
[tailor]
ignore_paths = [
the/vendor/path
(I'm not sure offhand if source roots support ^ regexes)
πŸ‘† 1