Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmatched glob when files matches filename with square brackets #15381

Closed
caleblloyd opened this issue May 10, 2022 · 0 comments · Fixed by #15383
Closed

Unmatched glob when files matches filename with square brackets #15381

caleblloyd opened this issue May 10, 2022 · 0 comments · Fixed by #15383
Labels

Comments

@caleblloyd
Copy link
Contributor

Describe the bug

When a files target matches a source with square brackets in the filename, such as [test].txt, this error is thrown:

22:15:10.35 [WARN] Unmatched glob from test/[test].txt:files's `source` field: "test/[test].txt"

Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to https://www.pantsbuild.org/v2.11/docs/troubleshooting#pants-cannot-find-a-file-in-your-project.
22:15:10.35 [ERROR] 1 Exception encountered:

  InvalidFieldException: The 'source' field in target test/[test].txt:files must have 1 file, but it had 0 files.

Pants version
2.11

OS
Linux

Additional info
Full reproduction of bug: https://github.com/caleblloyd/pants-square-bracket-repro

@caleblloyd caleblloyd added the bug label May 10, 2022
@caleblloyd caleblloyd changed the title Unmatched glob when files matches square brackets Unmatched glob when files matches filename with square brackets May 10, 2022
Eric-Arellano pushed a commit that referenced this issue May 11, 2022
Eric-Arellano pushed a commit to Eric-Arellano/pants that referenced this issue May 11, 2022
Fixes pantsbuild#15381.

[ci skip-rust]
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Eric-Arellano pushed a commit to Eric-Arellano/pants that referenced this issue May 11, 2022
Fixes pantsbuild#15381.

[ci skip-rust]
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Eric-Arellano added a commit that referenced this issue May 11, 2022
Eric-Arellano added a commit that referenced this issue May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant