threads / patch / 57673

patchcontrib/scalar: fix 'all' target in Makefile

Subject: [PATCH] contrib/scalar: fix 'all' target in Makefile

## tl;dr

2 messages between Apr 6, 2022 and Apr 6, 2022. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Victoria Dye via GitGitGadget· Apr 5, 2022, 22:35 UTC · lore
From: Victoria Dye <vdye@github.com>

Add extra ':' to second 'all' target definition to allow 'scalar' to build. Without this fix, the 'all:' and 'all::' targets together cause a build failure when 'scalar' build is enabled with 'INCLUDE_SCALAR':

    Makefile:14: *** target file `all' has both : and :: entries.  Stop.
Signed-off-by: Victoria Dye <vdye@github.com>
---
    contrib/scalar: fix 'all' target in Makefile
    
    This patch fixes an issue introduced in a36b575aab (scalar Makefile: use
    "The default target of..." pattern, 2022-03-03) in which an 'all::'
    target was added without converting the existing 'all:' (single-colon)
    target into an 'all::' (double-colon) target. This causes a build error,
    but only when compiling with 'INCLUDE_SCALAR' enabled. As a result, I
    only just found it when building 'scalar' on the 'microsoft/git' fork.
    
    Although 'INCLUDE_SCALAR' isn't enabled by default, we should fix the
    build error for anyone that may intentionally build with it. If
    possible, it would be nice to have this merged before the final v2.36.0
    so that users don't run into the error in the next release.
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1205%2Fvdye%2Fbugfix%2Fscalar-all-target-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1205/vdye/bugfix/scalar-all-target-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1205
 contrib/scalar/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to contrib/scalar/Makefile +1 −1
diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile
index 5e86d78e19b..37f283f35d7 100644
--- a/contrib/scalar/Makefile
+++ b/contrib/scalar/Makefile
@@ -11,7 +11,7 @@ include ../../config.mak.uname
 TARGETS = scalar$(X) scalar.o
 GITLIBS = ../../common-main.o ../../libgit.a ../../xdiff/lib.a
 
-all: scalar$(X) ../../bin-wrappers/scalar
+all:: scalar$(X) ../../bin-wrappers/scalar
 
 $(GITLIBS):
 	$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) $(subst ../../,,$@)

base-commit: faa21c10d44184f616d391c158dcbb13b9c72ef3
-- 
gitgitgadget
Ævar Arnfjörð Bjarmason· Apr 6, 2022, 08:21 UTC · re: Victoria Dye via GitGitGadget · lore

Re: [PATCH] contrib/scalar: fix 'all' target in Makefile

On Tue, Apr 05 2022, Victoria Dye via GitGitGadget wrote:
Show 7 quoted lines
> From: Victoria Dye <vdye@github.com>
>
> Add extra ':' to second 'all' target definition to allow 'scalar' to build.
> Without this fix, the 'all:' and 'all::' targets together cause a build
> failure when 'scalar' build is enabled with 'INCLUDE_SCALAR':
>
>     Makefile:14: *** target file `all' has both : and :: entries.  Stop.
Thanks for the fix, and sorry.

I missed this because I build and install scalar locally with a patch on top[1] to integrate it into the main Makefile, so I wasn't running this part, even if I was building, testing and installing it as part of my local build.

1. https://lore.kernel.org/git/patch-1.1-86fb8d56307-20211028T185016Z-avarab@gmail.com/

← back to recent threads