diff mbox series

[SRU,N,1/1] UBUNTU: [Packaging] Check do_lib_rust before linking Rust lib files

Message ID 20240718222433.64377-2-noah.wager@canonical.com
State New
Headers show
Series Check do_lib_rust before linking Rust lib files | expand

Commit Message

Noah Wager July 18, 2024, 10:24 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2072592

Packages with falsy do_lib_rust still try to symlink the lib-rust
package even though do_lib_rust prevents it from being generated. This
results in a bad symlink in the headers (rust -> ../linux-lib-rust). It
should check do_lib_rust before trying to link that directory.

Signed-off-by: Noah Wager <noah.wager@canonical.com>
---
 debian/rules.d/2-binary-arch.mk | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 56658a97cb14..cda3522d7b5b 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -483,11 +483,13 @@  endif
 	# Strip .so files (e.g., rust/libmacros.so) to reduce size even more
 	find $(hdrdir) -name libmacros.so -exec strip -s {} \;
 
+ifeq ($(do_lib_rust),true)
 	# Generate Rust lib files
 	install -d -m755 $(rustdir)
 	mv $(hdrdir)/rust $(rustdir)
 	# Generate symlink for Rust lib directory in headers
 	$(SHELL) $(DROOT)/scripts/link-lib-rust "$(hdrdir)" "$(indeppkg)" "$*"
+endif
 
 ifneq ($(do_full_build),false)
 	# Clean out this flavours build directory.