{"thread":{"id":"64235","subject":"[PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a","startedAt":"2025-10-01T18:02:31Z","lastAt":"2025-10-08T07:22:49Z","messageCount":23,"participants":["Ezekiel Newren via GitGitGadget","Junio C Hamano","Patrick Steinhardt","Ezekiel Newren"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"527710","messageId":"pull.2065.git.git.1759341748.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":null,"subject":"[PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-01T18:02:25Z","receivedAt":"2025-10-01T18:02:31Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"Add xdiff and reftable to the static library libgit.a that Makefile\nproduces. Meson does not require any changes since it already includes those\nlibraries. The motivation is to simplify Rust's job of linking against the C\ncode by requiring it to only link against a single static library\n(libgit.a).\n\nThe Rust compiler only needs to know how to link against libgit.a in 2 cases\nthat I can think of:\n\n * Rust unit tests\n * Rust defining the main function\n\nOtherwise Rust can be compiled without linking, and then Makefile and Meson\ncan use Cargo's produced static lib files to build Git.\n\nNote: The flag -fPIE or -fPIC is required for Makefile to build libgit.a in\na way that Cargo can use. It has been deliberately omitted from the\nMakefile, for now, since Rust isn't part of Git (yet).\n\nEzekiel Newren (3):\n  make: move xdiff and reftable objects before GITLIBS\n  make: delete XDIFF_LIB, add xdiff to LIB_OBJS\n  make: delete REFTABLE_LIB, add reftable to LIB_OBJS\n\n Makefile | 66 +++++++++++++++++++++++---------------------------------\n 1 file changed, 27 insertions(+), 39 deletions(-)\n\n\nbase-commit: a91ca5db0318b6fda5a6721ee843f56e7e2fadfc\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2065%2Fezekielnewren%2Fmerge_xdiff_and_reftable_with_libgit-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2065/ezekielnewren/merge_xdiff_and_reftable_with_libgit-v1\nPull-Request: https://github.com/git/git/pull/2065\n-- \ngitgitgadget\n"},{"id":"527711","messageId":"fdcf5a0de86a2200da01f2bce9250398ff10f8d9.1759341748.git.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":"pull.2065.git.git.1759341748.gitgitgadget@gmail.com","subject":"[PATCH 1/3] make: move xdiff and reftable objects before GITLIBS","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-01T18:02:26Z","receivedAt":"2025-10-01T18:02:33Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"From: Ezekiel Newren <ezekielnewren@gmail.com>\n\nXDIFF_OBJS and REFTABLE_OBJS will be added to LIB_OBJS in later commits.\nMove them here so that GIT_OBJS += $(LIB_OBJS) works correctly. View\nwith --color-moved.\n\nSigned-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n---\n Makefile | 48 ++++++++++++++++++++++++------------------------\n 1 file changed, 24 insertions(+), 24 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 92fd8d86d8..e8fad803be 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1390,6 +1390,30 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o\n \n UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o\n \n+XDIFF_OBJS += xdiff/xdiffi.o\n+XDIFF_OBJS += xdiff/xemit.o\n+XDIFF_OBJS += xdiff/xhistogram.o\n+XDIFF_OBJS += xdiff/xmerge.o\n+XDIFF_OBJS += xdiff/xpatience.o\n+XDIFF_OBJS += xdiff/xprepare.o\n+XDIFF_OBJS += xdiff/xutils.o\n+.PHONY: xdiff-objs\n+xdiff-objs: $(XDIFF_OBJS)\n+\n+REFTABLE_OBJS += reftable/basics.o\n+REFTABLE_OBJS += reftable/error.o\n+REFTABLE_OBJS += reftable/block.o\n+REFTABLE_OBJS += reftable/blocksource.o\n+REFTABLE_OBJS += reftable/iter.o\n+REFTABLE_OBJS += reftable/merged.o\n+REFTABLE_OBJS += reftable/pq.o\n+REFTABLE_OBJS += reftable/record.o\n+REFTABLE_OBJS += reftable/stack.o\n+REFTABLE_OBJS += reftable/system.o\n+REFTABLE_OBJS += reftable/table.o\n+REFTABLE_OBJS += reftable/tree.o\n+REFTABLE_OBJS += reftable/writer.o\n+\n # xdiff and reftable libs may in turn depend on what is in libgit.a\n GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)\n EXTLIBS =\n@@ -2723,30 +2747,6 @@ reconfigure config.mak.autogen: config.status\n .PHONY: reconfigure # This is a convenience target.\n endif\n \n-XDIFF_OBJS += xdiff/xdiffi.o\n-XDIFF_OBJS += xdiff/xemit.o\n-XDIFF_OBJS += xdiff/xhistogram.o\n-XDIFF_OBJS += xdiff/xmerge.o\n-XDIFF_OBJS += xdiff/xpatience.o\n-XDIFF_OBJS += xdiff/xprepare.o\n-XDIFF_OBJS += xdiff/xutils.o\n-.PHONY: xdiff-objs\n-xdiff-objs: $(XDIFF_OBJS)\n-\n-REFTABLE_OBJS += reftable/basics.o\n-REFTABLE_OBJS += reftable/error.o\n-REFTABLE_OBJS += reftable/block.o\n-REFTABLE_OBJS += reftable/blocksource.o\n-REFTABLE_OBJS += reftable/iter.o\n-REFTABLE_OBJS += reftable/merged.o\n-REFTABLE_OBJS += reftable/pq.o\n-REFTABLE_OBJS += reftable/record.o\n-REFTABLE_OBJS += reftable/stack.o\n-REFTABLE_OBJS += reftable/system.o\n-REFTABLE_OBJS += reftable/table.o\n-REFTABLE_OBJS += reftable/tree.o\n-REFTABLE_OBJS += reftable/writer.o\n-\n TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n \n .PHONY: test-objs\n-- \ngitgitgadget\n\n"},{"id":"527712","messageId":"28e7fd27b632eeb681e7b9af4de2d18cd327be2a.1759341748.git.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":"pull.2065.git.git.1759341748.gitgitgadget@gmail.com","subject":"[PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-01T18:02:27Z","receivedAt":"2025-10-01T18:02:34Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"From: Ezekiel Newren <ezekielnewren@gmail.com>\n\nIn a future patch series the 'xdiff' Rust crate will be added. Delete\nthe creation of the static library file for xdiff to avoid a name\nconflict. This also moves toward the goal of Rust only needing to link\nagainst libgit.a.\n\nChanges to Meson are not required as the xdiff library is already\nincluded in Meson's libgit.a.\n\nSigned-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n---\n Makefile | 15 ++++-----------\n 1 file changed, 4 insertions(+), 11 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex e8fad803be..d89ba03286 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -918,7 +918,6 @@ export PYTHON_PATH\n TEST_SHELL_PATH = $(SHELL_PATH)\n \n LIB_FILE = libgit.a\n-XDIFF_LIB = xdiff/lib.a\n REFTABLE_LIB = reftable/libreftable.a\n \n GENERATED_H += command-list.h\n@@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o\n XDIFF_OBJS += xdiff/xpatience.o\n XDIFF_OBJS += xdiff/xprepare.o\n XDIFF_OBJS += xdiff/xutils.o\n-.PHONY: xdiff-objs\n-xdiff-objs: $(XDIFF_OBJS)\n+LIB_OBJS += $(XDIFF_OBJS)\n \n REFTABLE_OBJS += reftable/basics.o\n REFTABLE_OBJS += reftable/error.o\n@@ -1414,8 +1412,8 @@ REFTABLE_OBJS += reftable/table.o\n REFTABLE_OBJS += reftable/tree.o\n REFTABLE_OBJS += reftable/writer.o\n \n-# xdiff and reftable libs may in turn depend on what is in libgit.a\n-GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)\n+# reftable lib may in turn depend on what is in libgit.a\n+GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n EXTLIBS =\n \n GIT_USER_AGENT = git/$(GIT_VERSION)\n@@ -2767,7 +2765,6 @@ OBJECTS += $(GIT_OBJS)\n OBJECTS += $(SCALAR_OBJS)\n OBJECTS += $(PROGRAM_OBJS)\n OBJECTS += $(TEST_OBJS)\n-OBJECTS += $(XDIFF_OBJS)\n OBJECTS += $(FUZZ_OBJS)\n OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)\n OBJECTS += $(UNIT_TEST_OBJS)\n@@ -2921,9 +2918,6 @@ scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)\n $(LIB_FILE): $(LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n \n-$(XDIFF_LIB): $(XDIFF_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n-\n $(REFTABLE_LIB): $(REFTABLE_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n \n@@ -3765,7 +3759,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) git.rc git.res\n \t$(RM) $(OBJECTS)\n \t$(RM) headless-git.o\n-\t$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)\n+\t$(RM) $(LIB_FILE) $(REFTABLE_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)\n \t$(RM) $(TEST_PROGRAMS)\n \t$(RM) $(FUZZ_PROGRAMS)\n@@ -3959,7 +3953,6 @@ endif\n LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o\n LIBGIT_PUB_OBJS += libgit.a\n LIBGIT_PUB_OBJS += reftable/libreftable.a\n-LIBGIT_PUB_OBJS += xdiff/lib.a\n \n LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o\n \n-- \ngitgitgadget\n\n"},{"id":"527713","messageId":"8549f634153b1ab394a2e6630d8cc1209261a31a.1759341748.git.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":"pull.2065.git.git.1759341748.gitgitgadget@gmail.com","subject":"[PATCH 3/3] make: delete REFTABLE_LIB, add reftable to LIB_OBJS","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-01T18:02:28Z","receivedAt":"2025-10-01T18:02:35Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"From: Ezekiel Newren <ezekielnewren@gmail.com>\n\nSame idea as the previous commit except that I don't know when or if\nreftable will be turned into a Rust crate.\n\nSigned-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n---\n Makefile | 13 ++++---------\n 1 file changed, 4 insertions(+), 9 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d89ba03286..4c63045443 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -918,7 +918,6 @@ export PYTHON_PATH\n TEST_SHELL_PATH = $(SHELL_PATH)\n \n LIB_FILE = libgit.a\n-REFTABLE_LIB = reftable/libreftable.a\n \n GENERATED_H += command-list.h\n GENERATED_H += config-list.h\n@@ -1411,9 +1410,9 @@ REFTABLE_OBJS += reftable/system.o\n REFTABLE_OBJS += reftable/table.o\n REFTABLE_OBJS += reftable/tree.o\n REFTABLE_OBJS += reftable/writer.o\n+LIB_OBJS += $(REFTABLE_OBJS)\n \n-# reftable lib may in turn depend on what is in libgit.a\n-GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n+GITLIBS = common-main.o $(LIB_FILE)\n EXTLIBS =\n \n GIT_USER_AGENT = git/$(GIT_VERSION)\n@@ -2766,7 +2765,7 @@ OBJECTS += $(SCALAR_OBJS)\n OBJECTS += $(PROGRAM_OBJS)\n OBJECTS += $(TEST_OBJS)\n OBJECTS += $(FUZZ_OBJS)\n-OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)\n+OBJECTS += $(REFTABLE_TEST_OBJS)\n OBJECTS += $(UNIT_TEST_OBJS)\n OBJECTS += $(CLAR_TEST_OBJS)\n OBJECTS += $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))\n@@ -2918,9 +2917,6 @@ scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)\n $(LIB_FILE): $(LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n \n-$(REFTABLE_LIB): $(REFTABLE_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n-\n export DEFAULT_EDITOR DEFAULT_PAGER\n \n Documentation/GIT-EXCLUDED-PROGRAMS: FORCE\n@@ -3759,7 +3755,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) git.rc git.res\n \t$(RM) $(OBJECTS)\n \t$(RM) headless-git.o\n-\t$(RM) $(LIB_FILE) $(REFTABLE_LIB)\n+\t$(RM) $(LIB_FILE)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)\n \t$(RM) $(TEST_PROGRAMS)\n \t$(RM) $(FUZZ_PROGRAMS)\n@@ -3952,7 +3948,6 @@ endif\n \n LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o\n LIBGIT_PUB_OBJS += libgit.a\n-LIBGIT_PUB_OBJS += reftable/libreftable.a\n \n LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o\n \n-- \ngitgitgadget\n"},{"id":"527743","messageId":"xmqqecrmyz9j.fsf@gitster.g","threadId":"64235","inReplyTo":"pull.2065.git.git.1759341748.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-01T23:32:08Z","receivedAt":"2025-10-01T23:32:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Ezekiel Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> The Rust compiler only needs to know how to link against libgit.a in 2 cases\n> that I can think of:\n>\n>  * Rust unit tests\n>  * Rust defining the main function\n>\n> Otherwise Rust can be compiled without linking, and then Makefile and Meson\n> can use Cargo's produced static lib files to build Git.\n\nIt is a bit unclear why two (or three) are so much more hassle than\none, but OK.  Allowing both build systems to agree on the same set\nof artifacts is very much desirable, and if meson based build rolls\neverythning into a single library archive, the the other one should\ndo the same.\n\nOf course we could run \"ar\" ourselves and combine the three into a\nsingle library archive, but as an approach, what you have here is a\nperfectly fine, and more preferrable, way to achieve the goal of\nending up with a single archive file.\n\nThis topic, however, especially its first step, had caused rather\nunpleasant textual conflicts when merged to 'seen' (I didn't check\nwhich other topic was the most heavily conflicting, though).  I may\nattempt to get a clean merge again tomorrow, but due to time\npressure, tonight's 'seen' was done without these patches merged.\n\nThanks.\n"},{"id":"527752","messageId":"aN4R51_j2ieF-sjy@pks.im","threadId":"64235","inReplyTo":"28e7fd27b632eeb681e7b9af4de2d18cd327be2a.1759341748.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-02T05:47:19Z","receivedAt":"2025-10-02T05:47:26Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Oct 01, 2025 at 06:02:27PM +0000, Ezekiel Newren via GitGitGadget wrote:\n> diff --git a/Makefile b/Makefile\n> index e8fad803be..d89ba03286 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o\n>  XDIFF_OBJS += xdiff/xpatience.o\n>  XDIFF_OBJS += xdiff/xprepare.o\n>  XDIFF_OBJS += xdiff/xutils.o\n> -.PHONY: xdiff-objs\n> -xdiff-objs: $(XDIFF_OBJS)\n\nThe removal of the `xdiff-objs` target isn't mentioned or justified in\nthe commit message. I personally don't mind that this target goes away,\nas I don't really have a use case for it anyway. But in theory it could\ncontinue to exist. So I'd either retain it, or explain why it goes away.\n\nIn case it goes away, is there still a reason to have the separate\nXDIFF_OBJS variable? Can't we add these objects to `LIB_OBJS` directly?\n\nPatrick\n"},{"id":"527753","messageId":"aN4SU3lLFi2EROsF@pks.im","threadId":"64235","inReplyTo":"8549f634153b1ab394a2e6630d8cc1209261a31a.1759341748.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 3/3] make: delete REFTABLE_LIB, add reftable to LIB_OBJS","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-02T05:49:07Z","receivedAt":"2025-10-02T05:49:14Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Wed, Oct 01, 2025 at 06:02:28PM +0000, Ezekiel Newren via GitGitGadget wrote:\n> diff --git a/Makefile b/Makefile\n> index d89ba03286..4c63045443 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1411,9 +1410,9 @@ REFTABLE_OBJS += reftable/system.o\n>  REFTABLE_OBJS += reftable/table.o\n>  REFTABLE_OBJS += reftable/tree.o\n>  REFTABLE_OBJS += reftable/writer.o\n> +LIB_OBJS += $(REFTABLE_OBJS)\n>  \n> -# reftable lib may in turn depend on what is in libgit.a\n> -GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n> +GITLIBS = common-main.o $(LIB_FILE)\n>  EXTLIBS =\n>  \n>  GIT_USER_AGENT = git/$(GIT_VERSION)\n\nSame question here as on the preceding commit: do we even need\nREFTABLE_OBJS anymore?\n\nOther than that these patches look sensible to me, thanks. Even without\nRust they simplify our build infra a bit, so I think that landing them\nindependently of Rust is a good thing.\n\nThanks!\n\nPatrick\n"},{"id":"527798","messageId":"xmqq1pnlzayy.fsf@gitster.g","threadId":"64235","inReplyTo":"aN4R51_j2ieF-sjy@pks.im","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-02T13:31:33Z","receivedAt":"2025-10-02T13:31:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Wed, Oct 01, 2025 at 06:02:27PM +0000, Ezekiel Newren via GitGitGadget wrote:\n>> diff --git a/Makefile b/Makefile\n>> index e8fad803be..d89ba03286 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o\n>>  XDIFF_OBJS += xdiff/xpatience.o\n>>  XDIFF_OBJS += xdiff/xprepare.o\n>>  XDIFF_OBJS += xdiff/xutils.o\n>> -.PHONY: xdiff-objs\n>> -xdiff-objs: $(XDIFF_OBJS)\n>\n> The removal of the `xdiff-objs` target isn't mentioned or justified in\n> the commit message. I personally don't mind that this target goes away,\n> as I don't really have a use case for it anyway. But in theory it could\n> continue to exist. So I'd either retain it, or explain why it goes away.\n>\n> In case it goes away, is there still a reason to have the separate\n> XDIFF_OBJS variable? Can't we add these objects to `LIB_OBJS` directly?\n\nDoing it this way lets us still keep the \"logical\" organization to\ntell which object is which, even though we may lose physical\ndistinction by throwing all objects in a single library archive.\n\nIncidentally this would slightly reduce the patch noise and make the\nresult more merge friendly when other topics are in flight that\ntouch these (like adding a new file or two to REFTABLE_OBJS), but\nwith the movement of these lines in [1/3], that benefit is\ndiminished.\n\n"},{"id":"527799","messageId":"xmqqwm5dxwdk.fsf@gitster.g","threadId":"64235","inReplyTo":"aN4SU3lLFi2EROsF@pks.im","subject":"Re: [PATCH 3/3] make: delete REFTABLE_LIB, add reftable to LIB_OBJS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-02T13:32:07Z","receivedAt":"2025-10-02T13:32:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> On Wed, Oct 01, 2025 at 06:02:28PM +0000, Ezekiel Newren via GitGitGadget wrote:\n>> diff --git a/Makefile b/Makefile\n>> index d89ba03286..4c63045443 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -1411,9 +1410,9 @@ REFTABLE_OBJS += reftable/system.o\n>>  REFTABLE_OBJS += reftable/table.o\n>>  REFTABLE_OBJS += reftable/tree.o\n>>  REFTABLE_OBJS += reftable/writer.o\n>> +LIB_OBJS += $(REFTABLE_OBJS)\n>>  \n>> -# reftable lib may in turn depend on what is in libgit.a\n>> -GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n>> +GITLIBS = common-main.o $(LIB_FILE)\n>>  EXTLIBS =\n>>  \n>>  GIT_USER_AGENT = git/$(GIT_VERSION)\n>\n> Same question here as on the preceding commit: do we even need\n> REFTABLE_OBJS anymore?\n\nSame answer as before.\n\n> Other than that these patches look sensible to me, thanks. Even without\n> Rust they simplify our build infra a bit, so I think that landing them\n> independently of Rust is a good thing.\n\nThanks.\n"},{"id":"527805","messageId":"aN6bL07N8Qz6USTf@pks.im","threadId":"64235","inReplyTo":"xmqq1pnlzayy.fsf@gitster.g","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-02T15:33:03Z","receivedAt":"2025-10-02T15:33:09Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Thu, Oct 02, 2025 at 06:31:33AM -0700, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n> \n> > On Wed, Oct 01, 2025 at 06:02:27PM +0000, Ezekiel Newren via GitGitGadget wrote:\n> >> diff --git a/Makefile b/Makefile\n> >> index e8fad803be..d89ba03286 100644\n> >> --- a/Makefile\n> >> +++ b/Makefile\n> >> @@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o\n> >>  XDIFF_OBJS += xdiff/xpatience.o\n> >>  XDIFF_OBJS += xdiff/xprepare.o\n> >>  XDIFF_OBJS += xdiff/xutils.o\n> >> -.PHONY: xdiff-objs\n> >> -xdiff-objs: $(XDIFF_OBJS)\n> >\n> > The removal of the `xdiff-objs` target isn't mentioned or justified in\n> > the commit message. I personally don't mind that this target goes away,\n> > as I don't really have a use case for it anyway. But in theory it could\n> > continue to exist. So I'd either retain it, or explain why it goes away.\n> >\n> > In case it goes away, is there still a reason to have the separate\n> > XDIFF_OBJS variable? Can't we add these objects to `LIB_OBJS` directly?\n> \n> Doing it this way lets us still keep the \"logical\" organization to\n> tell which object is which, even though we may lose physical\n> distinction by throwing all objects in a single library archive.\n\nWell, I guess the logical organization still exists due to all the files\nliving in \"xdiff/\" and \"reftable/\", respectively. So I'm not sure that's\na definitive win.\n\nBut in any case, I don't have any strong feelings here. I mostly\nwondered whether we can simplify the build infra even further.\n\nPatrick\n"},{"id":"527825","messageId":"CAH=ZcbBQ2abBS5n=_OZ=qY_K=on9sBa_sK2HbbBzbwa41gWFQg@mail.gmail.com","threadId":"64235","inReplyTo":"aN6bL07N8Qz6USTf@pks.im","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Ezekiel Newren","fromEmail":"ezekielnewren@gmail.com","sentAt":"2025-10-02T18:50:33Z","receivedAt":"2025-10-02T18:50:48Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"On Thu, Oct 2, 2025 at 9:33 AM Patrick Steinhardt <ps@pks.im> wrote:\n> On Thu, Oct 02, 2025 at 06:31:33AM -0700, Junio C Hamano wrote:\n> > Patrick Steinhardt <ps@pks.im> writes:\n> >\n> > > On Wed, Oct 01, 2025 at 06:02:27PM +0000, Ezekiel Newren via GitGitGadget wrote:\n> > >> diff --git a/Makefile b/Makefile\n> > >> index e8fad803be..d89ba03286 100644\n> > >> --- a/Makefile\n> > >> +++ b/Makefile\n> > >> @@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o\n> > >>  XDIFF_OBJS += xdiff/xpatience.o\n> > >>  XDIFF_OBJS += xdiff/xprepare.o\n> > >>  XDIFF_OBJS += xdiff/xutils.o\n> > >> -.PHONY: xdiff-objs\n> > >> -xdiff-objs: $(XDIFF_OBJS)\n> > >\n> > > The removal of the `xdiff-objs` target isn't mentioned or justified in\n> > > the commit message. I personally don't mind that this target goes away,\n> > > as I don't really have a use case for it anyway. But in theory it could\n> > > continue to exist. So I'd either retain it, or explain why it goes away.\n> > >\n> > > In case it goes away, is there still a reason to have the separate\n> > > XDIFF_OBJS variable? Can't we add these objects to `LIB_OBJS` directly?\n> >\n> > Doing it this way lets us still keep the \"logical\" organization to\n> > tell which object is which, even though we may lose physical\n> > distinction by throwing all objects in a single library archive.\n>\n> Well, I guess the logical organization still exists due to all the files\n> living in \"xdiff/\" and \"reftable/\", respectively. So I'm not sure that's\n> a definitive win.\n>\n> But in any case, I don't have any strong feelings here. I mostly\n> wondered whether we can simplify the build infra even further.\n\nMy preference is the same as yours Patrick. In my Introduce Rust v2\nseries (that I dropped) I did it the way that you described. I changed\nhow I did things because of Junio's suggestion. I think doing it\nPatrick's way would be more consistent because in Meson the\n`libgit_sources` variable includes all C files that are part of\nlibgit. That variable includes the sources for reftable and xdiff.\n\nsnippet from meson.build:\nlibgit_sources = [\n  ...\n  'reftable/basics.c',\n  'reftable/error.c',\n  'reftable/block.c',\n  'reftable/blocksource.c',\n  'reftable/iter.c',\n  'reftable/merged.c',\n  'reftable/pq.c',\n  'reftable/record.c',\n  'reftable/stack.c',\n  'reftable/system.c',\n  'reftable/table.c',\n  'reftable/tree.c',\n  'reftable/writer.c',\n  ...\n  'xdiff/xdiffi.c',\n  'xdiff/xemit.c',\n  'xdiff/xhistogram.c',\n  'xdiff/xmerge.c',\n  'xdiff/xpatience.c',\n  'xdiff/xprepare.c',\n  'xdiff/xutils.c',\n]\n\nI will go with your preference Junio. Do you prefer your way or Patrick's way?\n"},{"id":"527826","messageId":"CAH=ZcbDJWYzgMt_fK5z_07VhBFgKW=Q7stZBLhZJZTz+Ez2-FQ@mail.gmail.com","threadId":"64235","inReplyTo":"aN4R51_j2ieF-sjy@pks.im","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Ezekiel Newren","fromEmail":"ezekielnewren@gmail.com","sentAt":"2025-10-02T18:53:30Z","receivedAt":"2025-10-02T18:53:44Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"On Wed, Oct 1, 2025 at 11:47 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Wed, Oct 01, 2025 at 06:02:27PM +0000, Ezekiel Newren via GitGitGadget wrote:\n> > diff --git a/Makefile b/Makefile\n> > index e8fad803be..d89ba03286 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o\n> >  XDIFF_OBJS += xdiff/xpatience.o\n> >  XDIFF_OBJS += xdiff/xprepare.o\n> >  XDIFF_OBJS += xdiff/xutils.o\n> > -.PHONY: xdiff-objs\n> > -xdiff-objs: $(XDIFF_OBJS)\n>\n> The removal of the `xdiff-objs` target isn't mentioned or justified in\n> the commit message. I personally don't mind that this target goes away,\n> as I don't really have a use case for it anyway. But in theory it could\n> continue to exist. So I'd either retain it, or explain why it goes away.\n\nIf I understand correctly, the PHONY target xdiff-objs is to make sure\nthat xdiff/lib.a is always built. But if it's folded into libgit.a\nthen its purpose becomes moot. I will update my commit message to make\nthis clear.\n"},{"id":"527828","messageId":"CAH=ZcbBDawtnC0GB46uh+00BbsZE3ibn-hXJq7CU26ScJ8A-1w@mail.gmail.com","threadId":"64235","inReplyTo":"aN4SU3lLFi2EROsF@pks.im","subject":"Re: [PATCH 3/3] make: delete REFTABLE_LIB, add reftable to LIB_OBJS","fromName":"Ezekiel Newren","fromEmail":"ezekielnewren@gmail.com","sentAt":"2025-10-02T18:57:31Z","receivedAt":"2025-10-02T18:57:44Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"On Wed, Oct 1, 2025 at 11:49 PM Patrick Steinhardt <ps@pks.im> wrote:\n> Other than that these patches look sensible to me, thanks. Even without\n> Rust they simplify our build infra a bit, so I think that landing them\n> independently of Rust is a good thing.\n\nI agree. I've been trying to find and fix things that don't depend on\nRust, but will need to be changed to make the adoption of Rust\nsmoother.\n\nThanks for your feedback.\n"},{"id":"527829","messageId":"xmqqy0ptuo0i.fsf@gitster.g","threadId":"64235","inReplyTo":"CAH=ZcbBQ2abBS5n=_OZ=qY_K=on9sBa_sK2HbbBzbwa41gWFQg@mail.gmail.com","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-02T19:01:01Z","receivedAt":"2025-10-02T19:01:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ezekiel Newren <ezekielnewren@gmail.com> writes:\n\n> I will go with your preference Junio. Do you prefer your way or Patrick's way?\n\nWith step [1/3] shuffling lines around, the advantage of keeping\nXDIFF_OBJS and REFTABLE_OBJS to make the result merge-friendly\ndisappeared, so I am perfectly fine to throw everything into\nLIB_OBJS.\n\nThanks.\n\n"},{"id":"527830","messageId":"CAH=ZcbCJjuKtVGmFv0xHTHt8XaAVPwh-Cjyba0jTaQMH7Dkh2Q@mail.gmail.com","threadId":"64235","inReplyTo":"xmqqecrmyz9j.fsf@gitster.g","subject":"Re: [PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Ezekiel Newren","fromEmail":"ezekielnewren@gmail.com","sentAt":"2025-10-02T19:17:04Z","receivedAt":"2025-10-02T19:17:18Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"On Wed, Oct 1, 2025 at 5:32 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Ezekiel Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > The Rust compiler only needs to know how to link against libgit.a in 2 cases\n> > that I can think of:\n> >\n> >  * Rust unit tests\n> >  * Rust defining the main function\n> >\n> > Otherwise Rust can be compiled without linking, and then Makefile and Meson\n> > can use Cargo's produced static lib files to build Git.\n>\n> It is a bit unclear why two (or three) are so much more hassle than\n> one, but OK.  Allowing both build systems to agree on the same set\n> of artifacts is very much desirable, and if meson based build rolls\n> everything into a single library archive, the the other one should\n> do the same.\n>\n> Of course we could run \"ar\" ourselves and combine the three into a\n> single library archive, but as an approach, what you have here is a\n> perfectly fine, and more preferable, way to achieve the goal of\n> ending up with a single archive file.\n\nIn order for Cargo to tell the Rust compiler how to link against the C\narchives they need to be specified in the build.rs file for each\ncrate. That would look something like this:\ntree gitcore/\ngitcore/\n├── build.rs\n├── Cargo.toml\n└── src\n    ├── do_that.rs\n    ├── do_this.rs\n    └── lib.rs\n\nWhere gitcore/build.rs would look something like this:\nfn main() {\n    ...\n    println!(\"cargo:rustc-link-search=native={}\", git_build_dir);\n    println!(\"cargo:rustc-link-lib=static=git\");\n    if let Some(built_with_makefile) = std::env::var(\"BUILT_WITH_MAKEFILE\") {\n        println!(\"cargo:rustc-link-search=native={}\",\ngit_build_dir.join(\"xdiff\"));\n        println!(\"cargo:rustc-link-lib=static=xdiff\");\n        println!(\"cargo:rustc-link-search=native={}\",\ngit_build_dir.join(\"reftable\"));\n        println!(\"cargo:rustc-link-lib=static=reftable\");\n    }\n}\n\nBut `cargo build` is invoked by a shell script by both Makefile and\nMeson, and build.rs would need to have an environment variable set.\nSomething like BUILT_WITH_MAKEFILE for only when build_rust.sh is\ninvoked by makefile and then you'd have to remember to update both\nMakefile and every build.rs if the library files produced by Makefile\nare ever changed. It seems a lot cleaner to hardcode just libgit.a and\nleave it up to the build systems to ensure that everything inside that\nstatic library contains everything that is needed.\n\n> This topic, however, especially its first step, had caused rather\n> unpleasant textual conflicts when merged to 'seen' (I didn't check\n> which other topic was the most heavily conflicting, though).  I may\n> attempt to get a clean merge again tomorrow, but due to time\n> pressure, tonight's 'seen' was done without these patches merged.\n\nI wonder if Patrick's approach would cause fewer merge conflicts. If I\nadd xdiff and reftable objects to LIB_OBJS directly then I don't need\nto bother with the move commit.\n"},{"id":"527831","messageId":"CAH=ZcbB9hZfnVUgSc00zBWzqbAYeU+UxrrbJsnymqVtM-Xw6Pw@mail.gmail.com","threadId":"64235","inReplyTo":"xmqqy0ptuo0i.fsf@gitster.g","subject":"Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Ezekiel Newren","fromEmail":"ezekielnewren@gmail.com","sentAt":"2025-10-02T19:18:12Z","receivedAt":"2025-10-02T19:18:26Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"On Thu, Oct 2, 2025 at 1:01 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Ezekiel Newren <ezekielnewren@gmail.com> writes:\n>\n> > I will go with your preference Junio. Do you prefer your way or Patrick's way?\n>\n> With step [1/3] shuffling lines around, the advantage of keeping\n> XDIFF_OBJS and REFTABLE_OBJS to make the result merge-friendly\n> disappeared, so I am perfectly fine to throw everything into\n> LIB_OBJS.\n\nSounds good. I'll do that in my next version.\n"},{"id":"527832","messageId":"xmqqtt0huidd.fsf@gitster.g","threadId":"64235","inReplyTo":"xmqqecrmyz9j.fsf@gitster.g","subject":"Re: [PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-02T21:02:54Z","receivedAt":"2025-10-02T21:02:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> This topic, however, especially its first step, had caused rather\n> unpleasant textual conflicts when merged to 'seen' (I didn't check\n> which other topic was the most heavily conflicting, though).  I may\n> attempt to get a clean merge again tomorrow, but due to time\n> pressure, tonight's 'seen' was done without these patches merged.\n\nI think I have sorted it out.  I'll push out 'seen' with this topic\nat the tip, so could you please check the resulting Makefile for any\nfunny mismerges?\n\nThanks.\n"},{"id":"527855","messageId":"CAH=ZcbCmRsJ7mksVfshEAvZOcoKiLSn9WhAQoeQXBvu_tT9daw@mail.gmail.com","threadId":"64235","inReplyTo":"xmqqtt0huidd.fsf@gitster.g","subject":"Re: [PATCH 0/3] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Ezekiel Newren","fromEmail":"ezekielnewren@gmail.com","sentAt":"2025-10-02T23:03:44Z","receivedAt":"2025-10-02T23:03:57Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"On Thu, Oct 2, 2025 at 3:02 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> > This topic, however, especially its first step, had caused rather\n> > unpleasant textual conflicts when merged to 'seen' (I didn't check\n> > which other topic was the most heavily conflicting, though).  I may\n> > attempt to get a clean merge again tomorrow, but due to time\n> > pressure, tonight's 'seen' was done without these patches merged.\n>\n> I think I have sorted it out.  I'll push out 'seen' with this topic\n> at the tip, so could you please check the resulting Makefile for any\n> funny mismerges?\n\nLooks like it merged correctly. I'd like to release a v2 where objects\nare directly added to LIB_OBJS.\n\nHere is what I ran to compare it to what I created:\n  git rev-parse next\n  a91ca5db0318b6fda5a6721ee843f56e7e2fadfc\n\n  git range-diff d30e0f3024^1..d30e0f3024^2\nnext..merge_xdiff_and_reftable_with_libgit_v1\n  1:  40d798afad ! 1:  fdcf5a0de8 make: move xdiff and reftable\nobjects before GITLIBS\n      @@ Commit message\n           with --color-moved.\n\n           Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n      -    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n        ## Makefile ##\n       @@ Makefile: CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o\n  2:  22d1910ec8 ! 2:  28e7fd27b6 make: delete XDIFF_LIB, add xdiff to LIB_OBJS\n      @@ Commit message\n           included in Meson's libgit.a.\n\n           Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n      -    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n        ## Makefile ##\n       @@ Makefile: export PYTHON_PATH\n  3:  9f1670c048 ! 3:  8549f63415 make: delete REFTABLE_LIB, add\nreftable to LIB_OBJS\n      @@ Commit message\n           reftable will be turned into a Rust crate.\n\n           Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n      -    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n        ## Makefile ##\n       @@ Makefile: export PYTHON_PATH\n"},{"id":"527857","messageId":"pull.2065.v2.git.git.1759447647.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":"pull.2065.git.git.1759341748.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-02T23:27:25Z","receivedAt":"2025-10-02T23:27:30Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"Changes in v2:\n\n * Add xdiff and reftable objects directly to LIB_OBJS.\n * Explain why xdiff-objs is removed.\n\n\nOriginal cover letter:\n======================\n\nAdd xdiff and reftable to the static library libgit.a that Makefile\nproduces. Meson does not require any changes since it already includes those\nlibraries. The motivation is to simplify Rust's job of linking against the C\ncode by requiring it to only link against a single static library\n(libgit.a).\n\nThe Rust compiler only needs to know how to link against libgit.a in 2 cases\nthat I can think of:\n\n * Rust unit tests\n * Rust defining the main function\n\nOtherwise Rust can be compiled without linking, and then Makefile and Meson\ncan use Cargo's produced static lib files to build Git.\n\nNote: The flag -fPIE or -fPIC is required for Makefile to build libgit.a in\na way that Cargo can use. It has been deliberately omitted from the\nMakefile, for now, since Rust isn't part of Git (yet).\n\nEzekiel Newren (2):\n  make: delete XDIFF_LIB, add xdiff to LIB_OBJS\n  make: delete REFTABLE_LIB, add reftable to LIB_OBJS\n\n Makefile | 62 +++++++++++++++++++++-----------------------------------\n 1 file changed, 23 insertions(+), 39 deletions(-)\n\n\nbase-commit: a91ca5db0318b6fda5a6721ee843f56e7e2fadfc\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2065%2Fezekielnewren%2Fmerge_xdiff_and_reftable_with_libgit-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2065/ezekielnewren/merge_xdiff_and_reftable_with_libgit-v2\nPull-Request: https://github.com/git/git/pull/2065\n\nRange-diff vs v1:\n\n 1:  fdcf5a0de8 < -:  ---------- make: move xdiff and reftable objects before GITLIBS\n 2:  28e7fd27b6 ! 1:  b535a456ae make: delete XDIFF_LIB, add xdiff to LIB_OBJS\n     @@ Commit message\n          Changes to Meson are not required as the xdiff library is already\n          included in Meson's libgit.a.\n      \n     +    xdiff-objs was a historical make target to allow building just the\n     +    objects in xdiff. Since it was defined in terms of XDIFF_OBJS (which\n     +    no longer exists) this convenience make target no longer makes sense.\n     +    Remove it.\n     +\n          Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n      \n       ## Makefile ##\n     @@ Makefile: export PYTHON_PATH\n       REFTABLE_LIB = reftable/libreftable.a\n       \n       GENERATED_H += command-list.h\n     -@@ Makefile: XDIFF_OBJS += xdiff/xmerge.o\n     - XDIFF_OBJS += xdiff/xpatience.o\n     - XDIFF_OBJS += xdiff/xprepare.o\n     - XDIFF_OBJS += xdiff/xutils.o\n     --.PHONY: xdiff-objs\n     --xdiff-objs: $(XDIFF_OBJS)\n     -+LIB_OBJS += $(XDIFF_OBJS)\n     +@@ Makefile: LIB_OBJS += write-or-die.o\n     + LIB_OBJS += ws.o\n     + LIB_OBJS += wt-status.o\n     + LIB_OBJS += xdiff-interface.o\n     ++LIB_OBJS += xdiff/xdiffi.o\n     ++LIB_OBJS += xdiff/xemit.o\n     ++LIB_OBJS += xdiff/xhistogram.o\n     ++LIB_OBJS += xdiff/xmerge.o\n     ++LIB_OBJS += xdiff/xpatience.o\n     ++LIB_OBJS += xdiff/xprepare.o\n     ++LIB_OBJS += xdiff/xutils.o\n       \n     - REFTABLE_OBJS += reftable/basics.o\n     - REFTABLE_OBJS += reftable/error.o\n     -@@ Makefile: REFTABLE_OBJS += reftable/table.o\n     - REFTABLE_OBJS += reftable/tree.o\n     - REFTABLE_OBJS += reftable/writer.o\n     + BUILTIN_OBJS += builtin/add.o\n     + BUILTIN_OBJS += builtin/am.o\n     +@@ Makefile: CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o\n     + \n     + UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o\n       \n      -# xdiff and reftable libs may in turn depend on what is in libgit.a\n      -GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)\n     @@ Makefile: REFTABLE_OBJS += reftable/table.o\n       EXTLIBS =\n       \n       GIT_USER_AGENT = git/$(GIT_VERSION)\n     +@@ Makefile: reconfigure config.mak.autogen: config.status\n     + .PHONY: reconfigure # This is a convenience target.\n     + endif\n     + \n     +-XDIFF_OBJS += xdiff/xdiffi.o\n     +-XDIFF_OBJS += xdiff/xemit.o\n     +-XDIFF_OBJS += xdiff/xhistogram.o\n     +-XDIFF_OBJS += xdiff/xmerge.o\n     +-XDIFF_OBJS += xdiff/xpatience.o\n     +-XDIFF_OBJS += xdiff/xprepare.o\n     +-XDIFF_OBJS += xdiff/xutils.o\n     +-.PHONY: xdiff-objs\n     +-xdiff-objs: $(XDIFF_OBJS)\n     +-\n     + REFTABLE_OBJS += reftable/basics.o\n     + REFTABLE_OBJS += reftable/error.o\n     + REFTABLE_OBJS += reftable/block.o\n      @@ Makefile: OBJECTS += $(GIT_OBJS)\n       OBJECTS += $(SCALAR_OBJS)\n       OBJECTS += $(PROGRAM_OBJS)\n 3:  8549f63415 ! 2:  9031610dc8 make: delete REFTABLE_LIB, add reftable to LIB_OBJS\n     @@ Makefile: export PYTHON_PATH\n       \n       GENERATED_H += command-list.h\n       GENERATED_H += config-list.h\n     -@@ Makefile: REFTABLE_OBJS += reftable/system.o\n     - REFTABLE_OBJS += reftable/table.o\n     - REFTABLE_OBJS += reftable/tree.o\n     - REFTABLE_OBJS += reftable/writer.o\n     -+LIB_OBJS += $(REFTABLE_OBJS)\n     +@@ Makefile: LIB_OBJS += refs/iterator.o\n     + LIB_OBJS += refs/packed-backend.o\n     + LIB_OBJS += refs/ref-cache.o\n     + LIB_OBJS += refspec.o\n     ++LIB_OBJS += reftable/basics.o\n     ++LIB_OBJS += reftable/error.o\n     ++LIB_OBJS += reftable/block.o\n     ++LIB_OBJS += reftable/blocksource.o\n     ++LIB_OBJS += reftable/iter.o\n     ++LIB_OBJS += reftable/merged.o\n     ++LIB_OBJS += reftable/pq.o\n     ++LIB_OBJS += reftable/record.o\n     ++LIB_OBJS += reftable/stack.o\n     ++LIB_OBJS += reftable/system.o\n     ++LIB_OBJS += reftable/table.o\n     ++LIB_OBJS += reftable/tree.o\n     ++LIB_OBJS += reftable/writer.o\n     + LIB_OBJS += remote.o\n     + LIB_OBJS += replace-object.o\n     + LIB_OBJS += repo-settings.o\n     +@@ Makefile: CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o\n     + \n     + UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o\n       \n      -# reftable lib may in turn depend on what is in libgit.a\n      -GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n     @@ Makefile: REFTABLE_OBJS += reftable/system.o\n       EXTLIBS =\n       \n       GIT_USER_AGENT = git/$(GIT_VERSION)\n     +@@ Makefile: reconfigure config.mak.autogen: config.status\n     + .PHONY: reconfigure # This is a convenience target.\n     + endif\n     + \n     +-REFTABLE_OBJS += reftable/basics.o\n     +-REFTABLE_OBJS += reftable/error.o\n     +-REFTABLE_OBJS += reftable/block.o\n     +-REFTABLE_OBJS += reftable/blocksource.o\n     +-REFTABLE_OBJS += reftable/iter.o\n     +-REFTABLE_OBJS += reftable/merged.o\n     +-REFTABLE_OBJS += reftable/pq.o\n     +-REFTABLE_OBJS += reftable/record.o\n     +-REFTABLE_OBJS += reftable/stack.o\n     +-REFTABLE_OBJS += reftable/system.o\n     +-REFTABLE_OBJS += reftable/table.o\n     +-REFTABLE_OBJS += reftable/tree.o\n     +-REFTABLE_OBJS += reftable/writer.o\n     +-\n     + TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n     + \n     + .PHONY: test-objs\n      @@ Makefile: OBJECTS += $(SCALAR_OBJS)\n       OBJECTS += $(PROGRAM_OBJS)\n       OBJECTS += $(TEST_OBJS)\n\n-- \ngitgitgadget\n"},{"id":"527858","messageId":"b535a456ae7e02c518de2637381ee6c6efc7da48.1759447647.git.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":"pull.2065.v2.git.git.1759447647.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] make: delete XDIFF_LIB, add xdiff to LIB_OBJS","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-02T23:27:26Z","receivedAt":"2025-10-02T23:27:33Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"From: Ezekiel Newren <ezekielnewren@gmail.com>\n\nIn a future patch series the 'xdiff' Rust crate will be added. Delete\nthe creation of the static library file for xdiff to avoid a name\nconflict. This also moves toward the goal of Rust only needing to link\nagainst libgit.a.\n\nChanges to Meson are not required as the xdiff library is already\nincluded in Meson's libgit.a.\n\nxdiff-objs was a historical make target to allow building just the\nobjects in xdiff. Since it was defined in terms of XDIFF_OBJS (which\nno longer exists) this convenience make target no longer makes sense.\nRemove it.\n\nSigned-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n---\n Makefile | 29 ++++++++++-------------------\n 1 file changed, 10 insertions(+), 19 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 92fd8d86d8..d37edd3d03 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -918,7 +918,6 @@ export PYTHON_PATH\n TEST_SHELL_PATH = $(SHELL_PATH)\n \n LIB_FILE = libgit.a\n-XDIFF_LIB = xdiff/lib.a\n REFTABLE_LIB = reftable/libreftable.a\n \n GENERATED_H += command-list.h\n@@ -1209,6 +1208,13 @@ LIB_OBJS += write-or-die.o\n LIB_OBJS += ws.o\n LIB_OBJS += wt-status.o\n LIB_OBJS += xdiff-interface.o\n+LIB_OBJS += xdiff/xdiffi.o\n+LIB_OBJS += xdiff/xemit.o\n+LIB_OBJS += xdiff/xhistogram.o\n+LIB_OBJS += xdiff/xmerge.o\n+LIB_OBJS += xdiff/xpatience.o\n+LIB_OBJS += xdiff/xprepare.o\n+LIB_OBJS += xdiff/xutils.o\n \n BUILTIN_OBJS += builtin/add.o\n BUILTIN_OBJS += builtin/am.o\n@@ -1390,8 +1396,8 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o\n \n UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o\n \n-# xdiff and reftable libs may in turn depend on what is in libgit.a\n-GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(LIB_FILE)\n+# reftable lib may in turn depend on what is in libgit.a\n+GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n EXTLIBS =\n \n GIT_USER_AGENT = git/$(GIT_VERSION)\n@@ -2723,16 +2729,6 @@ reconfigure config.mak.autogen: config.status\n .PHONY: reconfigure # This is a convenience target.\n endif\n \n-XDIFF_OBJS += xdiff/xdiffi.o\n-XDIFF_OBJS += xdiff/xemit.o\n-XDIFF_OBJS += xdiff/xhistogram.o\n-XDIFF_OBJS += xdiff/xmerge.o\n-XDIFF_OBJS += xdiff/xpatience.o\n-XDIFF_OBJS += xdiff/xprepare.o\n-XDIFF_OBJS += xdiff/xutils.o\n-.PHONY: xdiff-objs\n-xdiff-objs: $(XDIFF_OBJS)\n-\n REFTABLE_OBJS += reftable/basics.o\n REFTABLE_OBJS += reftable/error.o\n REFTABLE_OBJS += reftable/block.o\n@@ -2767,7 +2763,6 @@ OBJECTS += $(GIT_OBJS)\n OBJECTS += $(SCALAR_OBJS)\n OBJECTS += $(PROGRAM_OBJS)\n OBJECTS += $(TEST_OBJS)\n-OBJECTS += $(XDIFF_OBJS)\n OBJECTS += $(FUZZ_OBJS)\n OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)\n OBJECTS += $(UNIT_TEST_OBJS)\n@@ -2921,9 +2916,6 @@ scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)\n $(LIB_FILE): $(LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n \n-$(XDIFF_LIB): $(XDIFF_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n-\n $(REFTABLE_LIB): $(REFTABLE_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n \n@@ -3765,7 +3757,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) git.rc git.res\n \t$(RM) $(OBJECTS)\n \t$(RM) headless-git.o\n-\t$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)\n+\t$(RM) $(LIB_FILE) $(REFTABLE_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)\n \t$(RM) $(TEST_PROGRAMS)\n \t$(RM) $(FUZZ_PROGRAMS)\n@@ -3959,7 +3951,6 @@ endif\n LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o\n LIBGIT_PUB_OBJS += libgit.a\n LIBGIT_PUB_OBJS += reftable/libreftable.a\n-LIBGIT_PUB_OBJS += xdiff/lib.a\n \n LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o\n \n-- \ngitgitgadget\n\n"},{"id":"527859","messageId":"9031610dc82f8598375534e2c04580af3bad8cca.1759447647.git.gitgitgadget@gmail.com","threadId":"64235","inReplyTo":"pull.2065.v2.git.git.1759447647.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] make: delete REFTABLE_LIB, add reftable to LIB_OBJS","fromName":"Ezekiel Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-10-02T23:27:27Z","receivedAt":"2025-10-02T23:27:34Z","isPatch":true,"sender":{"key":"ezekielnewren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/18313324?v=4"},"body":"From: Ezekiel Newren <ezekielnewren@gmail.com>\n\nSame idea as the previous commit except that I don't know when or if\nreftable will be turned into a Rust crate.\n\nSigned-off-by: Ezekiel Newren <ezekielnewren@gmail.com>\n---\n Makefile | 39 ++++++++++++++++-----------------------\n 1 file changed, 16 insertions(+), 23 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d37edd3d03..6464ded3a3 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -918,7 +918,6 @@ export PYTHON_PATH\n TEST_SHELL_PATH = $(SHELL_PATH)\n \n LIB_FILE = libgit.a\n-REFTABLE_LIB = reftable/libreftable.a\n \n GENERATED_H += command-list.h\n GENERATED_H += config-list.h\n@@ -1136,6 +1135,19 @@ LIB_OBJS += refs/iterator.o\n LIB_OBJS += refs/packed-backend.o\n LIB_OBJS += refs/ref-cache.o\n LIB_OBJS += refspec.o\n+LIB_OBJS += reftable/basics.o\n+LIB_OBJS += reftable/error.o\n+LIB_OBJS += reftable/block.o\n+LIB_OBJS += reftable/blocksource.o\n+LIB_OBJS += reftable/iter.o\n+LIB_OBJS += reftable/merged.o\n+LIB_OBJS += reftable/pq.o\n+LIB_OBJS += reftable/record.o\n+LIB_OBJS += reftable/stack.o\n+LIB_OBJS += reftable/system.o\n+LIB_OBJS += reftable/table.o\n+LIB_OBJS += reftable/tree.o\n+LIB_OBJS += reftable/writer.o\n LIB_OBJS += remote.o\n LIB_OBJS += replace-object.o\n LIB_OBJS += repo-settings.o\n@@ -1396,8 +1408,7 @@ CLAR_TEST_OBJS += $(UNIT_TEST_DIR)/unit-test.o\n \n UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o\n \n-# reftable lib may in turn depend on what is in libgit.a\n-GITLIBS = common-main.o $(LIB_FILE) $(REFTABLE_LIB) $(LIB_FILE)\n+GITLIBS = common-main.o $(LIB_FILE)\n EXTLIBS =\n \n GIT_USER_AGENT = git/$(GIT_VERSION)\n@@ -2729,20 +2740,6 @@ reconfigure config.mak.autogen: config.status\n .PHONY: reconfigure # This is a convenience target.\n endif\n \n-REFTABLE_OBJS += reftable/basics.o\n-REFTABLE_OBJS += reftable/error.o\n-REFTABLE_OBJS += reftable/block.o\n-REFTABLE_OBJS += reftable/blocksource.o\n-REFTABLE_OBJS += reftable/iter.o\n-REFTABLE_OBJS += reftable/merged.o\n-REFTABLE_OBJS += reftable/pq.o\n-REFTABLE_OBJS += reftable/record.o\n-REFTABLE_OBJS += reftable/stack.o\n-REFTABLE_OBJS += reftable/system.o\n-REFTABLE_OBJS += reftable/table.o\n-REFTABLE_OBJS += reftable/tree.o\n-REFTABLE_OBJS += reftable/writer.o\n-\n TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))\n \n .PHONY: test-objs\n@@ -2764,7 +2761,7 @@ OBJECTS += $(SCALAR_OBJS)\n OBJECTS += $(PROGRAM_OBJS)\n OBJECTS += $(TEST_OBJS)\n OBJECTS += $(FUZZ_OBJS)\n-OBJECTS += $(REFTABLE_OBJS) $(REFTABLE_TEST_OBJS)\n+OBJECTS += $(REFTABLE_TEST_OBJS)\n OBJECTS += $(UNIT_TEST_OBJS)\n OBJECTS += $(CLAR_TEST_OBJS)\n OBJECTS += $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))\n@@ -2916,9 +2913,6 @@ scalar$X: scalar.o GIT-LDFLAGS $(GITLIBS)\n $(LIB_FILE): $(LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n \n-$(REFTABLE_LIB): $(REFTABLE_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^\n-\n export DEFAULT_EDITOR DEFAULT_PAGER\n \n Documentation/GIT-EXCLUDED-PROGRAMS: FORCE\n@@ -3757,7 +3751,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) git.rc git.res\n \t$(RM) $(OBJECTS)\n \t$(RM) headless-git.o\n-\t$(RM) $(LIB_FILE) $(REFTABLE_LIB)\n+\t$(RM) $(LIB_FILE)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)\n \t$(RM) $(TEST_PROGRAMS)\n \t$(RM) $(FUZZ_PROGRAMS)\n@@ -3950,7 +3944,6 @@ endif\n \n LIBGIT_PUB_OBJS += contrib/libgit-sys/public_symbol_export.o\n LIBGIT_PUB_OBJS += libgit.a\n-LIBGIT_PUB_OBJS += reftable/libreftable.a\n \n LIBGIT_PARTIAL_EXPORT = contrib/libgit-sys/partial_symbol_export.o\n \n-- \ngitgitgadget\n"},{"id":"527887","messageId":"xmqqbjmoueaq.fsf@gitster.g","threadId":"64235","inReplyTo":"pull.2065.v2.git.git.1759447647.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 0/2] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-10-03T16:43:09Z","receivedAt":"2025-10-03T16:43:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Ezekiel Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Changes in v2:\n>\n>  * Add xdiff and reftable objects directly to LIB_OBJS.\n>  * Explain why xdiff-objs is removed.\n\nBoth changes look sensible.  Will queue.  Thanks.\n"},{"id":"528217","messageId":"aOYRQoDx599G19t1@pks.im","threadId":"64235","inReplyTo":"xmqqbjmoueaq.fsf@gitster.g","subject":"Re: [PATCH v2 0/2] Makefile update libgit.a: Include xdiff and reftable in libgit.a","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-10-08T07:22:42Z","receivedAt":"2025-10-08T07:22:49Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Fri, Oct 03, 2025 at 09:43:09AM -0700, Junio C Hamano wrote:\n> \"Ezekiel Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n> \n> > Changes in v2:\n> >\n> >  * Add xdiff and reftable objects directly to LIB_OBJS.\n> >  * Explain why xdiff-objs is removed.\n> \n> Both changes look sensible.  Will queue.  Thanks.\n\nAgreed, this version looks good to me. Thanks!\n\nPatrick\n"}]}