Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion rust/private/rustc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,9 @@ def rustc_compile_action(
use_split_debuginfo = (
feature_configuration and
cc_common.is_enabled(feature_configuration = feature_configuration, feature_name = "per_object_debug_info") and
ctx.fragments.cpp.fission_active_for_current_compilation_mode()
ctx.fragments.cpp.fission_active_for_current_compilation_mode() and
# `-Zsplit-dwarf-out-dir` is only available on nightly.
toolchain.channel == "nightly"
)
if use_split_debuginfo:
rust_flags = rust_flags + [
Expand Down
31 changes: 31 additions & 0 deletions test/unit/debug_info/debug_info_analysis_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ _FISSION_COMPATIBILITY = ["@platforms//os:linux"] + select({
"//conditions:default": ["@platforms//:incompatible"],
})

# `-Zsplit-dwarf-out-dir` requires nightly. When testing split debug info,
# stable and beta should behave the same as `--fission=no` so we reuse the
# impl of `no_fission_test`.
not_nightly_fission_test = analysistest.make(
_no_fission_test_impl,
config_settings = {
"//command_line_option:fission": ["yes"],
},
)

_NOT_NIGHTLY_COMPATIBILITY = ["@platforms//os:linux"] + select({
"//rust/toolchain/channel:stable": [],
"//rust/toolchain/channel:beta": [],
"//conditions:default": ["@platforms//:incompatible"],
})

def debug_info_analysis_test_suite(name):
"""Analysis tests for debug info in cdylib and bin targets.

Expand Down Expand Up @@ -295,6 +311,11 @@ def debug_info_analysis_test_suite(name):
name = "lib_no_fission_test",
target_under_test = ":mylib",
)
not_nightly_fission_test(
name = "lib_not_nightly_fission_test",
target_under_test = ":mylib",
target_compatible_with = _NOT_NIGHTLY_COMPATIBILITY,
)

fission_test(
name = "bin_fission_test",
Expand All @@ -305,6 +326,11 @@ def debug_info_analysis_test_suite(name):
name = "bin_no_fission_test",
target_under_test = ":myrustbin",
)
not_nightly_fission_test(
name = "bin_not_nightly_fission_test",
target_under_test = ":myrustbin",
target_compatible_with = _NOT_NIGHTLY_COMPATIBILITY,
)

fission_test(
name = "test_fission_test",
Expand All @@ -315,6 +341,11 @@ def debug_info_analysis_test_suite(name):
name = "test_no_fission_test",
target_under_test = ":myrusttest",
)
not_nightly_fission_test(
name = "test_not_nightly_fission_test",
target_under_test = ":myrusttest",
target_compatible_with = _NOT_NIGHTLY_COMPATIBILITY,
)

native.test_suite(
name = name,
Expand Down
Loading