Open jancionear opened 4 months ago
The only way I can think of would be to have a similar build.rs
in all of the interesting crates and have those crates export a function/constant that describes the features it has been built with.
OR
Alternatively we could have one mini-crate that exports just such a constant and then defines all the different features that all the other crates would enable by a feature dependency. We could also appropriate e.g. near-primitives-core or some similar crate for this. And then use themis
to ensure that we don't forget to maintain said property.
https://github.com/near/nearcore/pull/11166 introduced printing enabled cargo features in the output of
./neard --version
. For example:It prints the features enabled directly for
neard
, but it doesn't print the ones enabled forneard's
dependencies, e.gnearcore
. It would be nice to print the features of dependencies as well.Recently we had an issue where
nearcore/new_epoch_sync
was getting enabled even thoughneard/new_epoch_sync
wasn't enabled at all (zulip thread, pr with fix: https://github.com/near/nearcore/pull/11158).Printing the features of dependencies would allow us to spot that the feature in
nearcore
is getting enabled and fix the problem immediately. Without that we had to spend a significant amount of time debugging whyneard
was behaving in a strange way.