From e9521d8e416598ce5fc4c3b28918fb5b58d8de46 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 22 Jul 2025 22:44:50 -0700 Subject: [PATCH] Keep images/google/protobuf directory Commit 68f92b551 removed images/google/protobuf directory, so it is re-created each time during the build process. This resulted in a weird behavior change. Previously, one could do something like this: git clone $CRURL criu (cd criu && sudo make install-criu) rm -rf criu This worked fine, including running rm -rf as a non-root user, since no new directories were created under criu -- all directories were still owned by the original user. Since commit 68f92b551 the same sequence fails: rm: cannot remove '/home/runner/criu/images/google/protobuf/descriptor.pb-c.c': Permission denied rm: cannot remove '/home/runner/criu/images/google/protobuf/descriptor.pb-c.d': Permission denied rm: cannot remove '/home/runner/criu/images/google/protobuf/descriptor.pb-c.h': Permission denied A workaround is to keep empty images/google/protobuf directory, which is what this commit does. Signed-off-by: Kir Kolyshkin --- .gitignore | 2 -- images/Makefile | 5 ++--- images/google/protobuf/.gitignore | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 images/google/protobuf/.gitignore diff --git a/.gitignore b/.gitignore index 854657d1c..94daa13ea 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,6 @@ compel/compel compel/compel-host-bin images/*.c images/*.h -images/google/protobuf/*.c -images/google/protobuf/*.h .gitid criu/criu criu/unittest/unittest diff --git a/images/Makefile b/images/Makefile index cb30a5126..6f310e553 100644 --- a/images/Makefile +++ b/images/Makefile @@ -92,8 +92,7 @@ makefile-deps := Makefile $(obj)/Makefile # # Generate descriptor.pb-c.c and descriptor.pb-c.h to compile opts.proto. -PROTOBUF_DIR := images/google -DESCRIPTOR_DIR := $(PROTOBUF_DIR)/protobuf +DESCRIPTOR_DIR := images/google/protobuf GOOGLE_INCLUDE=$(shell pkg-config protobuf --variable=includedir)/google/protobuf $(DESCRIPTOR_DIR)/descriptor.pb-c.c: $(GOOGLE_INCLUDE)/descriptor.proto $(Q) echo "Generating descriptor.pb-c.c" @@ -102,7 +101,7 @@ $(DESCRIPTOR_DIR)/descriptor.pb-c.c: $(GOOGLE_INCLUDE)/descriptor.proto cleanup-y += $(DESCRIPTOR_DIR)/descriptor.pb-c.d submrproper: - $(Q) rm -rf $(PROTOBUF_DIR) + $(Q) rm -f $(DESCRIPTOR_DIR)/* .PHONY: submrproper mrproper: submrproper diff --git a/images/google/protobuf/.gitignore b/images/google/protobuf/.gitignore new file mode 100644 index 000000000..68359a786 --- /dev/null +++ b/images/google/protobuf/.gitignore @@ -0,0 +1,2 @@ +*.c +*.h