Skip to content

Commit

Permalink
Automated rollback of changelist 260074256.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

While this worked at the time. Upgrading rules_pkg to current versions requires adding rules_python to the test WORKSPACE.  This makes the complexity worse.

I'm falling back to a different solution where bazel builds in a mini-tar that is sufficient for these tests but is not tempting for users to use.

*** Original change description ***

Switch Android rules runtime deps builder to use rules_pkg for pkg_tar.

See #8857

Thoughts:
- The change to discard_graph_edges_test.sh is ridiculous. The test is flaky in CI and super brittle.
- The fact that some integration tests rely on a WORKSPACE that matches that used to build bazel is odd. I should be able to use the built version of Bazel with my own workspace, with rules_cc and rules_pkg at a different revision level. We should have an integr...

***

RELNOTES: None
PiperOrigin-RevId: 358382248
  • Loading branch information
aiuto authored and copybara-github committed Feb 19, 2021
1 parent 10b3479 commit 5a8a924
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/test/shell/integration/discard_graph_edges_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ function test_packages_cleared() {
package_count="$(extract_histogram_count "$histo_file" \
'devtools\.build\.lib\..*\.Package$')"
# A few packages aren't cleared.
[[ "$package_count" -le 25 ]] \
|| fail "package count $package_count too high. Expected <= 25"
[[ "$package_count" -le 20 ]] \
|| fail "package count $package_count too high"
glob_count="$(extract_histogram_count "$histo_file" "GlobValue$")"
[[ "$glob_count" -le 1 ]] \
|| fail "glob count $glob_count too high"
Expand Down
19 changes: 0 additions & 19 deletions src/test/shell/testenv.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ EOF
"remotejdk15_win_for_testing"
"rules_cc"
"rules_java"
"rules_pkg"
"rules_proto"
"rules_python"
)
Expand Down Expand Up @@ -537,23 +536,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
EOF
}

# TODO(https://github.com/bazelbuild/bazel/issues/8986): Build this dynamically
# from //WORKSPACE
function add_rules_pkg_to_workspace() {
cat >> "$1"<<EOF
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_pkg",
sha256 = "5bdc04987af79bd27bc5b00fe30f59a858f77ffa0bd2d8143d5b31ad8b1bd71c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/rules_pkg-0.2.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.2.0/rules_pkg-0.2.0.tar.gz",
],
)
EOF
}

function add_rules_proto_to_workspace() {
cat >> "$1"<<EOF
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
Expand All @@ -574,7 +556,6 @@ workspace(name = "$2")
EOF
add_rules_cc_to_workspace "WORKSPACE"
add_rules_java_to_workspace "WORKSPACE"
add_rules_pkg_to_workspace "WORKSPACE"
add_rules_proto_to_workspace "WORKSPACE"

maybe_setup_python_windows_workspace
Expand Down
2 changes: 1 addition & 1 deletion tools/android/runtime_deps/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# extract all Android rules and tools out of Bazel and into rules_android
# and tools_android.

load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")

filegroup(
name = "srcs",
Expand Down

0 comments on commit 5a8a924

Please sign in to comment.