public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "'Badrikesh Prusty' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: Badrikesh Prusty <badrikesh.prusty@siemens.com>
Subject: [PATCH] debianize: add support for DEBIAN_BUILD_CONFLICTS
Date: Fri, 20 Nov 2026 07:33:51 -0500	[thread overview]
Message-ID: <20261120123351.16764-1-badrikesh.prusty@siemens.com> (raw)

Allow recipes inheriting debianize (such as dpkg-raw) to specify
packages that must not be installed in the build environment by
introducing DEBIAN_BUILD_CONFLICTS.

This is useful in scenarios such as:
 - Conflicting or alternative toolchains in the build chroot causing
   compilation failures (e.g. both 'rustc' and 'rustc-web' getting
   pulled in, leading to toolchain version mismatches):
       DEBIAN_BUILD_CONFLICTS = "rustc-web"

 - Build systems (such as CMake, Meson, or Autotools) auto-detecting
   unwanted optional packages present in the chroot, altering the build
   output, or breaking build reproducibility.

When defined, this emits the 'Build-Conflicts' field into the Source
stanza of the generated debian/control file. If unset or empty, the
field is omitted to prevent empty-field.

Signed-off-by: Badrikesh Prusty <badrikesh.prusty@siemens.com>
---
 doc/user_manual.md                    | 1 +
 meta/classes-recipe/debianize.bbclass | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 199eb931..baf984bf 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1065,6 +1065,7 @@ Other (optional) customization variables include:
  - `DEBIAN_PROVIDES` - declare a virtual package to satisfy dependencies
  - `DEBIAN_REPLACES` - to replace a package with another
  - `DEBIAN_BREAKS` - Packages which break other packages
+ - `DEBIAN_BUILD_CONFLICTS` - Packages that must not be installed during the build (added to `Build-Conflicts`)
  - `DEBIAN_BUILT_USING` - Used when a binary package includes parts of other source packages, f.e: by statically linking their libraries or embedding their
     code or data during the build.
     E.x: Built-Using: <name> (= <version>)
diff --git a/meta/classes-recipe/debianize.bbclass b/meta/classes-recipe/debianize.bbclass
index e483a52d..101e79c5 100644
--- a/meta/classes-recipe/debianize.bbclass
+++ b/meta/classes-recipe/debianize.bbclass
@@ -8,6 +8,7 @@
 CHANGELOG_V ??= "${PV}"
 DPKG_ARCH ??= "any"
 DEBIAN_BUILD_DEPENDS ??= ""
+DEBIAN_BUILD_CONFLICTS ??= ""
 DEBIAN_SECTION ??= "misc"
 DEBIAN_DEPENDS ??= ""
 DEBIAN_PROVIDES ??= ""
@@ -83,6 +84,7 @@ EOF
 
 
 deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
+                                DEBIAN_BUILD_CONFLICTS \
                                 DEBIAN_SECTION \
                                 DEBIAN_DEPENDS \
                                 DEBIAN_PROVIDES \
@@ -103,6 +105,11 @@ Standards-Version: ${DEBIAN_STANDARDS_VERSION}
 Maintainer: ${MAINTAINER}
 Build-Depends: ${@ deb_list_beautify(d, 'DEBIANIZE_BUILD_DEPENDS')}
 EOF
+	# If a value has been set, add Build-Conflicts to the control file
+	if [ -n "${DEBIAN_BUILD_CONFLICTS}" ]; then
+		echo "Build-Conflicts: ${@ deb_list_beautify(d, 'DEBIAN_BUILD_CONFLICTS')}" >> \
+			${S}/debian/control
+	fi
 
 	# If a value has been set, add the value of DEBIAN_RULES_REQUIRES_ROOT to
 	# the control file.
-- 
2.39.5

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20261120123351.16764-1-badrikesh.prusty%40siemens.com.

                 reply	other threads:[~2026-11-20 12:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261120123351.16764-1-badrikesh.prusty@siemens.com \
    --to=isar-users@googlegroups.com \
    --cc=badrikesh.prusty@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox