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

Re: [PATCH] Makefile: read configuration earlier

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 30, 2026, 04:10 UTC
Message-ID
<xmqqh5lhm82g.fsf@gitster.g>
In-Reply-To
<20260729225944.1364947-1-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 14 quoted lines
> When building with WITH_BREAKING_CHANGES, we need that option set before
> we generate the list of binaries to build, since it affects whether
> git-whatchanged is built.  That in turn, affects whether t1517 passes,
> since it does not if we are in breaking-changes mode and git-whatchanged
> or git-pack-redundant exist.  Load the configuration settings earlier in
> the Makefile so that we properly honor this value when building.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> I noticed that Peff's patches didn't quite fix the problem for me and I
> think we need this on top to make the tests pass properly.
>
>  Makefile | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

This is a scary patch because its correctness depends on what is between lines 780-1050. It turns out that this now lets config.mak* to set quite a lot of symbols to affect the outcome:

 * PROGRAM_OBJS, BUILT_INS, TEST_BUILTIN_OBJS
 * WITH_BREAKING_CHANGES
 * SHELL_PATH
 * PERL_PATH
 * PYTHON_PATH
 * NO_RUST
 * DEBUG
 * uname_S?????
 * SPARSE_FLAGS
 * SPATCH_INCLUDE_FLAGS
Especially curious is that currently there is this bit:
	ifeq ($(uname_S),Windows)
	RUST_LIB_NAME = gitcore.lib
	else
	RUST_LIB_NAME = libgitcore.a
	endif

that comes WAY BEFORE config.mak.uname is included. If the location to include these files matter, then how could this bit have been working? I have no idea and since I have no access to Windows development box so I wouldn't know.

Show 26 quoted lines
> diff --git a/Makefile b/Makefile
> index 98e995e4be..6bfa461aeb 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -781,6 +781,10 @@ clean-perl-script:
>  clean-python-script:
>  	$(RM) $(SCRIPT_PYTHON_GEN)
>  
> +include config.mak.uname
> +-include config.mak.autogen
> +-include config.mak
> +
>  SCRIPTS = $(SCRIPT_SH_GEN) \
>  	  $(SCRIPT_PERL_GEN) \
>  	  $(SCRIPT_PYTHON_GEN) \
> @@ -1050,10 +1054,6 @@ GIT-SPATCH-DEFINES: FORCE
>  		echo "$$FLAGS" >GIT-SPATCH-DEFINES; \
>              fi
>  
> -include config.mak.uname
> --include config.mak.autogen
> --include config.mak
> -
>  ifdef DEVELOPER
>  include config.mak.dev
>  endif
Previous: brian m. carlsonNext: Jeff King
Message 14 of 16 in “Failing tests with WITH_BREAKING_CHANGES”
  1. brian m. carlsonJul 28, 2026
  2. Junio C HamanoJul 28, 2026
  3. Phillip WoodJul 28, 2026
  4. Jeff KingJul 28, 2026
  5. 0/2 fix serial tests without/with breaking-changesJeff King, Jul 28, 2026
  6. 1/2 t0014: factor out choice of deprecated commandsJeff King, Jul 28, 2026
  7. Junio C HamanoJul 28, 2026
  8. 2/2 t0014: generate deprecated command names dynamicallyJeff King, Jul 28, 2026
  9. Junio C HamanoJul 28, 2026
  10. Jeff KingJul 28, 2026
  11. brian m. carlsonJul 28, 2026
  12. Phillip WoodJul 29, 2026
  13. Makefile: read configuration earlierbrian m. carlson, Jul 29, 2026
  14. Junio C HamanoJul 30, 2026
  15. Jeff KingJul 30, 2026
  16. Jeff KingJul 30, 2026

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.