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

OsqpEigen, YCM and robot-testing-framework: Switch to use conda-forge binary package when generating conda packages #807

Merged
merged 9 commits into from
Jun 28, 2021
3 changes: 0 additions & 3 deletions .github/workflows/generate-conda-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ jobs:
# We manually specify the build order as conda build is too slow, and conda mambabuild does not support correctly multiple recipes
# see https://github.com/mamba-org/boa/issues/117
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml blockfactory
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml osqp-eigen
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml ycm-cmake-modules
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml robot-testing-framework
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml yarp
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml matio-cpp
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml yarp-telemetry
Expand Down
3 changes: 2 additions & 1 deletion cmake/BuildOsqpEigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ ycm_ep_helper(OsqpEigen TYPE GIT
CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF
DEPENDS osqp)

set(OsqpEigen_CONDA_DEPENDENCIES "eigen")
set(OsqpEigen_CONDA_PKG_NAME osqp-eigen)
set(OsqpEigen_CONDA_PKG_CONDA_FORGE_OVERRIDE ON)
2 changes: 2 additions & 0 deletions cmake/BuildRobotTestingFramework.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ ycm_ep_helper(RobotTestingFramework TYPE GIT
COMPONENT core
FOLDER src)

set(RobotTestingFramework_CONDA_PKG_NAME robot-testing-framework)
set(RobotTestingFramework_CONDA_PKG_CONDA_FORGE_OVERRIDE ON)
2 changes: 2 additions & 0 deletions cmake/Buildevent-driven.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ ycm_ep_helper(event-driven TYPE GIT
YCM
COMPONENT event-driven
FOLDER src)

set(event-driven_CONDA_DEPENDENCIES libopencv qt)
19 changes: 19 additions & 0 deletions conda/cmake/RobotologySuperbuildGenerateCondaRecipes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ macro(generate_metametadata_file)
string(APPEND metametadata_file_contents " - ${_dep}\n")
endforeach()
endif()

# By default we rely on properly set run_exports configurations in conda recipes
# to avoid to manually set run dependencies. However, in some cases (cmake-only
# libraries, header-only libraries) run_exports is not used, so it is necessary
# to manually specify them as run dependencies
if("ycm-cmake-modules" IN_LIST ${_cmake_pkg}_CONDA_DEPENDENCIES)
list(APPEND ${_cmake_pkg}_CONDA_RUN_DEPENDENCIES_EXPLICIT "ycm-cmake-modules")
endif()
if("eigen" IN_LIST ${_cmake_pkg}_CONDA_DEPENDENCIES)
list(APPEND ${_cmake_pkg}_CONDA_RUN_DEPENDENCIES_EXPLICIT "eigen")
endif()
if(NOT "${${_cmake_pkg}_CONDA_RUN_DEPENDENCIES_EXPLICIT}" STREQUAL "")
string(APPEND metametadata_file_contents " run_dependencies_explicit:\n")
foreach(_dep IN LISTS ${_cmake_pkg}_CONDA_RUN_DEPENDENCIES_EXPLICIT)
string(APPEND metametadata_file_contents " - ${_dep}\n")
endforeach()
endif()


# If some dependency require opengl to build and we are on Linux, add the required packages
# See https://conda-forge.org/docs/maintainer/knowledge_base.html?#libgl
Expand Down Expand Up @@ -186,6 +204,7 @@ set_property(GLOBAL PROPERTY YCM_PROJECTS ${_projects})
set(_YH_YCM_REPOSITORY robotology/ycm.git)
# Use ycm-cmake-modules as name as in debian
set(YCM_CONDA_PKG_NAME ycm-cmake-modules)
set(YCM_CONDA_PKG_CONDA_FORGE_OVERRIDE ON)

include(RobotologySuperbuildLogic)
include(CondaGenerationOptions)
Expand Down
5 changes: 4 additions & 1 deletion conda/recipe_template/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ requirements:
- {{ cdt('expat') }} {% endraw %}{% endif %}

host:
{# List all dependencies just a host. Run dependenencies should be correctly set by run_exports #}
{# List all dependencies just a host. Run dependenencies should be correctly set by run_exports, except the one listed in #}
{% for dep in dependencies %} - {{ dep }}
{% endfor %}
{# Handle specific packages required for gl on Linux, see https://conda-forge.org/docs/maintainer/knowledge_base.html?#libgl #}
{% if require_opengl_linux %} - xorg-libxfixes {% endif %}
{# Handle the constraint of macos >= 10.13 #}
run:
- __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} # [osx and x86_64]
{# List additional run dependencies that are not covered by run_exports #}
{% for dep in run_dependencies_explicit %} - {{ dep }}
{% endfor %}
{% if add_python_runtime_dep %} - python {% endif %}
{% if add_numpy_runtime_dep %}{% raw %} - {{ pin_compatible('numpy') }} {% endraw %}{% endif %}

Expand Down