buck2 icon indicating copy to clipboard operation
buck2 copied to clipboard

erlang_release: "failed to cleanup output directory" when setting `include_erts = True`

Open f-f opened this issue 1 year ago • 1 comments

As per title - setting include_erts = True in a erlang_release declaration causes errors in subsequent rebuilds: when the cache is invalidated, or when calling buck2 clean, buck2 will try to remove the output directory, and fail to do so. This is likely because the erts folder in the release is not included with writing permissions:

$ ls -alh buck-out/v2/gen/root/200212f73efcd57d/__my-release__/__build/erlang-local/my-app/
total 0
drwxr-xr-x  7 fabrizio staff  224 Jun 26 15:44 .
drwxr-xr-x  5 fabrizio staff  160 Jun 26 15:26 ..
drwxr-xr-x  3 fabrizio staff   96 Jun 26 15:26 bin
dr-xr-xr-x  9 fabrizio staff  288 Jun 26 15:26 erts
drwxr-xr-x  3 fabrizio staff   96 Jun 26 15:26 init
drwxr-xr-x 44 fabrizio staff 1.4K Jun 26 15:44 lib
drwxr-xr-x  3 fabrizio staff   96 Jun 26 15:26 releases

f-f avatar Jun 26 '24 12:06 f-f

Hi, sorry for the late answer. I just tried to reproduce the issue locally, but have the same permissions set for erts/ then any other folder. The rules just copy the erts folder from the Erlang distribution used during the build into the release output folder. Can you check the permissions on that folder? We could chmod the folder to add write priviledges to avoid the issue as well.

TheGeorge avatar Mar 07 '25 13:03 TheGeorge