Skip to content

Commit

Permalink
Add support for deb build profiles env variable (#15858)
Browse files Browse the repository at this point in the history
Add support for a separate DEB_BUILD_PROFILES environment variable, to
be able to set build profiles. This may be used to specify whether
python 2 bindings/libraries should be built, or what configuration
options should be specified for a package.

This also makes it easier to append/remove build profiles from our rules
files, which will be needed for the sairedis build.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
  • Loading branch information
saiarcot895 authored Jul 20, 2023
1 parent a4787fd commit 371c3a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rules/sairedis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $(LIBSAIMETADATA_DBG)_RDEPENDS += $(LIBSAIMETADATA)
$(eval $(call add_derived_package,$(LIBSAIREDIS),$(LIBSAIMETADATA_DBG)))

ifeq ($(ENABLE_PY2_MODULES), n)
$(LIBSAIREDIS)_BUILD_ENV += DEB_BUILD_PROFILES=nopython2
$(LIBSAIREDIS)_DEB_BUILD_PROFILES += nopython2
endif

# The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list}
Expand Down
2 changes: 1 addition & 1 deletion rules/swss-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifeq ($(ENABLE_PY2_MODULES), y)
PYTHON_SWSSCOMMON = python-swsscommon_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb
$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON_SWSSCOMMON)))
else
$(LIBSWSSCOMMON)_BUILD_ENV += DEB_BUILD_PROFILES=nopython2
$(LIBSWSSCOMMON)_DEB_BUILD_PROFILES += nopython2
endif

PYTHON3_SWSSCOMMON = python3-swsscommon_$(LIBSWSSCOMMON_VERSION)_$(CONFIGURED_ARCH).deb
Expand Down
2 changes: 1 addition & 1 deletion rules/syncd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $(eval $(call add_derived_package,$(SYNCD),$(SYNCD_RPC_DBG)))
endif

ifeq ($(ENABLE_PY2_MODULES), n)
$(SYNCD)_BUILD_ENV += DEB_BUILD_PROFILES=nopython2
$(SYNCD)_DEB_BUILD_PROFILES += nopython2
endif

endif
4 changes: 2 additions & 2 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,8 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(a
if [ -f ./autogen.sh ]; then ./autogen.sh $(LOG); fi
$(SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR)
$(if $($*_DPKG_TARGET),
${$*_BUILD_ENV} DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" $(ANT_DEB_CONFIG) $(CROSS_COMPILE_FLAGS) dpkg-buildpackage -rfakeroot -b $(ANT_DEB_CROSS_OPT) -us -uc -tc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) --admindir $$mergedir $(LOG),
${$*_BUILD_ENV} DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" $(ANT_DEB_CONFIG) $(CROSS_COMPILE_FLAGS) dpkg-buildpackage -rfakeroot -b $(ANT_DEB_CROSS_OPT) -us -uc -tc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $$mergedir $(LOG)
${$*_BUILD_ENV} DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" DEB_BUILD_PROFILES="${$*_DEB_BUILD_PROFILES}" $(ANT_DEB_CONFIG) $(CROSS_COMPILE_FLAGS) dpkg-buildpackage -rfakeroot -b $(ANT_DEB_CROSS_OPT) -us -uc -tc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) --admindir $$mergedir $(LOG),
${$*_BUILD_ENV} DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" DEB_BUILD_PROFILES="${$*_DEB_BUILD_PROFILES}" $(ANT_DEB_CONFIG) $(CROSS_COMPILE_FLAGS) dpkg-buildpackage -rfakeroot -b $(ANT_DEB_CROSS_OPT) -us -uc -tc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $$mergedir $(LOG)
)
popd $(LOG_SIMPLE)
# Clean up
Expand Down

0 comments on commit 371c3a0

Please sign in to comment.