Skip to content

Commit

Permalink
Merge branch 'release-7.1.0' into cp20557-7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyverald authored Jan 4, 2024
2 parents 4bbeded + 3194d85 commit d8529ba
Show file tree
Hide file tree
Showing 23 changed files with 177 additions and 113 deletions.
82 changes: 47 additions & 35 deletions .bazelci/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,27 @@ 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"
# https://github.com/bazelbuild/bazel/issues/18776
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
fedora39:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
build_flags:
- "--config=ci-linux"
build_targets:
- "//src:bazel"
- "//src:bazel_jdk_minimal"
- "//src/main/java/..."
include_json_profile:
- build
- test
Expand Down Expand Up @@ -85,13 +99,6 @@ tasks:
- "//tools/bash/..."
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162
- "-//src/java_tools/import_deps_checker/..."
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -152,13 +159,6 @@ tasks:
- "//tools/bash/..."
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162
- "-//src/java_tools/import_deps_checker/..."
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -206,13 +206,6 @@ tasks:
- "-//src/test/shell/bazel/apple:bazel_apple_test"
# https://github.com/bazelbuild/bazel/issues/17408
- "-//src/test/shell/bazel/apple:bazel_objc_test"
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
# https://github.com/bazelbuild/bazel/issues/17410
- "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest"
# https://github.com/bazelbuild/bazel/issues/17411
Expand All @@ -223,6 +216,17 @@ 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"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -262,10 +266,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_cc_code_coverage_test"
# MacOS does not have cgroups so it can't support hardened sandbox
- "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_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"
# https://github.com/bazelbuild/bazel/issues/16525
- "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest"
- "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest"
Expand All @@ -277,6 +277,25 @@ 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"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest"
# https://github.com/bazelbuild/bazel/issues/17411
- "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest"
# https://github.com/bazelbuild/bazel/issues/17447
- "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -404,13 +423,6 @@ tasks:
- "-//src/test/py/bazel:bazel_yanked_versions_test"
- "-//src/test/py/bazel:bzlmod_query_test"
- "-//src/test/shell/bazel:verify_workspace"
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
Expand Down
83 changes: 48 additions & 35 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,27 @@ 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"
# https://github.com/bazelbuild/bazel/issues/18776
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
fedora39:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
build_flags:
- "--config=ci-linux"
build_targets:
- "//src:bazel"
- "//src:bazel_jdk_minimal"
- "//src/main/java/..."
include_json_profile:
- build
- test
Expand Down Expand Up @@ -87,13 +101,6 @@ tasks:
- "//tools/bash/..."
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162
- "-//src/java_tools/import_deps_checker/..."
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -155,13 +162,6 @@ tasks:
- "//tools/bash/..."
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162
- "-//src/java_tools/import_deps_checker/..."
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -210,13 +210,6 @@ tasks:
- "-//src/test/shell/bazel/apple:bazel_apple_test"
# https://github.com/bazelbuild/bazel/issues/17408
- "-//src/test/shell/bazel/apple:bazel_objc_test"
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
# https://github.com/bazelbuild/bazel/issues/17410
- "-//src/test/java/com/google/devtools/build/lib/platform:SystemMemoryPressureEventTest"
# https://github.com/bazelbuild/bazel/issues/17411
Expand All @@ -227,6 +220,17 @@ 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"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -267,10 +271,6 @@ tasks:
- "-//src/test/shell/bazel:bazel_cc_code_coverage_test"
# MacOS does not have cgroups so it can't support hardened sandbox
- "-//src/test/shell/integration:bazel_hardened_sandboxed_worker_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"
# https://github.com/bazelbuild/bazel/issues/16525
- "-//src/test/java/com/google/devtools/build/lib/buildtool:KeepGoingTest"
- "-//src/test/java/com/google/devtools/build/lib/buildtool:DanglingSymlinkTest"
Expand Down Expand Up @@ -335,6 +335,26 @@ 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"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:ObjcRulesTests"
- "-//src/test/java/com/google/devtools/build/lib/rules/objc:BazelJ2ObjcLibraryTest"
- "-//src/test/java/com/google/devtools/build/lib/rules/cpp:CcToolchainTest"
- "-//src/test/shell/integration:minimal_jdk_test"
# https://github.com/bazelbuild/bazel/issues/17411
- "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:PatchApiBlackBoxTest"
# https://github.com/bazelbuild/bazel/issues/17447
- "-//src/test/java/com/google/devtools/build/lib/blackbox/tests/workspace:GitRepositoryBlackBoxTest"
include_json_profile:
- build
- test
Expand Down Expand Up @@ -468,13 +488,6 @@ tasks:
# Flaky on rbe_ubuntu2004
# https://github.com/bazelbuild/continuous-integration/issues/1631
- "-//src/test/shell/bazel:bazel_sandboxing_networking_test"
# 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:android_instrumentation_test_integration_test_with_platforms"
- "-//src/test/shell/bazel/android:aapt_integration_test"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_head_android_tools"
- "-//src/test/shell/bazel/android:aapt_integration_test_with_platforms"
include_json_profile:
- build
- test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,14 @@ static UserDefinedFlagMatch fromAttributeValueAndPrerequisites(
} else if (target.satisfies(BuildSettingProvider.REQUIRE_BUILD_SETTING_PROVIDER)) {
// build setting
BuildSettingProvider provider = target.getProvider(BuildSettingProvider.class);
Object configurationValue =
optionDetails.getOptionValue(specifiedLabel) != null
? optionDetails.getOptionValue(specifiedLabel)
: provider.getDefaultValue();

Object configurationValue;
if (optionDetails.getOptionValue(provider.getLabel()) != null) {
configurationValue = optionDetails.getOptionValue(provider.getLabel());
} else {
configurationValue = provider.getDefaultValue();
}

Object convertedSpecifiedValue;
try {
// We don't need to supply a base package or repo mapping for the conversion here,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,35 @@ public void testLabelFlag_set() throws Exception {
assertThat(b.get("value")).isEqualTo("command_line_value");
}

@Test
public void withSelectThroughAlias() throws Exception {
writeRulesBzl("flag");
scratch.file(
"test/BUILD",
"load('//test:rules.bzl', 'my_rule', 'simple_rule')",
"simple_rule(name = 'default', value = 'default_value')",
"simple_rule(name = 'command_line', value = 'command_line_value')",
"label_flag(name = 'my_label_flag', build_setting_default = ':default')",
"alias(name = 'my_label_flag_alias', actual = ':my_label_flag')",
"config_setting(",
" name = 'is_default_label',",
" flag_values = {':my_label_flag_alias': '//test:default'}",
")",
"simple_rule(name = 'selector', value = select({':is_default_label': 'valid'}))");

useConfiguration();
getConfiguredTarget("//test:selector");
assertNoEvents();

reporter.removeHandler(failFastHandler);
useConfiguration(
ImmutableMap.of(
"//test:my_label_flag", Label.parseCanonicalUnchecked("//test:command_line")));
getConfiguredTarget("//test:selector");
assertContainsEvent(
"configurable attribute \"value\" in //test:selector doesn't match this configuration");
}

@Test
public void withSelect() throws Exception {
writeRulesBzl("flag");
Expand Down
Loading

0 comments on commit d8529ba

Please sign in to comment.