thought-machine / please

High-performance extensible build system for reproducible multi-language builds.
https://please.build
Apache License 2.0
2.44k stars 203 forks source link

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

Closed janhancic closed 1 year ago

janhancic commented 2 years ago

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.

Tatskaari commented 2 years ago

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 commented 1 year ago

This has been fixed in a recent Please release