export-codegen
is not resilient to existing contents in dist/codegen
#18941
Labels
export-codegen
is not resilient to existing contents in dist/codegen
#18941
Describe the bug
When running
pants export-codegen ...
when there's existing entries in overlapping locations indist/
, it doesn't clear out those entries, which can lead to problems:dist/
, and writing a directory, or vice versa), runningexport-codegen
throws errors likeIntrinsicError: Error opening file .../dist/codegen/entry for writing: Os { code: 21, kind: IsADirectory, message: "Is a directory" }
IntrinsicError: File exists (os error 17)
when attempting to overwrite a symlink indist/
#18809 / Remove existing entry if any when materialising symlink #18873, but potentially that work-around could be removed.)Reproducer:
Pants version
2.16.0rc1, but likely affects all versions
OS
macOS
Additional info
This is the equivalent of #17758 and #18849 for
export-codegen
instead ofpackage
. #18930 built infrastructure withwrite_digest(..., clear_paths=...)
that makes fixing this easier.The text was updated successfully, but these errors were encountered: