From patchwork Mon Nov 25 09:57:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13884732 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BA091198A32 for ; Mon, 25 Nov 2024 09:57:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732528648; cv=none; b=Ep2YkykcNSypmscMMRXve3UNnqLkgcWUEW0jhuTp/VqPcWVwQi5Cxl3nrxk0/uzJuANhE/KF4+gDC1RMg0Cwsr+dciRNUqWRW+Yk+X+gYfCylZ6y5eCfw7SkWRdtAkmfyO6qvj7+dJNt8IuDO/YCU9es7eiwOSjBL6tKzfv6sYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732528648; c=relaxed/simple; bh=tx5ZAK7gXuohtB4FkxD15HBYsCBeOZY3vjhB8JC0R+Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lLuhTIKXiQi9cmhJNnIRu0wnpag3ou1/GSXc22HKF8/rAhTGKYRdMX4Sv7apRPqmAgbnzw2v2RyTt+KTPyT1uYQTGDl/1VPtS2VwrkaOL5OoS3Slx82qPc8zYIl1JKJxySjDA8zd3NOEGnN/Ti9X5l9cOv+Pt0I4N6VZJ0M+YC8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=SQCWpY8G; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JdcjYF49; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="SQCWpY8G"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JdcjYF49" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id BB00B1140165; Mon, 25 Nov 2024 04:57:25 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Mon, 25 Nov 2024 04:57:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1732528645; x=1732615045; bh=jRAr/STAt9/ekMMxn2k48xSmPR2dlEz/fYVqmmXiYUM=; b= SQCWpY8GWnVadCqsLYmBn7CV/cY/a2hrISN2XTXGoe8cB8w5KbqRskEFqPyi3enL 1SeeFW9F0wCN6ICd34RweisAaRUfV5jQX2Rcg7PCzRCwmmF7dJbw9iIMPjeXMSHW 8HsS4XYg1B+JA2cQDwsF/zj8QW/eGZcHtLj1ZuplknVh1wVXtILrQeyrwJRvbVlI EfoShFdZqJ0uxyB+W1feoAgCQfqnjiryL4i1tUfhdvPdG8xk5gGjKBxaDBM9FwQs MVOURtm/EszEtSpmCB97Q6ADzz4KswlFV8ducgYDDb7L+1rPjiP3jAwgUHmUyKup h2ERykFNhYaFy+XA6AWakA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1732528645; x= 1732615045; bh=jRAr/STAt9/ekMMxn2k48xSmPR2dlEz/fYVqmmXiYUM=; b=J dcjYF495qQGxqBIo1SubSejgVHd0afzJ4nl8F2CbaP6++3FeJpxJFJXexZ+Exe86 0P6/gQcWkvERFMovbsAmOaKEJtBGtXFjVY8QXU3akaWTs6MCmH0MnN2c5Mn7SY+k rgPnhATWokRtj5xZ1QiIciqtJfqcnngofLFtkTcQeb0iHFz7OYWmEk5NILELPzFc 6ZhCA9h5Y9nAh3hsWE25AzGxVnmieARaEh7dUsNDT8VShQ6CcjJ6qmotVonW10Zl 04TiyUJzznV2emDjtZAUV5YbGgmbGbBnNgcKHB+kxWhSH4mKXq11NO0nn3g/bw9b AHeC+Xx7+cT8xc7Y1vz8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeehgddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthejredtredtjeen ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepffeuiedujedvkeehuedvkeefffeivdeuleetkeduheej teekgedvudfgtdfgieelnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepuddupdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegurghvvhhiugesghhmrghilhdrtghomhdprhgtph htthhopehgihhtshhtvghrsehpohgsohigrdgtohhmpdhrtghpthhtohepjheitheskhgu sghgrdhorhhgpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtth hopegthhhrihhstghoohhlsehtuhigfhgrmhhilhihrdhorhhgpdhrtghpthhtoheprhgr mhhsrgihsehrrghmshgrhihjohhnvghsrdhplhhushdrtghomhdprhgtphhtthhopehsuh hnshhhihhnvgesshhunhhshhhinhgvtghordgtohhmpdhrtghpthhtohepphhhihhllhhi phdrfihoohguuddvfeesghhmrghilhdrtghomhdprhgtphhtthhopehpvghffhesphgvfh hfrdhnvght X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Nov 2024 04:57:23 -0500 (EST) Received: by vm-mail (OpenSMTPD) with ESMTPSA id d81a6cbb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 25 Nov 2024 09:56:18 +0000 (UTC) From: Patrick Steinhardt Date: Mon, 25 Nov 2024 10:57:02 +0100 Subject: [PATCH v9 14/23] Makefile: allow "bin-wrappers/" directory to exist Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241125-pks-meson-v9-14-1c6cf242a5f1@pks.im> References: <20241125-pks-meson-v9-0-1c6cf242a5f1@pks.im> In-Reply-To: <20241125-pks-meson-v9-0-1c6cf242a5f1@pks.im> To: git@vger.kernel.org Cc: Eli Schwartz , Eric Sunshine , Phillip Wood , Junio C Hamano , Ramsay Jones , Taylor Blau , David Aguilar , Jeff King , Johannes Sixt , Christian Couder X-Mailer: b4 0.14.2 The "bin-wrappers/" directory gets created by our build system and is populated with one script for each of our binaries. There isn't anything inherently wrong with the current layout, but it is somewhat hard to adapt for out-of-tree build systems. Adapt the layout such that our "bin-wrappers/" directory always exists and contains our "wrap-for-bin.sh" script to make things a little bit easier for subsequent steps. Signed-off-by: Patrick Steinhardt --- .gitignore | 1 - Documentation/CodingGuidelines | 2 +- Makefile | 6 +++--- bin-wrappers/.gitignore | 9 +++++++++ wrap-for-bin.sh => bin-wrappers/wrap-for-bin.sh | 0 contrib/buildsystems/CMakeLists.txt | 6 +++--- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index d3be460040c6120d862a25dff1abd325b93b37fd..e82aa19df03fc865eaa0468f12b734cec0c48a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ /GIT-TEST-SUITES /GIT-USER-AGENT /GIT-VERSION-FILE -/bin-wrappers/ /git /git-add /git-am diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 87904791cbcea6e57d0fb3c7d4e27f2b0d80b95f..1df9d0c42f1ee7b16ecd7abc22d2653dbf9bae2e 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -583,7 +583,7 @@ For C programs: Run `GIT_DEBUGGER=1 ./bin-wrappers/git foo` to simply use gdb as is, or run `GIT_DEBUGGER=" " ./bin-wrappers/git foo` to use your own debugger and arguments. Example: `GIT_DEBUGGER="ddd --gdb" - ./bin-wrappers/git log` (See `wrap-for-bin.sh`.) + ./bin-wrappers/git log` (See `bin-wrappers/wrap-for-bin.sh`.) - The primary data structure that a subsystem 'S' deals with is called `struct S`. Functions that operate on `struct S` are named diff --git a/Makefile b/Makefile index 61639d17dc364acf30ffd2d317015d8db440acc1..14ee6817cf9d9d03312a9cbd93b8ee218241d3d4 100644 --- a/Makefile +++ b/Makefile @@ -3206,8 +3206,7 @@ test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $( all:: $(TEST_PROGRAMS) $(test_bindir_programs) $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG) -bin-wrappers/%: wrap-for-bin.sh - $(call mkdir_p_parent_template) +$(test_bindir_programs): bin-wrappers/%: bin-wrappers/wrap-for-bin.sh $(QUIET_GEN)sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|@BUILD_DIR@|$(shell pwd)|' \ -e 's|@PROG@|$(patsubst test-%,t/helper/test-%,$(@F))$(if $(filter-out $(BINDIR_PROGRAMS_NO_X),$(@F)),$(X),)|' < $< > $@ && \ @@ -3704,7 +3703,8 @@ clean: profile-clean coverage-clean cocciclean $(RM) $(SP_OBJ) $(RM) $(HCC) $(RM) version-def.h - $(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json + $(RM) -r $(dep_dirs) $(compdb_dir) compile_commands.json + $(RM) $(test_bindir_programs) $(RM) -r po/build/ $(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope* $(RM) -r .dist-tmp-dir .doc-tmp-dir diff --git a/bin-wrappers/.gitignore b/bin-wrappers/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..1c6c90458b758641d0311e812563b32dd4656b48 --- /dev/null +++ b/bin-wrappers/.gitignore @@ -0,0 +1,9 @@ +/git +/git-cvsserver +/git-receive-pack +/git-shell +/git-upload-archive +/git-upload-pack +/scalar +/test-fake-ssh +/test-tool diff --git a/wrap-for-bin.sh b/bin-wrappers/wrap-for-bin.sh old mode 100644 new mode 100755 similarity index 100% rename from wrap-for-bin.sh rename to bin-wrappers/wrap-for-bin.sh diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index de2c24e66b5b94e18368aba576fc11418e2aa049..259dc838b73dcda6ab98776fab61788d90754e03 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1088,20 +1088,20 @@ set(wrapper_test_scripts foreach(script ${wrapper_scripts}) - file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME) + file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME) string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}") string(REPLACE "@PROG@" "${script}${EXE_EXTENSION}" content "${content}") file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content}) endforeach() foreach(script ${wrapper_test_scripts}) - file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME) + file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME) string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}") string(REPLACE "@PROG@" "t/helper/${script}${EXE_EXTENSION}" content "${content}") file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/${script} ${content}) endforeach() -file(STRINGS ${CMAKE_SOURCE_DIR}/wrap-for-bin.sh content NEWLINE_CONSUME) +file(STRINGS ${CMAKE_SOURCE_DIR}/bin-wrappers/wrap-for-bin.sh content NEWLINE_CONSUME) string(REPLACE "@BUILD_DIR@" "${CMAKE_BINARY_DIR}" content "${content}") string(REPLACE "@PROG@" "git-cvsserver" content "${content}") file(WRITE ${CMAKE_BINARY_DIR}/bin-wrappers/git-cvsserver ${content})