Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Fix missing dependencies in Open3D-viewer post-install script

Open meetgandhi-dev opened this issue 9 months ago • 8 comments

Fix missing dependencies in Open3D-viewer post-install script

Type

  • [x] Bug fix (non-breaking change which fixes an issue): Fixes #
  • [ ] New feature (non-breaking change which adds functionality). Resolves #
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

The script cpp/apps/Open3DViewer/postinstall-linux.sh was generating the following error messages:

#24 904.4 /root/Open3D/cpp/apps/Open3DViewer/postinstall-linux.sh: 5: update-desktop-database: not found
#24 904.4 /root/Open3D/cpp/apps/Open3DViewer/postinstall-linux.sh: 6: gtk-update-icon-cache: not found

This PR adds the necessary dependencies for installation:

update-desktop-database is provided by desktop-file-utils gtk-update-icon-cache is provided by gtk-update-icon-cache

Checklist:

  • [ ] I have run python util/check_style.py --apply to apply Open3D code style to my code.
  • [ ] This PR changes Open3D behavior or adds new functionality.
    • [ ] Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is updated accordingly.
    • [ ] I have added or updated C++ and / or Python unit tests OR included test results (e.g. screenshots or numbers) here.
  • [x] I will follow up and update the code if CI fails.
  • [x] For fork PRs, I have selected Allow edits from maintainers.

Description

Log snippet while generating TXZ package

#24 688.0 Run CPack packaging tool...
#24 688.0 /cmake-3.29.2-linux-x86_64/bin/cpack --config ./CPackConfig.cmake
#24 688.0 CPack: Create package using TXZ
#24 688.0 CPack: Install projects
#24 688.0 CPack: - Run preinstall target for: Open3D
#24 900.1 CPack: - Install project: Open3D []
#24 904.4 /root/Open3D/cpp/apps/Open3DViewer/postinstall-linux.sh: 5: update-desktop-database: not found
#24 904.4 /root/Open3D/cpp/apps/Open3DViewer/postinstall-linux.sh: 6: gtk-update-icon-cache: not found
#24 904.4 CPack: Create package
#24 981.6 CPack: - package: /root/Open3D/build/package/open3d-devel-linux-x86_64-cxx11-abi-0.19.0.tar.xz generated.

meetgandhi-dev avatar Feb 26 '25 20:02 meetgandhi-dev

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

update-docs[bot] avatar Feb 26 '25 20:02 update-docs[bot]

Hi @meetgandhi-dev these packages are installed in the standard Ubuntu desktop install. Which OS / variant were they missing from?

ssheorey avatar Mar 08 '25 00:03 ssheorey

Hi @ssheorey I found the errors while building packages for cpu-xxx variants. For eg: https://github.com/isl-org/Open3D/blob/main/docker%2Fdocker_build.sh#L371 I believe the base docker image doesn't contain desktop application(s).

meetgandhi-dev avatar Mar 08 '25 03:03 meetgandhi-dev

Ah I see. This is a post install script, so meant to be run on the users system after installation. I'm not sure if running it inside docker is useful. The issue with adding these 2 packages to docker is that they will pull in the entire Ubuntu desktop, which will make the docker image significantly larger.

I would recommend instead modifying the post install script so that it does not run these commands if they are not found in the system.

ssheorey avatar Mar 08 '25 16:03 ssheorey

@ssheorey Understood. Should I list them as dependencies for the created Debian package here? Also, do you think the postinstall script needs to be included in the Debian package for proper installation?

meetgandhi-dev avatar Mar 09 '25 11:03 meetgandhi-dev

I don't think these should be dependencies - dependencies are supposed to be mandatory, while these are optional convenience utilities. We run them if present, else don't do anything.

I think the post install script is included in the Debian package for the viewer at the moment (see the open3d-viewer deb package in github releases.)

ssheorey avatar Mar 13 '25 06:03 ssheorey

I don't think these should be dependencies - dependencies are supposed to be mandatory, while these are optional convenience utilities. We run them if present, else don't do anything.

Got it. I will update the script accordingly.

I think the post install script is included in the Debian package for the viewer at the moment (see the open3d-viewer deb package in github releases.)

I think the post-install script is executed during the Cmake installation process (ref) and is not part of the debian package. However, the required dependencies are not available in the Docker image, so they aren't being installed. I propose using the postinst feature of the CPack DEB to trigger the installation script during the Debian package installation. (This will only execute commands if the dependencies are available, as mentioned above.)

meetgandhi-dev avatar Mar 13 '25 06:03 meetgandhi-dev

Sounds good. Can you update the PR ? Thanks!

ssheorey avatar May 27 '25 05:05 ssheorey