From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 208071FF0B6 for ; Thu, 12 Nov 2026 17:09:15 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 81092216E0; Thu, 12 Nov 2026 17:08:57 +0100 (CET) From: Shannon Sterz To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox 1/2] apt(-api-types): add dbgsym repositories per product Date: Thu, 12 Nov 2026 17:08:48 +0100 Message-ID: <20261112160849.434633-2-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112160849.434633-1-s.sterz@proxmox.com> References: <20261112160849.434633-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794499731342 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.615 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZNYBYP7K5K6P6XACEPUNENJKJBICQWWU X-Message-ID-Hash: ZNYBYP7K5K6P6XACEPUNENJKJBICQWWU X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: so they can be conveniently added and detected through each product's API instead of only adding them manually. Signed-off-by: Shannon Sterz --- proxmox-apt-api-types/src/lib.rs | 8 +++ proxmox-apt/src/repositories/standard.rs | 40 +++++++++-- proxmox-apt/tests/repositories.rs | 70 ++++++++++++++++++- .../sources.list.d.expected/dbgsym.sources | 5 ++ .../tests/sources.list.d/dbgsym.sources | 5 ++ 5 files changed, 123 insertions(+), 5 deletions(-) create mode 100644 proxmox-apt/tests/sources.list.d.expected/dbgsym.sources create mode 100644 proxmox-apt/tests/sources.list.d/dbgsym.sources diff --git a/proxmox-apt-api-types/src/lib.rs b/proxmox-apt-api-types/src/lib.rs index 00c75828..f6627efa 100644 --- a/proxmox-apt-api-types/src/lib.rs +++ b/proxmox-apt-api-types/src/lib.rs @@ -328,6 +328,8 @@ pub enum APTRepoComponent { Main, /// Internal staging repository for builds undergoing initial QA. Staging, + /// Debug symbols, useful for analyzing crashes etc. + Dbgsym, /// Forward-compat fallback for unknown wire values; stored lowercased. #[serde(untagged)] Unknown(String), @@ -345,6 +347,7 @@ impl<'de> Deserialize<'de> for APTRepoComponent { "test" => Self::Test, "main" => Self::Main, "staging" => Self::Staging, + "dbgsym" => Self::Dbgsym, _ if is_apt_open_enum_token(&lower) => Self::Unknown(lower), _ => { return Err(serde::de::Error::custom(format!( @@ -701,6 +704,7 @@ const KNOWN_COMPONENTS: &[(&str, APTRepoComponent)] = &[ ("no-subscription", APTRepoComponent::NoSubscription), ("enterprise", APTRepoComponent::Enterprise), ("staging", APTRepoComponent::Staging), + ("dbgsym", APTRepoComponent::Dbgsym), ("test", APTRepoComponent::Test), ("main", APTRepoComponent::Main), ]; @@ -771,6 +775,7 @@ impl APTRepositoryHandle { pub const ENTERPRISE: Self = Self::host(APTRepoComponent::Enterprise); pub const NO_SUBSCRIPTION: Self = Self::host(APTRepoComponent::NoSubscription); pub const TEST: Self = Self::host(APTRepoComponent::Test); + pub const DBG_SYM: Self = Self::host(APTRepoComponent::Dbgsym); pub const CEPH_SQUID_ENTERPRISE: Self = Self::standalone(APTRepoType::CephSquid, APTRepoComponent::Enterprise); pub const CEPH_SQUID_NO_SUBSCRIPTION: Self = @@ -979,6 +984,7 @@ mod tests { ("enterprise", APTRepositoryHandle::ENTERPRISE), ("no-subscription", APTRepositoryHandle::NO_SUBSCRIPTION), ("test", APTRepositoryHandle::TEST), + ("dbgsym", APTRepositoryHandle::DBG_SYM), ( "ceph-squid-enterprise", APTRepositoryHandle::CEPH_SQUID_ENTERPRISE, @@ -1324,6 +1330,7 @@ mod tests { | APTRepoComponent::Test | APTRepoComponent::Main | APTRepoComponent::Staging + | APTRepoComponent::Dbgsym | APTRepoComponent::Unknown(_) => {} } } @@ -1333,6 +1340,7 @@ mod tests { APTRepoComponent::Test, APTRepoComponent::Main, APTRepoComponent::Staging, + APTRepoComponent::Dbgsym, ] { let json = serde_json::to_string(&v).unwrap(); let back: APTRepoComponent = serde_json::from_str(&json).unwrap(); diff --git a/proxmox-apt/src/repositories/standard.rs b/proxmox-apt/src/repositories/standard.rs index f599de00..38bd31f4 100644 --- a/proxmox-apt/src/repositories/standard.rs +++ b/proxmox-apt/src/repositories/standard.rs @@ -1,5 +1,6 @@ //! Standard Proxmox APT repositories, materialized from [`HOST_PRODUCTS`] x [`CHANNELS`] -//! and [`CEPH_RELEASES`] x [`CHANNELS`] at first use. +//! [`CEPH_RELEASES`] x [`CHANNELS`], and one repository for debug symbols per [`HOST_PRODUCTS`] at +//! first use. //! //! # Adding a Ceph release //! 1. New `APTRepoType` variant + `Deserialize` arm (in api-types). @@ -166,21 +167,29 @@ struct StandardRepoEntry { suites: &'static [DebianCodename], } -/// Materialized table: host products' channels then Ceph releases' channels; order is -/// load-bearing for `standard_repositories()` (the web UI consumes it for dropdowns). +/// Materialized table: host products' channels then Ceph releases' channels then debug symbol +/// repos; order is load-bearing for `standard_repositories()` (the web UI consumes it for +/// dropdowns). static STANDARD_REPOS: LazyLock> = LazyLock::new(|| { - let total = (HOST_PRODUCTS.len() + CEPH_RELEASES.len()) * CHANNELS.len(); + // `+ HOST_PRODUCTS.len()` for one debug symbol repo per product + let total = (HOST_PRODUCTS.len() + CEPH_RELEASES.len()) * CHANNELS.len() + HOST_PRODUCTS.len(); let mut v = Vec::with_capacity(total); for hp in HOST_PRODUCTS { for c in CHANNELS { v.push(host_product_entry(hp, c)); } } + for cr in CEPH_RELEASES { for c in CHANNELS { v.push(ceph_release_entry(cr, c)); } } + + for hp in HOST_PRODUCTS { + v.push(debug_symbols_entry(hp)); + } + v }); @@ -225,6 +234,29 @@ fn host_product_entry(hp: &HostProductDef, c: &Channel) -> StandardRepoEntry { } } +fn debug_symbols_entry(hp: &HostProductDef) -> StandardRepoEntry { + StandardRepoEntry { + repo_type: hp.repo_type.clone(), + component: APTRepoComponent::Dbgsym, + offered_on_host: hp.host_product.clone(), + name: "Debug Symbols".into(), + description: "This repository contains debug symbols for packages installed through \ + other Proxmox repositories." + .into(), + package_type: APTRepositoryPackageType::Deb, + canonical_uri: format!("https://dbgsym.proxmox.com/debian/{}", hp.slug), + // debug symbols never had extra URIs + extra_detect_uris: Vec::new(), + deb_component: format!("{}-dbgsym", hp.slug), + // debug symbols never had extra components + extra_detect_components: Vec::new(), + signing_keys: STANDARD_KEYRINGS, + file_path_legacy: "/etc/apt/sources.list".to_string(), + file_path_deb822: format!("/etc/apt/sources.list.d/{}-dbgsym.sources", hp.slug), + suites: &[DebianCodename::Bookworm, DebianCodename::Trixie], + } +} + fn ceph_release_entry(cr: &CephRelease, c: &Channel) -> StandardRepoEntry { let repo_type_kebab = cr.repo_type.to_string(); StandardRepoEntry { diff --git a/proxmox-apt/tests/repositories.rs b/proxmox-apt/tests/repositories.rs index 4cc45867..626e6274 100644 --- a/proxmox-apt/tests/repositories.rs +++ b/proxmox-apt/tests/repositories.rs @@ -632,8 +632,10 @@ fn test_pdm_pmg_host_products_offer_full_channel_set() -> Result<(), Error> { APTRepositoryHandle::ENTERPRISE, APTRepositoryHandle::NO_SUBSCRIPTION, APTRepositoryHandle::TEST, + APTRepositoryHandle::DBG_SYM, ], - "{host_product:?} should offer the three host-product channels in canonical order", + "{host_product:?} should offer the three host-product channels in canonical order and a \ + debug symbol repository", ); for r in &offered { @@ -662,3 +664,69 @@ fn test_pdm_pmg_host_products_offer_full_channel_set() -> Result<(), Error> { } Ok(()) } + +/// Every host product offers a debug symbol repo on bookworm and trixie. +#[test] +fn test_dbgsym_repo_offered() -> Result<(), Error> { + use proxmox_apt::repositories::APTRepositoryHandleImpl; + use proxmox_apt_api_types::{APTRepositoryFileType, APTRepositoryOption}; + + let handle: APTRepositoryHandle = "dbgsym" + .parse() + .unwrap_or_else(|e| panic!("parsing 'dbgsym' failed: {e}")); + + for host_product in [ + HostProduct::Pve, + HostProduct::Pbs, + HostProduct::Pdm, + HostProduct::Pmg, + ] { + let slug = host_product.as_str(); + for (suite, file_type, path) in [ + ( + DebianCodename::Bookworm, + APTRepositoryFileType::List, + "/etc/apt/sources.list".to_string(), + ), + ( + DebianCodename::Trixie, + APTRepositoryFileType::Sources, + format!("/etc/apt/sources.list.d/{slug}-dbgsym.sources"), + ), + ] { + let offered = standard_repos_offered_for(&host_product, &suite); + let entry = offered + .iter() + .find(|r| r.handle == handle) + .unwrap_or_else(|| panic!("{host_product:?}/{suite} does not offer dbgsym")); + assert_eq!(entry.name, "Debug Symbols"); + assert_eq!(entry.status, None); + + let repo = handle + .to_repository(&host_product, &suite) + .unwrap_or_else(|| panic!("no dbgsym repository for {host_product:?}/{suite}")); + assert_eq!( + repo.uris, + vec![format!("https://dbgsym.proxmox.com/debian/{slug}")] + ); + assert_eq!(repo.components, vec![format!("{slug}-dbgsym")]); + assert_eq!(repo.suites, vec![suite.to_string()]); + assert_eq!(repo.file_type, file_type); + assert_eq!( + repo.options, + vec![APTRepositoryOption { + key: "Signed-By".into(), + values: vec!["/usr/share/keyrings/proxmox-archive-keyring.gpg".into()], + }], + ); + assert_eq!(handle.file_path(&host_product, &suite), Some(path)); + } + assert!( + handle + .to_repository(&host_product, &DebianCodename::Bullseye) + .is_none(), + "dbgsym must not be offered on bullseye for {host_product:?}", + ); + } + Ok(()) +} diff --git a/proxmox-apt/tests/sources.list.d.expected/dbgsym.sources b/proxmox-apt/tests/sources.list.d.expected/dbgsym.sources new file mode 100644 index 00000000..805dec3b --- /dev/null +++ b/proxmox-apt/tests/sources.list.d.expected/dbgsym.sources @@ -0,0 +1,5 @@ +Types: deb +URIs: https://dbgsym.proxmox.com/debian/pve +Suites: trixie +Components: pve-dbgsym +Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg diff --git a/proxmox-apt/tests/sources.list.d/dbgsym.sources b/proxmox-apt/tests/sources.list.d/dbgsym.sources new file mode 100644 index 00000000..805dec3b --- /dev/null +++ b/proxmox-apt/tests/sources.list.d/dbgsym.sources @@ -0,0 +1,5 @@ +Types: deb +URIs: https://dbgsym.proxmox.com/debian/pve +Suites: trixie +Components: pve-dbgsym +Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg -- 2.47.3