Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir2][genrule_in_image] chown -R $BUCK_SCRATCH_PATH to unprivileg…
…ed uid/gid Summary: - When an action fails, it's common for `$BUCK_SCRATCH_PATH` to have a bunch of files owned by `root:root` - This will make sure that `buck` can delete the files afterwards - This can also happen with `$OUT`, but it's much less common for that to be the problem Test Plan: # Before I was getting lots of permission errors on cleaning up scratch space from failed genrules: ``` $ RUST_LOG=debug buck run //mtia/vm:default -c mtiavm.build=all Action failed: fbcode//mtia/vm:kernel.modules (antlir2_genrule) Internal error (stage: materialize_inputs_failed): Error cleaning up output path `buck-out/v2/tmp/fbcode/a4e2dc5b84913c2f/antlir2_genrule`: remove_dir_all(/home/pdel/fbsource/buck-out/v2/tmp/fbcode/a4e2dc5b84913c2f/antlir2_genrule): Permission deni ed (os error 13) Reproduce locally: `env -- 'BUCK_SCRATCH_PATH=buck-out/v2/tmp/fbcode/a4e2dc5b84913c2f/antlir2_genrule' sudo buck-out/v2/ ...<omitted>... s/* $OUT rm -rf $BUCK_SCRATCH_PATH/* # Avoid permission errors during `buck clean` ' (run `buck2 log what-failed` to get the full command)` stdout: stderr: ``` # After ``` $ sudo rm -rf ~/fbsource/buck-out $ RUST_LOG=debug buck run //mtia/vm:default -c mtiavm.build=all ``` Haven't gotten any more permissions errors after this! Reviewed By: vmagro Differential Revision: D66064392 fbshipit-source-id: 5ad2b9223a10da6bbb21f35d81b375c3618b8733
- Loading branch information