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

Use Conan system requirements to install open gl dependencies on ubuntu #297

Merged
merged 3 commits into from
May 6, 2024

Conversation

Twon
Copy link
Owner

@Twon Twon commented Apr 28, 2024

Fixes: #296

@Twon Twon requested a review from mintel1 April 28, 2024 11:11
@Twon Twon changed the title Use conan systemm requirements to install open gl dependencies on ubuntu Use Conan system requirements to install open gl dependencies on ubuntu Apr 28, 2024
Copy link
Collaborator

@mintel1 mintel1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only tested the change to the conanfile.py locally after doing a quick reinstall of linux. It does the trick, assuming I also make a change to my .conf file, as per my comment below.
Wondering if the conan conf should be changed via python behind the scenes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reinstalled ubuntu on my machine so I could start from scratch.
Once I'd cloned Morpheus, I then edited conanfile.py as per this PR. Here is my output:

dpkg-query: no packages found matching libgl-dev
dpkg-query: no packages found matching libgl1-mesa-dev
opengl/system: WARN: System requirements: 'libgl-dev' are missing but can't install because tools.system.package_manager:mode is 'check'.Please update packages manually or set 'tools.system.package_manager:mode' to 'install' in the [conf] section of the profile, or in the command line using '-c tools.system.package_manager:mode=install'
opengl/system: WARN: System requirements: 'libgl1-mesa-dev' are missing but can't install because tools.system.package_manager:mode is 'check'.Please update packages manually or set 'tools.system.package_manager:mode' to 'install' in the [conf] section of the profile, or in the command line using '-c tools.system.package_manager:mode=install'
ERROR: opengl/system: Error in system_requirements() method, line 33
	apt.install_substitutes(["libgl-dev"], ["libgl1-mesa-dev"], update=True, check=True)
	ConanException: None of the installs for the package substitutes succeeded.

I needed these lines set.

$ cat ~/.conan2/global.conf 
tools.system.package_manager:mode = install
tools.system.package_manager:sudo = True

@Twon
Copy link
Owner Author

Twon commented Apr 28, 2024

I've only tested the change to the conanfile.py locally after doing a quick reinstall of linux. It does the trick, assuming I also make a change to my .conf file, as per my comment below. Wondering if the conan conf should be changed via python behind the scenes?

No, I don't believe it should as that would result in Morpheus installing dependencies on a users machine without them necessarily wanting that. I think a more sensible option would be to provide a useful error message when the dependency is missing and provide the user with the steps to follow if they do wish to follow it. Also if it does fail to install OpenGL, then Vulkan could still be available on Linux so it should continue successfully as long as at least one under lying render system is available. Any failure to provide one when there is another viable option should just be a warning the user can choose to address.

@Twon
Copy link
Owner Author

Twon commented Apr 29, 2024

I think what probably makes sense is to encourage users to set the check mode in their config as follows:

tools.system.package_manager:mode = check

Then failures are reported when packages are missing. Then users can upgrade it to install if they want to install the packages:
https://docs.conan.io/2/reference/tools/system/package_manager.html#configuration-properties-that-affect-how-system-package-managers-are-invoked

Does that sound reasonable?

Repository owner deleted a comment from jmcmon Apr 29, 2024
@mintel1
Copy link
Collaborator

mintel1 commented Apr 29, 2024

Yes I think that’s a good idea - any other gaps to be filled could be addressed via a FAQ for example. I agree that there’s a limit to the amount of auto-downloading that should be done on a users system

Copy link
Collaborator

@mintel1 mintel1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@Twon Twon merged commit d33ad93 into main May 6, 2024
19 checks passed
@Twon Twon deleted the system_requirements_for_opengl branch May 6, 2024 17:28
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.

Additional libraries required during install on Ubuntu
2 participants