maintenance: explicitely declare direct dependencies #4810
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously a lot of libraries were used but not declared because a dependent library was declared pulled them.
To enable the explicit mode
(implicit_transitive_deps false)
needs to be added todune-project
. I believe enabling it requires a high bar of knowledge around libraries, so it's best to leave it disabled. For example, the error when not importing declaringdune-build-info
when it's needed is indecipherable:While dune does not warn of unused libraries, I've removed some unused libraries, like xapi-idl (because only xapi-log was being used), or threads, which is not needed anymore as dune assumes
-mt
and forces linking againstthreads.posix
anyway. Read https://dune.readthedocs.io/en/stable/dune-files.html?highlight=threads#implicit-transitive-deps-1 and https://dune.readthedocs.io/en/stable/advanced-topics.html?highlight=threads#findlib-integrationFor users of the gzip and zstd I've decided to reexport the symbols from the library xapi-compression. I saw little value in forcing users to declare both.