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

BUILD couldn't be created in a directory which contains a directory called build #20845

Open
eBeyond opened this issue Apr 26, 2024 · 1 comment
Labels
bug diagnostics Poor diagnostics, error messages that could be improved

Comments

@eBeyond
Copy link

eBeyond commented Apr 26, 2024

Describe the bug
If I run pants tailor :: I get this error:
`❯ pants tailor ::
10:17:24.86 [INFO] Initializing scheduler...
10:17:25.08 [INFO] Scheduler initialized.
10:17:25.28 [ERROR] 1 Exception encountered:

Engine traceback:
in tailor goal

IntrinsicError: Error opening file /client/BUILD for writing: Os { code: 21, kind: IsADirectory, message: "Is a directory" }
`
It's trying to create a BUILD File in there, but there is already an directory called 'build' in there. This directory cannot be renamed, because it's a generated one.

Pants version
2.20.0
OS
macOs

@eBeyond eBeyond added the bug label Apr 26, 2024
@huonw
Copy link
Contributor

huonw commented Apr 27, 2024

Ah, overlapping (case-insensitive) filenames is unfortunate. We could definitely improve the diagnostics here.

The default build_pattern option (https://www.pantsbuild.org/2.20/reference/global-options#build_patterns) includes any BUILD.* files, so a workaround would be to use file names like BUILD.pants. You can tell tailor what filename you want with https://www.pantsbuild.org/2.20/reference/goals/tailor#build_file_name e.g.

# pants.toml

...

[tailor]
build_file_name = "BUILD.pants"

@huonw huonw added the diagnostics Poor diagnostics, error messages that could be improved label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug diagnostics Poor diagnostics, error messages that could be improved
Projects
None yet
Development

No branches or pull requests

2 participants