Skip to content

Commit

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

Break half of the downstream projects in Bazel CI
https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/606#a41f9dca-265e-472d-91db-69117048cb62

*** Original change description ***

Flip the flag "--incompatible_package_name_is_a_function"

https://docs.bazel.build/versions/master/skylark/backward-compatibility.html#package-name-is-a-function

Fixes #5827

RELNOTES: --incompatible_package_name_is_a_function is now enabled by default
PiperOrigin-RevId: 222532723
  • Loading branch information
meteorcloudy authored and Copybara-Service committed Nov 22, 2018
1 parent 6ee9ec7 commit 3b3b469
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion site/docs/skylark/backward-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Likewise, the magic `REPOSITORY_NAME` variable is replaced by
same flag.

* Flag: `--incompatible_package_name_is_a_function`
* Default: `true`
* Default: `false`
* Tracking issue: [#5827](https://github.com/bazelbuild/bazel/issues/5827)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable

@Option(
name = "incompatible_package_name_is_a_function",
defaultValue = "true",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.SKYLARK_SEMANTICS,
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
metadataTags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static Builder builderWithDefaults() {
.incompatibleNoSupportToolsInActionInputs(false)
.incompatibleNoTargetOutputGroup(false)
.incompatibleNoTransitiveLoads(false)
.incompatiblePackageNameIsAFunction(true)
.incompatiblePackageNameIsAFunction(false)
.incompatibleRangeType(true)
.incompatibleRemoveNativeGitRepository(true)
.incompatibleRemoveNativeHttpArchive(true)
Expand Down
14 changes: 7 additions & 7 deletions src/test/shell/bazel/bazel_proto_library_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -371,22 +371,22 @@ EOF
function test_proto_source_root() {
write_workspace ""
write_setup "proto_library" "proto_source_root = 'x/person'" ""
bazel build --noincompatible_package_name_is_a_function //x/person:person_proto > "$TEST_log" || fail "Expected success"
bazel build //x/person:person_proto > "$TEST_log" || fail "Expected success"
}

function test_proto_source_root_fails() {
write_workspace ""
# Don't specify the "proto_source_root" attribute and expect failure.
write_setup "proto_library" "" ""
bazel build --noincompatible_package_name_is_a_function //x/person:person_proto >& "$TEST_log" && fail "Expected failure"
bazel build //x/person:person_proto >& "$TEST_log" && fail "Expected failure"
expect_log "phonenumber/phonenumber.proto: File not found."
}

function test_proto_source_root_macro() {
write_workspace ""
write_macro
write_setup "proto_library_macro" "" "load('//macros:proto_library_macro.bzl', 'proto_library_macro')"
bazel build --noincompatible_package_name_is_a_function //x/person:person_proto > "$TEST_log" || fail "Expected success"
bazel build //x/person:person_proto > "$TEST_log" || fail "Expected success"
}

# Fails with "IllegalArgumentException: external/lcocal_jdk in
Expand All @@ -395,20 +395,20 @@ function DISABLED_test_proto_source_root_with_java_library() {
write_workspace ""
write_setup "proto_library" "proto_source_root = 'x/person'" ""
write_java_library
bazel build --noincompatible_package_name_is_a_function //java/com/google/src:top \
bazel build //java/com/google/src:top \
--strict_java_deps=off > "$TEST_log" || fail "Expected success"
}

function test_proto_source_root_glob() {
write_workspace ""
write_regression_setup
bazel build --noincompatible_package_name_is_a_function //proto_library/src:all >& "$TEST_log" || fail "Expected success"
bazel build //proto_library/src:all >& "$TEST_log" || fail "Expected success"
}

function test_proto_source_root_glob() {
write_workspace ""
write_regression_setup
bazel build --noincompatible_package_name_is_a_function //proto_library/src:all --strict_proto_deps=off >& "$TEST_log" \
bazel build //proto_library/src:all --strict_proto_deps=off >& "$TEST_log" \
|| fail "Expected success"
}

Expand All @@ -420,7 +420,7 @@ function DISABLED_test_proto_source_root_multiple_workspaces() {
add_local_repos_to_workspace
write_workspaces_setup

bazel build --noincompatible_package_name_is_a_function @main_repo//src:all_protos >& "$TEST_log" || fail "Expected success"
bazel build @main_repo//src:all_protos >& "$TEST_log" || fail "Expected success"
}

run_suite "Integration tests for proto_library"

0 comments on commit 3b3b469

Please sign in to comment.