-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unify the vcpkg package set across all gz libs. Remove all packages before every build. #907
Changes from all commits
0565b9d
2d1067e
6dfeae5
e9b8ce3
d244844
d44e63e
e4ac2a8
f433a46
05a2dcf
7066a34
a1452e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,14 @@ if DEFINED MAKE_JOBS ( | |
set VCPKG_MAX_CONCURRENCY=%MAKE_JOBS% | ||
) | ||
set VCPKG_OSRF_DIR=%VCPKG_DIR%\osrf_vcpkg_ports | ||
set VCPKG_INSTALLED_FILES_DIR=%VCPKG_DIR%\installed | ||
set VCPKG_CMD=%VCPKG_DIR%\vcpkg.exe | ||
set VCPKG_CMAKE_TOOLCHAIN_FILE=%VCPKG_DIR%/scripts/buildsystems/vcpkg.cmake | ||
if NOT DEFINED VCPKG_SNAPSHOT ( | ||
:: see https://github.com/microsoft/vcpkg/releases | ||
set VCPKG_SNAPSHOT=2022.02.23 | ||
) | ||
:: Set of common gz dependencies expected up to Garden | ||
set VCPKG_DEPENDENCIES_LEGACY=assimp boost-core bullet3 ccd console-bridge cppzmq cuda curl dlfcn-win32 eigen3 fcl ffmpeg freeimage gdal gflags glib gts jsoncpp libyaml libzip ogre ogre2 ogre22 openssl protobuf pybind11 qt5 qt5-winextras qwt sqlite3 tinyxml2 zeromq | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I understand correctly, the per-package dependencies have all been dropped in favor of this single list of dependencies. I think that's fine because the packaging for Windows is done using conda-forge and so there's limited utility in using the vcpkg installations to try and smoke out missing dependencies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is correct. |
||
|
||
goto :EOF |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,8 +268,20 @@ if NOT %VCPKG_HEAD% == %VCPKG_TAG% ( | |
goto :EOF | ||
|
||
:: ################################## | ||
:install_vcpkg_package | ||
:: arg1: package to install | ||
:remove_vcpkg_installation | ||
:: remove the installed directory to simulate all packages removal | ||
:: vcpkg cli does not support the operation | ||
set LIB_DIR="%~dp0" | ||
call %LIB_DIR%\windows_env_vars.bat || goto :error | ||
if [%VCPKG_INSTALLED_FILES_DIR%]==[] ( | ||
echo VCPKG_INSTALLED_FILES_DIR variable seems empty, this is a bug | ||
goto :error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there situations where we'd expect this directory to be empty, such as with a freshly provisioned host, and if so is the |
||
) | ||
del /s /f /q %VCPKG_INSTALLED_FILES_DIR% | ||
goto :EOF | ||
|
||
:: ################################## | ||
:_prepare_vcpkg_to_install | ||
set LIB_DIR=%~dp0 | ||
call %LIB_DIR%\windows_env_vars.bat || goto :error | ||
call %win_lib% :check_vcpkg_snapshot || goto :error | ||
|
@@ -278,14 +290,36 @@ pushd . | |
cd %VCPKG_OSRF_DIR% | ||
git pull origin master || goto :error | ||
popd | ||
goto :EOF | ||
|
||
:: ################################## | ||
:_install_and_upgrade_vcpkg_package | ||
:: arg1: package to install | ||
if [%1] == [] ( | ||
echo "_install_and_upgrade_vcpkg_package called with no argument" | ||
goto :error | ||
) | ||
:: workaround on permissions problems for default VCPKG_DEFAULT_BINARY_CACHE | ||
set VCPKG_DEFAULT_BINARY_CACHE=C:\Windows\Temp\vcpkg | ||
if not exist %VCPKG_DEFAULT_BINARY_CACHE% mkdir %VCPKG_DEFAULT_BINARY_CACHE% | ||
%VCPKG_CMD% install --recurse "%1" --overlay-ports="%VCPKG_OSRF_DIR%" | ||
:: vcpkg does not upgrade installed packages using the install command | ||
:: since most of the packages are coming from a frozen snapshot, it is | ||
:: not a problem. However upgrading is needed for the osrf port overlay | ||
%VCPKG_CMD% upgrade "%1" --no-dry-run --overlay-ports="%VCPKG_OSRF_DIR%" | ||
goto :EOF | ||
|
||
:: ################################## | ||
:install_vcpkg_package | ||
:: arg1: package to install | ||
if [%1] == [] ( | ||
echo "install_vcpkg_package called with no argument" | ||
goto :error | ||
) | ||
call %win_lib% :_prepare_vcpkg_to_install|| goto :error | ||
call %win_lib% :_install_and_upgrade_vcpkg_package "%1" || goto :error | ||
goto :EOF | ||
|
||
:: ################################## | ||
:remove_vcpkg_package | ||
:: arg1: package to install | ||
|
@@ -305,11 +339,15 @@ goto :EOF | |
%VCPKG_CMD% integrate remove || goto :error | ||
goto :EOF | ||
|
||
|
||
:: copy port to the official tree | ||
xcopy %VCPKG_OSRF_DIR%\%PKG% %PORT_DIR% /s /i /e || goto :error | ||
|
||
call %win_lib% :install_vcpkg_package %1 || goto :error | ||
:: ################################## | ||
:setup_vcpkg_all_dependencies | ||
set LIB_DIR=%~dp0 | ||
call %LIB_DIR%\windows_env_vars.bat || goto :error | ||
call %win_lib% :enable_vcpkg_integration || goto :error | ||
call %win_lib% :_prepare_vcpkg_to_install|| goto :error | ||
for %%p in (%VCPKG_DEPENDENCIES_LEGACY%) do ( | ||
call %win_lib% :_install_and_upgrade_vcpkg_package %%p || goto :error | ||
) | ||
goto :EOF | ||
|
||
:: ################################## | ||
|
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.
It would be nice (maybe a follow-up PR) to print the list of installed packages and their versions for debugging purposes.
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.
+100. I'll do it after merging this PR.
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.
#908