GeezerVison is showing github.com — 00486: gh-148646: Add --enable-prebuilt-jit-stencils configure flag · fedora-python/cpython@942f78d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +6Lines changed: 6 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +Add a new ``--enable-prebuilt-jit-stencils`` configure flag that forces the | | 2 | +build to use the existing provided JIT stencils even when the digest at the | | 3 | +beginning of the file does not match expectations. That allows | | 4 | +redistributors who prebuilt the JIT stencils on a system with a different | | 5 | +autoconf version to still use them even when ``pyconfig.h`` is slightly | | 6 | +different. |
Collapse file Copy file name to clipboardExpand all lines: Tools/jit/_targets.py +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -205,6 +205,7 @@ def build( | 205 | 205 | *, | 206 | 206 | comment: str = "", | 207 | 207 | force: bool = False, | | 208 | + prebuilt: bool = False, | 208 | 209 | jit_stencils: pathlib.Path, | 209 | 210 | ) -> None: | 210 | 211 | """Build jit_stencils.h in the given directory.""" | @@ -218,7 +219,7 @@ def build( | 218 | 219 | if ( | 219 | 220 | not force | 220 | 221 | and jit_stencils.exists() | 221 | | - and jit_stencils.read_text().startswith(digest) | | 222 | + and (prebuilt or jit_stencils.read_text().startswith(digest)) | 222 | 223 | ): | 223 | 224 | return | 224 | 225 | stencil_groups = ASYNCIO_RUNNER.run(self._build_stencils()) | |
Collapse file Copy file name to clipboardExpand all lines: Tools/jit/build.py +6Lines changed: 6 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 42 | 42 | parser.add_argument( | 43 | 43 | "--cflags", help="additional flags to pass to the compiler", default="" | 44 | 44 | ) | | 45 | + parser.add_argument( | | 46 | + "--prebuilt", | | 47 | + action="store_true", | | 48 | + help="accept prebuilt stencils even if the digest does not match", | | 49 | + ) | 45 | 50 | args = parser.parse_args() | 46 | 51 | for target in args.target: | 47 | 52 | target.debug = args.debug | | 52 | 57 | target.build( | 53 | 58 | comment=comment, | 54 | 59 | force=args.force, | | 60 | + prebuilt=args.prebuilt, | 55 | 61 | jit_stencils=args.output_dir / f"jit_stencils-{target.triple}.h", | 56 | 62 | ) | 57 | 63 | jit_stencils_h = args.output_dir / "jit_stencils.h" | |
Collapse file Copy file name to clipboardExpand all lines: configure +26Lines changed: 26 additions & 0 deletions Collapse file Copy file name to clipboardExpand all lines: configure.ac +13Lines changed: 13 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2822,6 +2822,19 @@ AC_SUBST([REGEN_JIT_COMMAND]) | 2822 | 2822 | AC_SUBST([JIT_STENCILS_H]) | 2823 | 2823 | AC_MSG_RESULT([$tier2_flags $jit_flags]) | 2824 | 2824 |
| | 2825 | +# Check for --enable-prebuilt-jit-stencils: | | 2826 | +AC_MSG_CHECKING([for --enable-prebuilt-jit-stencils]) | | 2827 | +AC_ARG_ENABLE([prebuilt-jit-stencils], | | 2828 | + [AS_HELP_STRING([--enable-prebuilt-jit-stencils], | | 2829 | + [accept prebuilt JIT stencils even if the digest does not match (default is no)])], | | 2830 | + [], | | 2831 | + [enable_prebuilt_jit_stencils=no]) | | 2832 | +AS_VAR_IF([enable_prebuilt_jit_stencils], | | 2833 | + [no], | | 2834 | + [], | | 2835 | + [AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --prebuilt"])]) | | 2836 | +AC_MSG_RESULT([$enable_prebuilt_jit_stencils]) | | 2837 | + | 2825 | 2838 | if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then | 2826 | 2839 | # GH-133171: This configuration builds the JIT but never actually uses it, | 2827 | 2840 | # which is surprising (and strictly worse than not building it at all): | |
|