Uh oh!
There was an error while loading. Please reload this page.
gh-104523: Use dynamic rule for compiling libmpdec and libexpat - #104574
gh-104523: Use dynamic rule for compiling libmpdec and libexpat#104574indygreg wants to merge 4 commits into
Conversation
Before we had a separate rule for each source/object file. We can use `$(foreach $(eval $(call ...)))` to dynamically derive rules to avoid the repetition. skip news (behavior preserving build system change)
0c12c20 to
44eda25Compareerlend-aasland
commented
May 18, 2023
cc. also @ned-deily who has opinions about the build process. |
indygreg
commented
May 18, 2023
FWIW I have a follow-up change to the module freezing code that is a net -100 lines on the diff which uses a similar approach to reduce make boilerplate and redundancy. That one more clearly demonstrates value in the general pattern than this one. But the justifications are basically the same. |
zware
commented
May 18, 2023
Is this really more portable than the pattern rule approach? It's certainly more cryptic :) In these particular cases, I'd personally like to work towards getting This looks reasonable enough to try it on the buildbots, at least. |
bedevere-bot
commented
May 18, 2023
zware
commented
May 19, 2023
The buildbot failures don't look related to this change. |
ned-deily
commented
May 19, 2023
@zware, it looks like the FreeBSD buildbot build didn't or hasn't run yet? I think this is the relevant buildrequest. |
zware
commented
May 19, 2023
That worker has apparently been down for about 4 months now, though I can't tell at a glance if the fault lies on the client or server side (@koobs?) |
erlend-aasland
commented
May 20, 2023
IMO, we should wait for 3.13 to open before landing this. |
indygreg
commented
May 20, 2023
I didn't realize we were only days away from the end of the 3.12 new features window. I guess I'm so used to Rust and its 6 week release cadence. Anyway, yes, I'm fine waiting until the 3.13 window to land more invasive build system changes. (Not like I have much choice in the matter.) |
erlend-aasland
commented
Jun 22, 2023
@indygreg: How does this fare on BSD Make? |
vstinner
commented
Sep 4, 2023
On my FreeBSD, I can no longer build Python :-( I have; |
erlend-aasland
commented
Sep 4, 2023
Could you build it on FreeBSD before this PR? |
vstinner
commented
Sep 4, 2023
Sorry. I mean: currently, on the main branch of Python (without this PR), I can no longer build Python :-( |
erlend-aasland
commented
Sep 5, 2023
Aha, so this PR does not change the status quo! I suspected that. I guess we should clarify if was want to restore BSD Make compatibility, or carry on with GNU Make only. |
vstinner
commented
Sep 5, 2023
Please fix building Python on FreeBSD before making the situation worse. |
Sadly, the maintainer of our two FreBSD decided to remove them. Right now, there is no FreeBSD CI. We should consider CirrusCI. |
vstinner
commented
Sep 5, 2023
I tested FreeBSD again, and I'm sorry, I didn't test make correctly previously.
This PR introduces these issues in Makefile: Surprise, surprise, it's the "non portable" part of this PR which introduces the issue. Like: |
vstinner
left a comment
There was a problem hiding this comment.
While it's appealing to use cool GNU make features to make the Makefile shorter, I don't think that it's worth it if in exchange we break FreeBSD support.
FreeBSD is a Tier-3 platform: https://peps.python.org/pep-0011/
Is there another command which is compatible with GNU make and bsdmake?
bedevere-bot
commented
Sep 5, 2023
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
vstinner
commented
Oct 4, 2023
@erlend-aasland: Is this change worth it if it breaks FreeBSD support? Should we just close it? |
This comment was marked as outdated.
This comment was marked as outdated.
bedevere-bot
commented
Oct 4, 2023
🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit 444a7c1 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as duplicate.
This comment was marked as duplicate.
erlend-aasland
commented
Oct 4, 2023
If it breaks FreeBSD support it is not worth it. There might be a more portable approach, though. cc. @indygreg |
vstinner
commented
Oct 4, 2023
Do you expect that FreeBSD buildbot will behave differently than my previous manual test? The PR didn't change in the meanwhile.
I'm fine with any syntax as soon as it works on all platforms supported by Python ;-) |
erlend-aasland
commented
Oct 4, 2023
Oh, I forgot you already tested this! |
vstinner
commented
Oct 4, 2023
Fail to build: |
indygreg
commented
Oct 4, 2023
via email
There’s a gmake port on FreeBSD, no? What’s wrong with requiring people to use gmake? Are there actually platforms where GNU Make isn’t trivially installable? |
vstinner
commented
Oct 5, 2023
It makes building Python on FreBSD more annoying and complicated. |
vstinner
commented
Oct 5, 2023
If someone wants to use more advanced Makefile rule, I suggest to rewrite the whole Python build system with CMake, Meson or anything else. |
This PR is stale because it has been open for 30 days with no activity. |
koobs
commented
Apr 14, 2026
unstale |
vstinner
commented
Apr 14, 2026
This change breaks support for BSD make on FreeBSD. I don't think that it's worth it, so I prefer to close it.
For libmpdec, there is a concrete plan for that: #115119. This PR is mostly about libmpdec, it only changes 6 lines about expat.
If someone disagrees, please open a discussion on discuss.python.org suggesting to drop support for BSD make and require GNU make on FreeBSD. There are also generic discussions about changing the whole Python build system, such as What do you want to see in tomorrow’s CPython build system?
If someone wants to propose a PR using Another approach would be to generate the code for |
Before we had a separate rule for each source/object file. We can use
$(foreach $(eval $(call ...)))to dynamically derive rules to avoid the repetition.I think this is sufficiently portable. If not, there are alternatives to
$(patsubst)that can be leveraged.