-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
🚀 Replace vcpkg with conan #641
base: master
Are you sure you want to change the base?
Conversation
f10011e
to
c7a34e6
Compare
This comment was marked as resolved.
This comment was marked as resolved.
1f6bfe1
to
705a375
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little comment on vhacd-util: As far as I know this is somewhat legacy. Our engine will automatically generate collision hulls and doesn't use vhacd-util for that. vhacd-util could be very useful for generating performant collision hulls for more complicated objects, but I don't think anyone does that. In fact, I have never even tried using it, and don't even know if it works.
tc.variables["BUILD_TOOLS"] = "OFF" | ||
tc.variables["USE_CUDA"] = "OFF" | ||
if self.settings.os == "Linux": | ||
tc.variables["CMAKE_CXX_FLAGS"] = "-march=msse3 -fPIC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would break on aarch64, which technically Overte can currently run on.
set(QTAUDIO_PATH "$<TARGET_FILE_DIR:${TARGET_NAME}>/audio") | ||
set(QTAUDIO_WIN7_PATH "$<TARGET_FILE_DIR:${TARGET_NAME}>/audioWin7/audio") | ||
set(QTAUDIO_WIN8_PATH "$<TARGET_FILE_DIR:${TARGET_NAME}>/audioWin8/audio") | ||
# TODO: Is this still needed? needs testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows 7 and Windows 8(.1) are End Of Life and therefore also not supported by us anymore.
@@ -7,5 +7,9 @@ | |||
# | |||
macro(TARGET_JSON) | |||
# We use vcpkg for both json and glm, so we just re-use the target_glm macro here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will have to remember to remove this.
CMakeLists.txt
Outdated
@@ -15,67 +15,32 @@ endif() | |||
# 3.14 is the minimum version that supports symlinks on Windows | |||
cmake_minimum_required(VERSION 3.14) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't be shy about bumping this version if there is a reason to. VCPKG required a much higher CMake version than this anyway.
@@ -0,0 +1,3 @@ | |||
versions: | |||
"2019.02": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this version the conan-recipe?
"qt*:qtxmlpatterns": "True", | ||
"glad*:spec": "gl", | ||
"glad*:gl_profile": "core", | ||
"glad*:gl_version": "4.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you know, but Overte supports multiple OpenGL versions. For example, it will fall back to OpenGL 4.1 if OpenGL 4.6 is not available. It can also be built for OpenGL ES 3.2.
I don't know how this part of the Conan code works though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the targeted version for glad, I just copied the settings from the vcpkg package
@@ -68,8 +68,8 @@ foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) | |||
endif () | |||
endforeach() | |||
|
|||
find_package(Qt5LinguistTools REQUIRED) | |||
find_package(Qt5LinguistToolsMacros) | |||
# find_package(Qt5LinguistTools REQUIRED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you might know, we would like to add (more) localization support to Overte, but this is currently unused.
@@ -0,0 +1,8 @@ | |||
[settings] | |||
os=Windows | |||
arch=x86_64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't currently have any plans for an aarch64 Windows version, but would it make sense to have the profile name reflect the architecture?
@@ -217,7 +217,7 @@ def processCommand(line): | |||
executeSubprocess(scribeArgs) | |||
|
|||
# Generate the un-optimized output | |||
executeSubprocess([glslangExec, '-V110', '-o', upoptSpirvFile, unoptGlslFile]) | |||
executeSubprocess([glslangExec, '-V100', '-o', upoptSpirvFile, unoptGlslFile]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain what this change is doing? Looking it up online it seems like this switches to an older Visual Studio toolchain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The glslangValidator from the conan package is too old to support that version, it needs to be updated
A comment on building this on Linux: # Install python3 virtual environment
sudo apt install python3-venv
# Create a virtual environment in the Overte codebase
python3 -m venv .venv
# Install pip dependencies
.venv/bin/pip3 install conan
# Now one can run conan
.venv/bin/conan profile detect |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Am I understanding it right that Conan is supposed to only get dependencies of its own if the system doesn't already provide them? |
That is really dependent on how the conan recipes are written. |
This comment was marked as resolved.
This comment was marked as resolved.
It would be nice if you could put a README into the conan-recipes directory on how to consume those and how to update them. It seems like I can build node for example using a command like
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Something to figure out later: The resulting binary seems to be searching for the Qt platform plugins in the wrong directory. juliangro@x299-desktop:~/git/overte/build$ QT_DEBUG_PLUGINS=1 ./interface/interface --disable-displays "OpenVR (Vive)" --disable-inputs "OpenVR (Vive)","Sdl2" --allowMultipleInstances
[10/02 23:02:35] [DEBUG] [hifi.shared] Settings file: "/home/juliangro/.config/Overte - dev/Interface.json"
[10/02 23:02:35] [DEBUG] [settings.manager] Initializing settings write thread
[10/02 23:02:35] [WARNING] [default] QEventLoop: Cannot be used without QApplication
[10/02 23:02:35] [DEBUG] [default] UserActivityLogger is enabled: false
[10/02 23:02:35] [INFO] [default] Disabling following display plugins: ("OpenVR (Vive)")
[10/02 23:02:35] [WARNING] [default] DependencyManager::get(): No instance available for 13PluginManager
[10/02 23:02:35] [INFO] [default] Disabling following input plugins: ("OpenVR (Vive)", "Sdl2")
[10/02 23:02:35] [WARNING] [default] DependencyManager::get(): No instance available for 13PluginManager
[10/02 23:02:35] [DEBUG] [default] QFactoryLoader::QFactoryLoader() checking directory path "/home/juliangro/git/overte/build/interface/platforms" ...
[10/02 23:02:35] [WARNING] [qt.qpa.plugin] Could not find the Qt platform plugin "xcb" in ""
[10/02 23:02:35] [FATAL] [default] This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
[10/02 23:02:35] [FATAL] [default]
Abgebrochen (Speicherabzug geschrieben)
juliangro@x299-desktop:~/git/overte/build$ |
Building libnode through conan fails on Ubuntu 20.04. |
The source for the package is here: |
becf99d
to
8d93025
Compare
e98cdb9
to
c699930
Compare
This way we can continue to override CGLTF_ATOF to fix floating point conversion issues on systems with `,` decimal separators.
I built it from source and tested, Interface works perfectly, and build time is so much faster than vcpkg :) |
I tested server too and works well |
What else should we do before merging? |
Maybe test Windows version once github actions work on this PR? |
Well, technically there is a lot:
|
Also, I am perfectly fine with doing the GitHub Actions stuff. Last time I just waited because I saw Edgar experimenting with some cool stuff, like calling Conan from CMake (instead of calling Conan before CMake). |
So, there is the problem of Qt: Personally, the best solution I can think of is to do exactly what we already do in master: Run a pre-build step, which gets Qt for us if necessary. This also allows us to get and run Conan automagically, same as we do with VCPKG on master. |
This still fails as upstream Qt includes an old bug in qtlocation/src/3rdparty/mapbox-gl-native/include/mbgl/util/geometry.hpp; We should switch to KDE's Qt patchset as it has issues like this patched and we already use it on VCPKG. (https://invent.kde.org/qt/qt/qt5/-/tree/kde/5.15)
This comment was marked as resolved.
This comment was marked as resolved.
I think it would be better to create a conan package for the prebuild QT, otherwise you can run into weird issues with other conan packages that depend on QT |
Yeah, right now I am thinking we should use Conan's Qt package on any system where it is necessary. |
@AnotherFoxGuy I tried getting Qt to build, but upstream isn't compatible with GCC13 and above. As mentioned in 992221b I believe we should use KDE's Qt patchset instead of Trolltech's Qt upstream. That would entail us adding yet another recipe. I have to go for now though, so if you have time and want to give it a try… |
I need a break.
|
This PR is still a work in progress, but the interface should built and run on both Windows and Linux
TODO
cmake/externals
with conan packagesHow to build on Windows with conan
Add the remote
conan remote add overte https://git.anotherfoxguy.com/api/packages/overte/conan
Install the deps with conan
conan install . -b missing -pr:b=tools/conan-profiles/vs-19-release -pr=tools/conan-profiles/vs-19-release -of build
Generate the VS project files
cmake --preset conan-default
(Note: Currently only the Release build can be built)
How to build on Linux with conan
Let conan detect the build environment
conan profile detect
Add the remote
conan remote add overte https://git.anotherfoxguy.com/api/packages/overte/conan
Install the deps with conan
conan install . -s build_type=Release -b missing -of build
Generate the make files
cmake --preset conan-default
Build the interface
cd build && make