-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Fix compile-database target #59980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compile-database target #59980
Conversation
Also fix race conditions caused by targets producing files being incorrectly marked as phony.
|
Thanks for looking into this! I'll try this with the Yggdrasil script in the morning. Could you please also add a backport-1.13 label? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .PHONY is correct. Even though (or especially because) it does produce a file, it needs to be forced to re-generate it to be updated
|
Can you change the |
with this patch added, the issue happens a lot less often, but I still experience it. |
|
@vtjnash ah, I see. OK, calling a target I note that on my MacBook Pro M1 Max, the build system takes a full 2 seconds to rebuild these compile databases which I don't even use :-/. A better fix would be to make it non-PHONY by properly tracking the dependencies; as far as as I can tell, that means tracking the content of @lgoettgens for you the much simpler fix should be to apply this patch: diff --git a/src/Makefile b/src/Makefile
index 18e9a4a639..f92cd73a10 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -259,7 +259,7 @@ endif
default: $(JULIA_BUILD_MODE) # contains either "debug" or "release"
all: debug release
-release debug: %: libjulia-internal-% libjulia-codegen-% $(BUILDDIR)/compile_commands.json
+release debug: %: libjulia-internal-% libjulia-codegen-%
$(BUILDDIR):
mkdir -p $(BUILDDIR)
diff --git a/src/flisp/Makefile b/src/flisp/Makefile
index 135859eacb..98b336fb14 100644
--- a/src/flisp/Makefile
+++ b/src/flisp/Makefile
@@ -61,9 +61,9 @@ DEBUGFLAGS_COMMON += $(FLAGS_COMMON)
default: release
-release: $(BUILDDIR)/$(EXENAME)$(EXE) $(BUILDDIR)/compile_commands.json
+release: $(BUILDDIR)/$(EXENAME)$(EXE)
-debug: $(BUILDDIR)/$(EXENAME)-debug$(EXE) $(BUILDDIR)/compile_commands.json
+debug: $(BUILDDIR)/$(EXENAME)-debug$(EXE)
$(BUILDDIR):
mkdir -p $(BUILDDIR)
diff --git a/src/support/Makefile b/src/support/Makefile
index 2b48a20bbc..3c1dba17f8 100644
--- a/src/support/Makefile
+++ b/src/support/Makefile
@@ -53,8 +53,8 @@ $(BUILDDIR)/host/Makefile:
@printf "%s\n" 'BUILDING_HOST_TOOLS=1' >> $@
@printf "%s\n" 'include $(SRCDIR)/Makefile' >> $@
-release: $(BUILDDIR)/libsupport.a $(BUILDDIR)/compile_commands.json
-debug: $(BUILDDIR)/libsupport-debug.a $(BUILDDIR)/compile_commands.json
+release: $(BUILDDIR)/libsupport.a
+debug: $(BUILDDIR)/libsupport-debug.a
$(BUILDDIR)/libsupport.a: $(OBJS) | $(BUILDIR)
rm -rf $@ |
|
updated |
|
Could someone please add a backport 1.13 label? |
Also fix race conditions caused by targets producing files being incorrectly marked as phony.
Follow up to #59476 (guess there is a price to pay for using Claude)
@lgoettgens that might help with the issues you are seeing in JuliaPackaging/Yggdrasil#12406