All of lore.kernel.org
 help / color / mirror / Atom feed
From: Louis des Landes <louis@psykar.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] Makefile: add chmod before rm when cleaning.
Date: Wed, 17 Apr 2019 09:39:30 +0930	[thread overview]
Message-ID: <20190417000931.5356-1-louis.deslandes@fleet.space> (raw)

Some build systems (looking at you golang) create read only directories
as caches.
As such rm -rf will actually fail, causing clean and <pkg>-dirclean to fail.

This patch will cause `make clean` to run chmod -R +w on the relevant
directory first, which will allow rm -rf to work.

This may be resolved if https://github.com/golang/go/issues/31481 is
resolved satisfactorily.

Signed-off-by: Louis des Landes <louis.deslandes@fleet.space>
---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 522c0b0606..fc2a82e074 100644
--- a/Makefile
+++ b/Makefile
@@ -1060,6 +1060,12 @@ printvars:
 
 .PHONY: clean
 clean:
+	# Some build systems (looking at you golang) create read only directories
+	# As such rm -rf will actually fail, so brute force them all to writeable
+	# before removing them.
+	chmod -R u+w $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
+		$(BUILD_DIR) $(BASE_DIR)/staging \
+		$(LEGAL_INFO_DIR) $(GRAPHS_DIR)
 	rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
 		$(BUILD_DIR) $(BASE_DIR)/staging \
 		$(LEGAL_INFO_DIR) $(GRAPHS_DIR)
-- 
2.21.0

             reply	other threads:[~2019-04-17  0:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17  0:09 Louis des Landes [this message]
2019-04-17  0:09 ` [Buildroot] [PATCH 2/2] package/pkg-generic: add chmod when cleaning Louis des Landes
2019-04-17 20:42 ` [Buildroot] [PATCH 1/2] Makefile: add chmod before rm " Arnout Vandecappelle
2019-04-18  0:14   ` Louis des Landes
2019-04-21  7:11     ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190417000931.5356-1-louis.deslandes@fleet.space \
    --to=louis@psykar.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.