feat: fail build if dependency detection returns no packages
All checks were successful
Build and Release Zed Editor / check-version (push) Successful in 4s
Build and Release Zed Editor / build-and-release (push) Has been skipped

Add error message and exit if find-deps.sh does not detect any
dependencies. This prevents building a broken package with missing
library requirements.
This commit is contained in:
2025-10-14 11:54:00 +02:00
parent 0dba8ae99a
commit ba86192bfd

View File

@@ -96,18 +96,27 @@ $(DEB_FILE): $(EXTRACT_DIR)/.extracted
@chmod +x $(FIND_DEPS_SCRIPT) @chmod +x $(FIND_DEPS_SCRIPT)
@echo "Detecting library dependencies..." @echo "Detecting library dependencies..."
@DEPS=$$($(FIND_DEPS_SCRIPT) --quiet --format makefile $(EXTRACT_DIR)/zed.app/lib); \ @DEPS=$$($(FIND_DEPS_SCRIPT) --quiet --format makefile $(EXTRACT_DIR)/zed.app/lib); \
if [ -z "$$DEPS" ]; then \
echo ""; \
echo "ERROR: Failed to detect library dependencies!"; \
echo "The dependency detection script did not return any packages."; \
echo "This may indicate a problem with:"; \
echo " - The find-deps.sh script"; \
echo " - The bundled libraries in $(EXTRACT_DIR)/zed.app/lib"; \
echo " - Missing system tools (ldd, dpkg-query, etc.)"; \
echo ""; \
echo "Please investigate and fix the issue before building."; \
echo "Run 'make list-deps' for more details."; \
echo ""; \
exit 1; \
fi; \
echo "Package: $(PACKAGE_NAME)" > $(CONTROL_DIR)/control; \ echo "Package: $(PACKAGE_NAME)" > $(CONTROL_DIR)/control; \
echo "Version: $(VERSION)" >> $(CONTROL_DIR)/control; \ echo "Version: $(VERSION)" >> $(CONTROL_DIR)/control; \
echo "Section: editors" >> $(CONTROL_DIR)/control; \ echo "Section: editors" >> $(CONTROL_DIR)/control; \
echo "Priority: optional" >> $(CONTROL_DIR)/control; \ echo "Priority: optional" >> $(CONTROL_DIR)/control; \
echo "Architecture: amd64" >> $(CONTROL_DIR)/control; \ echo "Architecture: amd64" >> $(CONTROL_DIR)/control; \
if [ -n "$$DEPS" ]; then \ echo "Depends: $$DEPS" >> $(CONTROL_DIR)/control; \
echo "Depends: $$DEPS" >> $(CONTROL_DIR)/control; \ echo " Detected dependencies: $$DEPS"; \
echo " Detected dependencies: $$DEPS"; \
else \
echo "Depends: libc6" >> $(CONTROL_DIR)/control; \
echo " Warning: Could not detect dependencies, using minimal set"; \
fi; \
echo "Maintainer: Zed Packager <packager@local>" >> $(CONTROL_DIR)/control; \ echo "Maintainer: Zed Packager <packager@local>" >> $(CONTROL_DIR)/control; \
echo "Description: Zed - A high-performance, multiplayer code editor" >> $(CONTROL_DIR)/control; \ echo "Description: Zed - A high-performance, multiplayer code editor" >> $(CONTROL_DIR)/control; \
echo " Zed is a next-generation code editor designed for" >> $(CONTROL_DIR)/control; \ echo " Zed is a next-generation code editor designed for" >> $(CONTROL_DIR)/control; \