You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by "tuhaihe (via GitHub)" <gi...@apache.org> on 2026/03/11 08:53:40 UTC

[PR] Fix compliance issues for RPM and DEB packages [cloudberry]

tuhaihe opened a new pull request, #1609:
URL: https://github.com/apache/cloudberry/pull/1609

   As an Apache incubating project, convenience binaries must include LICENSE, NOTICE, and DISCLAIMER files. This commit adds these mandatory compliance files into the spec and rules definitions to ensure they are properly distributed with the binary RPM and DEB packages.
   
   Additionally, this commit:
   - Automates the cp of the .spec file into the ~/rpmbuild tree to prevent build failures for new users.
   
   <!-- Thank you for your contribution to Apache Cloudberry (Incubating)! -->
   
   Fixes #ISSUE_Number
   
   ### What does this PR do?
   <!-- Brief overview of the changes, including any major features or fixes -->
   
   ### Type of Change
   - [ ] Bug fix (non-breaking change)
   - [ ] New feature (non-breaking change)
   - [ ] Breaking change (fix or feature with breaking changes)
   - [ ] Documentation update
   
   ### Breaking Changes
   <!-- Remove if not applicable. If yes, explain impact and migration path -->
   
   ### Test Plan
   <!-- How did you test these changes? -->
   - [ ] Unit tests added/updated
   - [ ] Integration tests added/updated
   - [ ] Passed `make installcheck`
   - [ ] Passed `make -C src/test installcheck-cbdb-parallel`
   
   ### Impact
   <!-- Remove sections that don't apply -->
   **Performance:**
   <!-- Any performance implications? -->
   
   **User-facing changes:**
   <!-- Any changes visible to users? -->
   
   **Dependencies:**
   <!-- New dependencies or version changes? -->
   
   ### Checklist
   - [ ] Followed [contribution guide](https://cloudberry.apache.org/contribute/code)
   - [ ] Added/updated documentation
   - [ ] Reviewed code for security implications
   - [ ] Requested review from [cloudberry committers](https://github.com/orgs/apache/teams/cloudberry-committers)
   
   ### Additional Context
   <!-- Any other information that would help reviewers? Remove if none -->
   
   ### CI Skip Instructions
   <!--
   To skip CI builds, add the appropriate CI skip identifier to your PR title.
   The identifier must:
   - Be in square brackets []
   - Include the word "ci" and either "skip" or "no"
   - Only use for documentation-only changes or when absolutely necessary
   -->
   
   ---
   <!-- Join our community:
   - Mailing list: [dev@cloudberry.apache.org](https://lists.apache.org/list.html?dev@cloudberry.apache.org) (subscribe: dev-subscribe@cloudberry.apache.org)
   - Discussions: https://github.com/apache/cloudberry/discussions -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Fix compliance issues for RPM and DEB packages [cloudberry]

Posted by "leborchuk (via GitHub)" <gi...@apache.org>.
leborchuk commented on code in PR #1609:
URL: https://github.com/apache/cloudberry/pull/1609#discussion_r2923383691


##########
devops/build/packaging/deb/ubuntu22.04/rules:
##########
@@ -19,7 +19,22 @@ include /usr/share/dpkg/default.mk
 	dh $@ --parallel
 
 gpinstall:
-	make install DESTDIR=${DEBIAN_DESTINATION} prefix=
+	# If the build staging directory is empty, copy from the pre-installed location.
+	# In CI, BUILD_DESTINATION already points here so it will be populated.
+	# For local manual packaging, copy from the installed Cloudberry path.
+	@mkdir -p ${DEBIAN_DESTINATION}
+	@if [ -z "$$(ls -A ${DEBIAN_DESTINATION} 2>/dev/null)" ]; then \
+		echo "Copying pre-built binaries from ${CBDB_BIN_PATH} to ${DEBIAN_DESTINATION}..."; \
+		cp -a ${CBDB_BIN_PATH}/* ${DEBIAN_DESTINATION}/; \
+	else \
+		echo "Build staging directory already populated, skipping copy."; \
+	fi
+	# Copy Apache compliance files into the build staging directory
+	cp -a LICENSE NOTICE DISCLAIMER ${DEBIAN_DESTINATION}/
+	cp -a licenses ${DEBIAN_DESTINATION}/
+	# Create debian/copyright for Debian policy compliance
+	mkdir -p $(shell pwd)/debian
+	cat LICENSE NOTICE > $(shell pwd)/debian/copyright

Review Comment:
   have lost here 
   
   `	make install DESTDIR=${DEBIAN_DESTINATION} prefix=`
   
   We need it to install all the binaries, without it we package only license files



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Fix compliance issues for RPM and DEB packages [cloudberry]

Posted by "tuhaihe (via GitHub)" <gi...@apache.org>.
tuhaihe merged PR #1609:
URL: https://github.com/apache/cloudberry/pull/1609


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Fix compliance issues for RPM and DEB packages [cloudberry]

Posted by "tuhaihe (via GitHub)" <gi...@apache.org>.
tuhaihe commented on code in PR #1609:
URL: https://github.com/apache/cloudberry/pull/1609#discussion_r2928962146


##########
devops/build/packaging/deb/ubuntu22.04/rules:
##########
@@ -19,7 +19,22 @@ include /usr/share/dpkg/default.mk
 	dh $@ --parallel
 
 gpinstall:
-	make install DESTDIR=${DEBIAN_DESTINATION} prefix=
+	# If the build staging directory is empty, copy from the pre-installed location.
+	# In CI, BUILD_DESTINATION already points here so it will be populated.
+	# For local manual packaging, copy from the installed Cloudberry path.
+	@mkdir -p ${DEBIAN_DESTINATION}
+	@if [ -z "$$(ls -A ${DEBIAN_DESTINATION} 2>/dev/null)" ]; then \
+		echo "Copying pre-built binaries from ${CBDB_BIN_PATH} to ${DEBIAN_DESTINATION}..."; \
+		cp -a ${CBDB_BIN_PATH}/* ${DEBIAN_DESTINATION}/; \
+	else \
+		echo "Build staging directory already populated, skipping copy."; \
+	fi
+	# Copy Apache compliance files into the build staging directory
+	cp -a LICENSE NOTICE DISCLAIMER ${DEBIAN_DESTINATION}/
+	cp -a licenses ${DEBIAN_DESTINATION}/
+	# Create debian/copyright for Debian policy compliance
+	mkdir -p $(shell pwd)/debian
+	cat LICENSE NOTICE > $(shell pwd)/debian/copyright

Review Comment:
   Thanks for catching this! The `make install` was replaced with a conditional copy mechanism, not simply removed. Here's the updated logic (lines 22–31 in the new rules file):
   
   ```makefile
   @mkdir -p ${DEBIAN_DESTINATION}
   @if [ -z "$$(ls -A ${DEBIAN_DESTINATION} 2>/dev/null)" ]; then \
       echo "Copying pre-built binaries from ${CBDB_BIN_PATH} to ${DEBIAN_DESTINATION}..."; \
       cp -a ${CBDB_BIN_PATH}/* ${DEBIAN_DESTINATION}/; \
   else \
       echo "Build staging directory already populated, skipping copy."; \
   fi
   ```
   
   How it works:
   
   - In CI: The build workflow already sets `BUILD_DESTINATION=${SRC_DIR}/debian/build`, so the configure and build scripts install all binaries directly into `debian/build/`. When `gpinstall` runs, the directory is already populated → skip the copy.
   - For local/manual packaging: If a developer has already compiled and installed Cloudberry to `/usr/local/cloudberry-db`, they can run `build-deb.sh`
    directly. The staging directory will be empty → binaries are copied from the installed path.
   
   The original `make install DESTDIR=... prefix=` would re-run the install step from the source tree, which requires the full build state to still be present. The new approach is more flexible and avoids redundant work in both scenarios.
   
   All binaries are still fully included in the package — only the mechanism for populating the staging directory changed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Fix compliance issues for RPM and DEB packages [cloudberry]

Posted by "leborchuk (via GitHub)" <gi...@apache.org>.
leborchuk commented on code in PR #1609:
URL: https://github.com/apache/cloudberry/pull/1609#discussion_r2930138736


##########
devops/build/packaging/deb/ubuntu22.04/rules:
##########
@@ -19,7 +19,22 @@ include /usr/share/dpkg/default.mk
 	dh $@ --parallel
 
 gpinstall:
-	make install DESTDIR=${DEBIAN_DESTINATION} prefix=
+	# If the build staging directory is empty, copy from the pre-installed location.
+	# In CI, BUILD_DESTINATION already points here so it will be populated.
+	# For local manual packaging, copy from the installed Cloudberry path.
+	@mkdir -p ${DEBIAN_DESTINATION}
+	@if [ -z "$$(ls -A ${DEBIAN_DESTINATION} 2>/dev/null)" ]; then \
+		echo "Copying pre-built binaries from ${CBDB_BIN_PATH} to ${DEBIAN_DESTINATION}..."; \
+		cp -a ${CBDB_BIN_PATH}/* ${DEBIAN_DESTINATION}/; \
+	else \
+		echo "Build staging directory already populated, skipping copy."; \
+	fi
+	# Copy Apache compliance files into the build staging directory
+	cp -a LICENSE NOTICE DISCLAIMER ${DEBIAN_DESTINATION}/
+	cp -a licenses ${DEBIAN_DESTINATION}/
+	# Create debian/copyright for Debian policy compliance
+	mkdir -p $(shell pwd)/debian
+	cat LICENSE NOTICE > $(shell pwd)/debian/copyright

Review Comment:
   Got it! We have a script named build-cloudberry.sh but actually do `make` && `make install` inside it. So there is no need to install binaries once again



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org


Re: [PR] Fix compliance issues for RPM and DEB packages [cloudberry]

Posted by "tuhaihe (via GitHub)" <gi...@apache.org>.
tuhaihe commented on PR #1609:
URL: https://github.com/apache/cloudberry/pull/1609#issuecomment-4182627542

   After this change, we can generate the PRM/DEB packages just by one command:
   
   ```bash
   ./devops/build/packaging/deb/build-deb.sh -v 2.1.0 # DEB
   
   
   ./devops/build/packaging/deb/build-deb.sh -v 2.1.0 -r 1 # RPM
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org