please icon indicating copy to clipboard operation
please copied to clipboard

Output directory fails to move outputs when build directory contains a folder of the same name

Open janhancic opened this issue 3 years ago • 1 comments

When running a custom plz command, that underneath does some plz building I encountered this error:

$ plz ...
Build finished; total time 650ms, incrementality 100.0%.Activating remote execution profile 🏃
Build stopped after 1.97s. 1 target failed:
    //common/protos/logging:_logging#protoc_py
Action URL: https://mettle-browser-lofi.REDACTED/action/mettle_lofi/07f0bcf97af1e5b17b59a736e26615892a7a50646ab75205803e343ef33143f4/148/
: failed to move out directories to correct place in tmp folder: failed to move output dir (out_dir/**) contents to rule root: rename plz-out/tmp/common/protos/logging/_logging#protoc_py._build/out_dir/common plz-out/tmp/common/protos/logging/_logging#protoc_py._build/common: file exists

I ran the same thing again without changing anything and it worked fine.

Please version 16.120.0-beta.17.

janhancic avatar Jun 13 '22 12:06 janhancic

Ah yeah, looking at the code that handles output directories, I think I can see what's going on.

It's going to break in situations where the output directory contains a folder that also exists in your set of dependencies... For some reason, Please tries to merge the output directory into the build root before moving them to plz-out.

Tatskaari avatar Jun 13 '22 16:06 Tatskaari

This has been fixed in a recent Please release

Tatskaari avatar Sep 08 '22 14:09 Tatskaari