Skip to content

Commit a6baac2

Browse files
Merge branch 'fix/148263' of https://github.com/prakashsellathurai/cpython into fix/148263
2 parents 266c2e7 + 2137295 commit a6baac2

39 files changed

+1912
-1785
lines changed

Android/android.py

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,6 @@ def setup_testbed():
393393
os.chmod(out_path, 0o755)
394394

395395

396-
# run_testbed will build the app automatically, but it's useful to have this as
397-
# a separate command to allow running the app outside of this script.
398-
def build_testbed(context):
399-
setup_sdk()
400-
setup_testbed()
401-
run(
402-
[gradlew, "--console", "plain", "packageDebug", "packageDebugAndroidTest"],
403-
cwd=TESTBED_DIR,
404-
)
405-
406-
407396
# Work around a bug involving sys.exit and TaskGroups
408397
# (https://github.com/python/cpython/issues/101515).
409398
def exit(*args):
@@ -645,6 +634,10 @@ async def gradle_task(context):
645634
task_prefix = "connected"
646635
env["ANDROID_SERIAL"] = context.connected
647636

637+
# Ensure that CROSS_BUILD_DIR is in the Gradle environment, regardless
638+
# of whether it was set by environment variable or `--cross-build-dir`.
639+
env["CROSS_BUILD_DIR"] = CROSS_BUILD_DIR
640+
648641
if context.ci_mode:
649642
context.args[0:0] = [
650643
# See _add_ci_python_opts in libregrtest/main.py.
@@ -872,6 +865,18 @@ def parse_args():
872865

873866
def add_parser(*args, **kwargs):
874867
parser = subcommands.add_parser(*args, **kwargs)
868+
parser.add_argument(
869+
"--cross-build-dir",
870+
action="store",
871+
default=os.environ.get("CROSS_BUILD_DIR"),
872+
dest="cross_build_dir",
873+
type=Path,
874+
help=(
875+
"Path to the cross-build directory "
876+
f"(default: {CROSS_BUILD_DIR}). Can also be set "
877+
"with the CROSS_BUILD_DIR environment variable."
878+
),
879+
)
875880
parser.add_argument(
876881
"-v", "--verbose", action="count", default=0,
877882
help="Show verbose output. Use twice to be even more verbose.")
@@ -884,7 +889,7 @@ def add_parser(*args, **kwargs):
884889
)
885890
configure_build = add_parser(
886891
"configure-build", help="Run `configure` for the build Python")
887-
make_build = add_parser(
892+
add_parser(
888893
"make-build", help="Run `make` for the build Python")
889894
configure_host = add_parser(
890895
"configure-host", help="Run `configure` for Android")
@@ -896,38 +901,12 @@ def add_parser(*args, **kwargs):
896901
help="Delete build directories for the selected target"
897902
)
898903

899-
add_parser("build-testbed", help="Build the testbed app")
900904
test = add_parser("test", help="Run the testbed app")
901905
package = add_parser("package", help="Make a release package")
902906
ci = add_parser("ci", help="Run build, package and test")
903907
env = add_parser("env", help="Print environment variables")
904908

905909
# Common arguments
906-
# --cross-build-dir argument
907-
for cmd in [
908-
clean,
909-
configure_build,
910-
make_build,
911-
configure_host,
912-
make_host,
913-
build,
914-
package,
915-
test,
916-
ci,
917-
]:
918-
cmd.add_argument(
919-
"--cross-build-dir",
920-
action="store",
921-
default=os.environ.get("CROSS_BUILD_DIR"),
922-
dest="cross_build_dir",
923-
type=Path,
924-
help=(
925-
"Path to the cross-build directory "
926-
f"(default: {CROSS_BUILD_DIR}). Can also be set "
927-
"with the CROSS_BUILD_DIR environment variable."
928-
),
929-
)
930-
931910
# --cache-dir option
932911
for cmd in [configure_host, build, ci]:
933912
cmd.add_argument(
@@ -1032,7 +1011,6 @@ def main():
10321011
"make-host": make_host_python,
10331012
"build": build_targets,
10341013
"clean": clean_targets,
1035-
"build-testbed": build_testbed,
10361014
"test": run_testbed,
10371015
"package": package,
10381016
"ci": ci,

Android/testbed/app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99
val ANDROID_DIR = file("../..")
1010
val PYTHON_DIR = ANDROID_DIR.parentFile!!
11-
val PYTHON_CROSS_DIR = file("$PYTHON_DIR/cross-build")
11+
val PYTHON_CROSS_DIR = file(System.getenv("CROSS_BUILD_DIR") ?: "$PYTHON_DIR/cross-build")
1212
val inSourceTree = (
1313
ANDROID_DIR.name == "Android" && file("$PYTHON_DIR/pyconfig.h.in").exists()
1414
)

Include/internal/pycore_opcode_metadata.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_optimizer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ extern PyCodeObject *_Py_uop_sym_get_probable_func_code(JitOptRef sym);
424424
extern PyObject *_Py_uop_sym_get_probable_value(JitOptRef sym);
425425
extern PyTypeObject *_Py_uop_sym_get_probable_type(JitOptRef sym);
426426
extern JitOptRef *_Py_uop_sym_set_stack_depth(JitOptContext *ctx, int stack_depth, JitOptRef *current_sp);
427-
extern uint32_t _Py_uop_sym_get_func_version(JitOptRef ref);
428-
bool _Py_uop_sym_set_func_version(JitOptContext *ctx, JitOptRef ref, uint32_t version);
429427

430428
extern void _Py_uop_abstractcontext_init(JitOptContext *ctx, _PyBloomFilter *dependencies);
431429
extern void _Py_uop_abstractcontext_fini(JitOptContext *ctx);

Include/internal/pycore_optimizer_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ typedef enum _JitSymType {
3636
JIT_SYM_NON_NULL_TAG = 3,
3737
JIT_SYM_BOTTOM_TAG = 4,
3838
JIT_SYM_TYPE_VERSION_TAG = 5,
39-
JIT_SYM_FUNC_VERSION_TAG = 6,
4039
JIT_SYM_KNOWN_CLASS_TAG = 7,
4140
JIT_SYM_KNOWN_VALUE_TAG = 8,
4241
JIT_SYM_TUPLE_TAG = 9,

0 commit comments

Comments
 (0)