Skip to content
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

[WIP] Use the hermetic python toolchain #20438

Closed
wants to merge 4 commits into from
Closed
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
19 changes: 0 additions & 19 deletions .bazelci/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc"
- "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc"
- "-//src/test/shell/bazel:bazel_coverage_sh_test"
# Centos7 uses python 2 by default, so these fail: https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test"
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -216,11 +211,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_determinism_test"
# https://github.com/bazelbuild/bazel/issues/17457
- "-//src/test/shell/bazel:jdeps_test"
# Macs can't find python, so these fail: https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test"
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
# Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest"
Expand Down Expand Up @@ -278,15 +268,6 @@ tasks:
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests"
# https://github.com/bazelbuild/bazel/issues/17007
- "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest"
# https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android/..."
- "-//src/tools/android/java/com/google/devtools/build/android/..."
- "-//src/test/java/com/google/devtools/build/android/dexer:AllTests"
# Macs can't find python, so these fail: https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test"
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
# Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest"
Expand Down
19 changes: 0 additions & 19 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_coverage_cc_released_test_gcc"
- "-//src/test/shell/bazel:bazel_coverage_cc_head_test_gcc"
- "-//src/test/shell/bazel:bazel_coverage_sh_test"
# Centos7 uses python 2 by default, so these fail: https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test"
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -220,11 +215,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_determinism_test"
# https://github.com/bazelbuild/bazel/issues/17457
- "-//src/test/shell/bazel:jdeps_test"
# Macs can't find python, so these fail: https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test"
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
# Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest"
Expand Down Expand Up @@ -336,15 +326,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_repository_cache_test"
- "-//src/test/shell/integration:aquery_test"
- "-//src/test/shell/integration:py_args_escaping_test"
# https://github.com/bazelbuild/bazel/issues/16521 & https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android/..."
- "-//src/tools/android/java/com/google/devtools/build/android/..."
- "-//src/test/java/com/google/devtools/build/android/dexer:AllTests"
# Macs can't find python, so these fail: https://github.com/bazelbuild/bazel/issues/18776
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test"
- "-//src/test/shell/bazel/android:android_instrumentation_test_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
# Disable recently regressed tests: https://github.com/bazelbuild/bazel/issues/20437
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CppSysrootTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcImportConfiguredTargetTest"
Expand Down
10 changes: 10 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ load("@rules_java//toolchains:default_java_toolchain.bzl", "default_java_toolcha
load("@rules_license//rules:license.bzl", "license")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name")
load("//tools/distributions:distribution_rules.bzl", "distrib_jar_filegroup")

Expand Down Expand Up @@ -302,3 +303,12 @@ default_java_toolchain(
source_version = "11",
target_version = "11",
)

# Compile the pip requirements file to be used in MODULE.bazel.
# If this changes, regenerate requirements_lock.txt:
# $ bazel run //:requirements.update
compile_pip_requirements(
name = "requirements",
requirements_in = "requirements.in",
requirements_txt = "requirements_lock.txt",
)
10 changes: 7 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bazel_dep(name = "rules_java", version = "7.3.1")
bazel_dep(name = "rules_graalvm", version = "0.10.3")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "rules_jvm_external", version = "5.2")
bazel_dep(name = "rules_python", version = "0.26.0")
bazel_dep(name = "rules_python", version = "0.27.0")
bazel_dep(name = "rules_testing", version = "0.0.4")
bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest")

Expand Down Expand Up @@ -243,13 +243,16 @@ use_repo(
# =========================================

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.8")
python.toolchain(
is_default = True,
python_version = "3.8",
)

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "bazel_pip_dev_deps",
python_version = "3.8",
requirements_lock = "//:requirements.txt",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "bazel_pip_dev_deps")

Expand Down Expand Up @@ -307,6 +310,7 @@ gvm.graalvm(
version = "20.0.2",
)
use_repo(gvm, "graalvm_toolchains")

register_toolchains("@graalvm_toolchains//:gvm")

# =========================================
Expand Down
Loading
Loading