Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing dependencies in Open3D-viewer post-install script #7180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

meetgandhi-dev
Copy link

Fix missing dependencies in Open3D-viewer post-install script

Type

  • 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.
  • I will follow up and update the code if CI fails.
  • 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.

Copy link

update-docs bot commented Feb 26, 2025

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

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

```bash
```

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`

Signed-off-by: Meet Gandhi <[email protected]>
@meetgandhi-dev meetgandhi-dev force-pushed the bugfix/open3d-viewer-deps branch from 27e767e to 0279fdb Compare February 26, 2025 20:48
@ssheorey
Copy link
Member

ssheorey commented Mar 8, 2025

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

@meetgandhi-dev
Copy link
Author

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).

@ssheorey
Copy link
Member

ssheorey commented Mar 8, 2025

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.

@meetgandhi-dev
Copy link
Author

@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?

@ssheorey
Copy link
Member

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.)

@meetgandhi-dev
Copy link
Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants