git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] make: delete XDIFF_LIB, add xdiff to LIB_OBJS

From
Ezekiel Newren <ezekielnewren@gmail.com>
Date
Oct 2, 2025, 18:50 UTC
Message-ID
<CAH=ZcbBQ2abBS5n=_OZ=qY_K=on9sBa_sK2HbbBzbwa41gWFQg@mail.gmail.com>
In-Reply-To
<aN6bL07N8Qz6USTf@pks.im>
On Thu, Oct 2, 2025 at 9:33 AM Patrick Steinhardt <ps@pks.im> wrote:
Show 33 quoted lines
> On Thu, Oct 02, 2025 at 06:31:33AM -0700, Junio C Hamano wrote:
> > Patrick Steinhardt <ps@pks.im> writes:
> >
> > > On Wed, Oct 01, 2025 at 06:02:27PM +0000, Ezekiel Newren via GitGitGadget wrote:
> > >> diff --git a/Makefile b/Makefile
> > >> index e8fad803be..d89ba03286 100644
> > >> --- a/Makefile
> > >> +++ b/Makefile
> > >> @@ -1397,8 +1396,7 @@ XDIFF_OBJS += xdiff/xmerge.o
> > >>  XDIFF_OBJS += xdiff/xpatience.o
> > >>  XDIFF_OBJS += xdiff/xprepare.o
> > >>  XDIFF_OBJS += xdiff/xutils.o
> > >> -.PHONY: xdiff-objs
> > >> -xdiff-objs: $(XDIFF_OBJS)
> > >
> > > The removal of the `xdiff-objs` target isn't mentioned or justified in
> > > the commit message. I personally don't mind that this target goes away,
> > > as I don't really have a use case for it anyway. But in theory it could
> > > continue to exist. So I'd either retain it, or explain why it goes away.
> > >
> > > In case it goes away, is there still a reason to have the separate
> > > XDIFF_OBJS variable? Can't we add these objects to `LIB_OBJS` directly?
> >
> > Doing it this way lets us still keep the "logical" organization to
> > tell which object is which, even though we may lose physical
> > distinction by throwing all objects in a single library archive.
>
> Well, I guess the logical organization still exists due to all the files
> living in "xdiff/" and "reftable/", respectively. So I'm not sure that's
> a definitive win.
>
> But in any case, I don't have any strong feelings here. I mostly
> wondered whether we can simplify the build infra even further.

My preference is the same as yours Patrick. In my Introduce Rust v2 series (that I dropped) I did it the way that you described. I changed how I did things because of Junio's suggestion. I think doing it Patrick's way would be more consistent because in Meson the `libgit_sources` variable includes all C files that are part of libgit. That variable includes the sources for reftable and xdiff.

snippet from meson.build:
libgit_sources = [
  ...
  'reftable/basics.c',
  'reftable/error.c',
  'reftable/block.c',
  'reftable/blocksource.c',
  'reftable/iter.c',
  'reftable/merged.c',
  'reftable/pq.c',
  'reftable/record.c',
  'reftable/stack.c',
  'reftable/system.c',
  'reftable/table.c',
  'reftable/tree.c',
  'reftable/writer.c',
  ...
  'xdiff/xdiffi.c',
  'xdiff/xemit.c',
  'xdiff/xhistogram.c',
  'xdiff/xmerge.c',
  'xdiff/xpatience.c',
  'xdiff/xprepare.c',
  'xdiff/xutils.c',
]
I will go with your preference Junio. Do you prefer your way or Patrick's way?
Previous: Patrick SteinhardtNext: Junio C Hamano
Message 7 of 23 in “Makefile update libgit.a: Include xdiff and reftable in libgit.a”
  1. 0/3 Makefile update libgit.a: Include xdiff and reftable in libgit.aEzekiel Newren via GitGitGadget, Oct 1, 2025
  2. 1/3 make: move xdiff and reftable objects before GITLIBSEzekiel Newren via GitGitGadget, Oct 1, 2025
  3. 2/3 make: delete XDIFF_LIB, add xdiff to LIB_OBJSEzekiel Newren via GitGitGadget, Oct 1, 2025
  4. Patrick SteinhardtOct 2, 2025
  5. Junio C HamanoOct 2, 2025
  6. Patrick SteinhardtOct 2, 2025
  7. Ezekiel NewrenOct 2, 2025
  8. Junio C HamanoOct 2, 2025
  9. Ezekiel NewrenOct 2, 2025
  10. Ezekiel NewrenOct 2, 2025
  11. 3/3 make: delete REFTABLE_LIB, add reftable to LIB_OBJSEzekiel Newren via GitGitGadget, Oct 1, 2025
  12. Patrick SteinhardtOct 2, 2025
  13. Junio C HamanoOct 2, 2025
  14. Ezekiel NewrenOct 2, 2025
  15. Junio C HamanoOct 1, 2025
  16. Ezekiel NewrenOct 2, 2025
  17. Junio C HamanoOct 2, 2025
  18. Ezekiel NewrenOct 2, 2025
  19. 0/2 Makefile update libgit.a: Include xdiff and reftable in libgit.aEzekiel Newren via GitGitGadget, Oct 2, 2025
  20. 1/2 make: delete XDIFF_LIB, add xdiff to LIB_OBJSEzekiel Newren via GitGitGadget, Oct 2, 2025
  21. 2/2 make: delete REFTABLE_LIB, add reftable to LIB_OBJSEzekiel Newren via GitGitGadget, Oct 2, 2025
  22. Junio C HamanoOct 3, 2025
  23. Patrick SteinhardtOct 8, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.