Skip to content

Commit 2056729

Browse files
committed
feat(rpm): add RPM debuginfo support on Ubuntu
1 parent 3bbfc0b commit 2056729

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

.bazelci/tests.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ default_tests: &default_tests
2929
- "//pkg/..."
3030
- "//tests/..."
3131
- "//toolchains/..."
32-
- "-//tests/rpm/..."
33-
- "-//pkg/legacy/tests/rpm/..."
34-
35-
default_tests_with_rpm: &default_tests_with_rpm
36-
test_targets:
37-
- "//pkg/..."
38-
- "//tests/..."
39-
- "//toolchains/..."
40-
# This has started to fail, even on CentOS.
41-
- "-//tests/rpm:test_golden_debuginfo_rpm_contents"
4232

4333
win_tests: &win_tests
4434
test_flags:
@@ -67,11 +57,14 @@ ubuntu2204: &ubuntu
6757
platform: ubuntu2204
6858
<<: *common
6959
<<: *default_tests
60+
shell_commands:
61+
- sudo apt-get update
62+
- sudo apt-get install -y rpm elfutils # rpmbuild, eu-strip
7063

7164
centos7: &centos
7265
platform: centos7_java11_devtoolset10
7366
<<: *common
74-
<<: *default_tests_with_rpm
67+
<<: *default_tests
7568

7669
macos: &macos
7770
platform: macos

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# Intentionally blank
2+
common --test_output=errors

pkg/rpm_pfg.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,11 @@ def _pkg_rpm_impl(ctx):
604604
if ctx.attr.architecture:
605605
preamble_pieces.append("BuildArch: " + ctx.attr.architecture)
606606

607+
# Tune debuginfo package generation if requested
608+
if ctx.attr.debuginfo:
609+
preamble_pieces.append("%{{!?_enable_debug_packages:%debug_package}}") # absent by default on Ubuntu
610+
preamble_pieces.append("%undefine _unique_debug_names") # set by default on Rocky, Ubuntu
611+
607612
preamble_file = ctx.actions.declare_file(
608613
"{}.spec.preamble".format(rpm_name),
609614
)

toolchains/rpm/rpmbuild_configure.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ DEBUGINFO_TYPE_BY_OS_RELEASE = {
6868
"almalinux": DEBUGINFO_TYPE_CENTOS,
6969
"centos": DEBUGINFO_TYPE_CENTOS,
7070
"fedora": DEBUGINFO_TYPE_FEDORA,
71+
"rocky": DEBUGINFO_TYPE_CENTOS,
72+
"ubuntu": DEBUGINFO_TYPE_CENTOS,
7173
}
7274

7375
DEBUGINFO_VALID_VALUES = [

0 commit comments

Comments
 (0)