Skip to content

CMake: Improve building without hunter #601

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

Merged
merged 3 commits into from
Feb 22, 2022

Conversation

eigendude
Copy link
Contributor

@eigendude eigendude commented Feb 18, 2022

Description of the Change

Now that #128 is merged, I've got Fuhon building without hunter again.

The approach is to delegate finding dependencies to the build system using the typical CMake approach, using find modules. I've included three find modules in this PR.

I only included find modules for three of the dependencies. The reason is because downstream, I just use the hunterized versions of dependencies. However, the hunter team made the unfortunate but easy choice of forking repos. This means that many dependencies have fallen behind the versions used by my team's app. We can't downgrade three of the packages, so I wrote CMake find modules for these three dependencies.

The final patch, for filecoin_ffi, also means that git submodules are no longer needed. This is advantageous, because git submodules cause problems for a fair number of build systems and packagers. And who hasn't forgotten --recursive.

It's an open question if we want CMake find modules for any additional dependencies. I could possibly add this to my List Of Things To Do (tm).

Benefits

  • Improved building of Fuhon in environments without Hunter.

Possible Drawbacks

CMake code is added, currently totaling about 70 lines. Normally any lines added increases the load of maintenance, but code that doesn't ship has much less of an impact.

Alternate Designs [optional]

I currently use an alternative approach for the Curl dependency - I just patch out the CONFIG parameter, and ship the patch with the rest of my work. The exact patch is:

commit a136981cfaf04e7fe7f8ced38bcd9ebaf6493f91
Author: Garrett Brown <[email protected]>
Date:   Tue Feb 15 10:18:31 2022 -0800

    [temp] CMake: Delegate finding CURL to the build system

diff --git a/cmake/dependencies.cmake b/cmake/dependencies.cmake
index 6c5636dd..de953113 100644
--- a/cmake/dependencies.cmake
+++ b/cmake/dependencies.cmake
@@ -25,8 +25,7 @@ hunter_add_package(OpenSSL)
 find_package(OpenSSL REQUIRED)
 
 # https://hunter.readthedocs.io/en/latest/packages/pkg/CURL.html#pkg-curl
-hunter_add_package(CURL)
-find_package(CURL CONFIG REQUIRED)
+find_package(CURL REQUIRED)
 
 # https://developers.google.com/protocol-buffers/
 hunter_add_package(Protobuf)

By not including Curl in this PR, it increases my downstream technical debt, but not significantly.

@codecov
Copy link

codecov bot commented Feb 18, 2022

Codecov Report

Merging #601 (acae8ac) into master (03fd9bd) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #601   +/-   ##
=======================================
  Coverage   46.02%   46.02%           
=======================================
  Files         715      715           
  Lines       32328    32328           
  Branches    17885    17885           
=======================================
  Hits        14880    14880           
  Misses      13102    13102           
  Partials     4346     4346           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 03fd9bd...acae8ac. Read the comment docs.

@Alexey-N-Chernyshov
Copy link
Contributor

@eigendude, thanks for your interest and cooperation.

@turuslan turuslan merged commit 7777777 into filecoin-project:master Feb 22, 2022
@eigendude eigendude deleted the build-without-hunter branch February 22, 2022 15:18
@eigendude
Copy link
Contributor Author

eigendude commented Feb 22, 2022

@Alexey-N-Chernyshov thanks for accepting any of the patches. I get crazy ideas like bringing Filecoin to the living room and start to make them. Anything accepted means I don't have to do it twice 🙃

Markuu-s pushed a commit that referenced this pull request Mar 3, 2022
Markuu-s pushed a commit that referenced this pull request Mar 10, 2022
Markuu-s pushed a commit that referenced this pull request Mar 10, 2022
Markuu-s pushed a commit that referenced this pull request Mar 10, 2022
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.

3 participants