solidity icon indicating copy to clipboard operation
solidity copied to clipboard

chore(build): prefer system deps for fmt/nlohmann_json/range-v3

Open chenrui333 opened this issue 1 year ago • 3 comments

While regression build solidity, I saw it always pull the deps rather than using the system deps, thus updating the build to prefer system deps

chenrui333 avatar Sep 08 '24 14:09 chenrui333

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

github-actions[bot] avatar Sep 08 '24 14:09 github-actions[bot]

We have the IGNORE_VENDORED_DEPENDENCIES=ON option for this: https://github.com/ethereum/solidity/blob/09e9aa65c68a650c8ccf9b745c04e72aba9e1793/CMakeLists.txt#L40-L45

The only difference is that it does not run find_package(), but that could be added as an else here: https://github.com/ethereum/solidity/blob/09e9aa65c68a650c8ccf9b745c04e72aba9e1793/CMakeLists.txt#L60-L64

Which I'd expect to be necessary. I wonder why it worked without it for @aarlt (who added it) though?

cameel avatar Sep 08 '24 19:09 cameel

Hey @chenrui333! Thanks for your contribution. Initially I created this IGNORE_VENDORED_DEPENDENCIES mechanism so that the solidity libraries can be easily used within vcpkg. The idea of that first version was, that a "root" cmake file will just search for the dependencies. However, we changed some internal libraries since then and I just did a small test here https://github.com/aarlt/cmake_vcpkg_solidity and it looks like that everything should just work, if you do what @cameel suggested. Just add an else to if (NOT IGNORE_VENDORED_DEPENDENCIES) in solidity/CMakeLists.txt, where you just ad find_package's for fmt, nlohmann_json and range-v3.

aarlt avatar Sep 09 '24 12:09 aarlt

Hey, sorry for the long response time. At some point a similar issue came up in which we noted that the IGNORE_VENDORED_DEPENDENCIES wasn't working as expected - which was fixed in https://github.com/ethereum/solidity/pull/15878. I suspect your PR was in context of the homebrew bottle, for which we switched to the (fixed) IGNORE_VENDORED_DEPENDENCIES option. Therefore I think we can close this, wdyt @chenrui333 ?

clonker avatar Aug 07 '25 06:08 clonker

Closing this now

clonker avatar Sep 18 '25 14:09 clonker