Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Add a new ``--enable-prebuilt-jit-stencils`` configure flag that forces the
build to use the existing provided JIT stencils even when the digest at the
beginning of the file does not match expectations. That allows
redistributors who prebuilt the JIT stencils on a system with a different
autoconf version to still use them even when ``pyconfig.h`` is slightly
different.
3 changes: 2 additions & 1 deletion Tools/jit/_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def build(
*,
comment: str = "",
force: bool = False,
prebuilt: bool = False,
jit_stencils: pathlib.Path,
) -> None:
"""Build jit_stencils.h in the given directory."""
Expand All @@ -250,7 +251,7 @@ def build(
if (
not force
and jit_stencils.exists()
and jit_stencils.read_text().startswith(digest)
and (prebuilt or jit_stencils.read_text().startswith(digest))
):
return
stencil_groups = ASYNCIO_RUNNER.run(self._build_stencils())
Expand Down
6 changes: 6 additions & 0 deletions Tools/jit/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
"--cflags", help="additional flags to pass to the compiler", default=""
)
parser.add_argument("--llvm-version", help="LLVM version to use")
parser.add_argument(
"--prebuilt",
action="store_true",
help="accept prebuilt stencils even if the digest does not match",
)
args = parser.parse_args()
for target in args.target:
target.debug = args.debug
Expand All @@ -55,6 +60,7 @@
target.build(
comment=comment,
force=args.force,
prebuilt=args.prebuilt,
jit_stencils=args.output_dir / f"jit_stencils-{target.triple}.h",
)
jit_stencils_h = args.output_dir / "jit_stencils.h"
Expand Down
26 changes: 26 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,19 @@ AS_VAR_IF([jit_flags],
AC_SUBST([REGEN_JIT_COMMAND])
AC_MSG_RESULT([$tier2_flags $jit_flags])

# Check for --enable-prebuilt-jit-stencils:
AC_MSG_CHECKING([for --enable-prebuilt-jit-stencils])
AC_ARG_ENABLE([prebuilt-jit-stencils],
[AS_HELP_STRING([--enable-prebuilt-jit-stencils],
[accept prebuilt JIT stencils even if the digest does not match (default is no)])],
[],
[enable_prebuilt_jit_stencils=no])
AS_VAR_IF([enable_prebuilt_jit_stencils],
[no],
[],
[AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --prebuilt"])])
AC_MSG_RESULT([$enable_prebuilt_jit_stencils])

if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
# GH-133171: This configuration builds the JIT but never actually uses it,
# which is surprising (and strictly worse than not building it at all):
Expand Down
Loading