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

Create YCMBootstrapFetch to permit projects to bootstrap YCM using FetchContent #403

Merged
merged 9 commits into from
Apr 20, 2022

Conversation

traversaro
Copy link
Member

@traversaro traversaro commented Apr 13, 2022

Create YCMBootstrapFetch.cmake script to permit projects to bootstrap YCM by just using FetchContent.

A different file is created as the semantics of this new bootstrap script is a bit different, as it just make YCM available in the project, but it does not also adds it as a subproject in the superbuild sense. Superbuilds that want to switch from YCMBootstrap.cmake to YCMBootstrapFetch.cmake need to create BuildYCM.cmake script, and appropriately call find_or_build_package(YCM), as done for example in the robotology-superbuild in robotology/robotology-superbuild#1078 .

Fix #138 .

@traversaro traversaro changed the title [WIP] Create YCMBootstrapFetch to permit projects to bootstrap YCM using FetchContent Create YCMBootstrapFetch to permit projects to bootstrap YCM using FetchContent Apr 13, 2022
@traversaro
Copy link
Member Author

traversaro commented Apr 13, 2022

Windows GitHub Action builds, before this PR the bootstrapping took ~25 seconds and ~22 seconds in subsequent builds:

2022-04-13T13:15:32.8484463Z -- YCM not found. Bootstrapping it.
2022-04-13T13:15:32.8515271Z -- Downloading YCMEPHelper.cmake - Attempt 1 of 3
2022-04-13T13:15:32.9477256Z -- Downloading YCMEPHelper.cmake - SUCCESS
2022-04-13T13:15:32.9506210Z -- Downloading CMakeParseArguments.cmake - Attempt 1 of 3
2022-04-13T13:15:32.9785522Z -- Downloading CMakeParseArguments.cmake - SUCCESS
2022-04-13T13:15:32.9798445Z -- Downloading ExternalProject.cmake - Attempt 1 of 3
2022-04-13T13:15:33.0161645Z -- Downloading ExternalProject.cmake - SUCCESS
2022-04-13T13:15:33.0346004Z CMake Warning (dev) at build/CMakeFiles/YCMEPHelper.cmake:164 (message):
2022-04-13T13:15:33.0346733Z   YCM_BOOTSTRAP HASH mismatch
2022-04-13T13:15:33.0347087Z 
2022-04-13T13:15:33.0347458Z     for file: [D:/a/robotology-superbuild/robotology-superbuild/cmake/IncludeUrl.cmake]
2022-04-13T13:15:33.0347962Z       expected hash: [997de3554f0d03ae22952a64fe26cdad118e8199]
2022-04-13T13:15:33.0348380Z         actual hash: [5ec16edfcc1f76c7e22771b4f632da908232a933]
2022-04-13T13:15:33.0348672Z 
2022-04-13T13:15:33.0348953Z   Perhaps it is outdated or you have local modification.  Please consider
2022-04-13T13:15:33.0349405Z   upgrading it, or contributing your changes to YCM.
2022-04-13T13:15:33.0349683Z 
2022-04-13T13:15:33.0349889Z Call Stack (most recent call first):
2022-04-13T13:15:33.0350293Z   build/CMakeFiles/YCMEPHelper.cmake:1335 (_ycm_hash_check)
2022-04-13T13:15:33.0351012Z   cmake/YCMBootstrap.cmake:102 (ycm_bootstrap)
2022-04-13T13:15:33.0351429Z   CMakeLists.txt:56 (include)
2022-04-13T13:15:33.0351846Z This warning is for project developers.  Use -Wno-dev to suppress it.
2022-04-13T13:15:33.0352153Z 
2022-04-13T13:15:33.0356264Z -- Downloading StyleGITHUB.cmake - Attempt 1 of 3
2022-04-13T13:15:33.0678198Z -- Downloading StyleGITHUB.cmake - SUCCESS
2022-04-13T13:15:33.1785470Z -- Performing download step (git clone) for 'YCM'
2022-04-13T13:15:34.9784192Z -- Performing update step for 'YCM'
2022-04-13T13:15:35.9801574Z -- Performing configure step for 'YCM'
2022-04-13T13:15:38.1790158Z -- Performing uninstall step for 'YCM'
2022-04-13T13:15:39.6938859Z -- Performing build step for 'YCM'
2022-04-13T13:15:50.3215812Z -- Performing install step for 'YCM'
2022-04-13T13:15:56.6708893Z -- Found YCM: D:/a/robotology-superbuild/robotology-superbuild/build/install/share/cmake/YCM (found version "0.13.2")
2022-04-13T13:15:57.1612277Z -- Package YARP not found. Will be downloaded and built.

After, it takes ~5 seconds on first build and ~3 on subsequent builds:

2022-04-13T15:58:29.2048786Z -- YCM not found. Bootstrapping it.
2022-04-13T15:58:29.2089251Z -- Fetching YCM.
2022-04-13T15:58:34.2048020Z -- YCM_SOURCE_DIR: D:/a/robotology-superbuild/robotology-superbuild/build/_deps/ycm-src
2022-04-13T15:58:34.9321770Z -- Package YARP not found. Will be downloaded and built.

@traversaro
Copy link
Member Author

The tests in in robotology/robotology-superbuild#1078 worked fine, the PR is now ready for review.

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.

Use FetchContent for bootstrap phase
2 participants