-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-114883: Fix Makefile dependency tree for non-jit builds #114884
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Thanks! I was working on this at the same time as you, and ended up with this: diff --git a/Makefile.pre.in b/Makefile.pre.in
index fff3d3c491..fc28d7f919 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -2643,7 +2643,10 @@ config.status: $(srcdir)/configure
Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
-Python/jit.o: regen-jit
+Python/jit.o: jit_stencils.h
+
+jit_stencils.h: $(shell find $(srcdir)/Tools/jit/*) $(srcdir)/Python/executor_cases.c.h pyconfig.h
+ @REGEN_JIT_COMMAND@
.PHONY: regen-jit
regen-jit: This seems to work correctly everywhere. It also seems a bit simpler (and it has a dependency on For my own learning, do you mind explaining why the changes in |
That works, but is pretty platform dependent: keeping
Ideally,
That's to make the dependency on
The compile command is basically just to avoid relying on an implicit recipe. I'm not certain that I got it right; I just copied it from a nearby target, but it seems to work as expected.
Location doesn't, but whether it needs to be created does :) |
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.
Thanks for the explainer!
Makefile.pre.in
Outdated
JIT_DEPS = \ | ||
$(srcdir)/Python/jit.c \ | ||
$(srcdir)/Python/executor_cases.c.h \ | ||
pyconfig.h \ | ||
$(srcdir)/Tools/jit/template.c \ |
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.
jit_stencils.h
doesn't depend on jit.c
(it's the other way around).
If there's no way to express a dependency on everything inside of Tools/jit
(recursive), maybe we can just approximate it two levels deep with something like this?
JIT_DEPS = \ | |
$(srcdir)/Python/jit.c \ | |
$(srcdir)/Python/executor_cases.c.h \ | |
pyconfig.h \ | |
$(srcdir)/Tools/jit/template.c \ | |
JIT_DEPS = \ | |
$(srcdir)/Tools/jit/*/* \ | |
$(srcdir)/Tools/jit/* \ | |
$(srcdir)/Python/executor_cases.c.h \ | |
pyconfig.h |
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.
GNU Make 4.3 (from Ubuntu 22.04) doesn't like $(srcdir)/Tools/jit/*/*
because there are no directories in Tools/jit
right now, I'm not certain that you can use multiple globs in a Makefile path name, and that's a bit more liberal than I think we ought to be here anyway.
Point taken about jit.c
, though; removed it from JIT_DEPS
, added $(srcdir)/Tools/jit/*.py
, and switched from template.c
to *.c
. If and when things get rearranged into a hierarchy, the rules should be fairly straightforward to update.
jit.c
always recompiles, even on non-JIT builds #114883