Replies: 2 comments 3 replies
-
Typically cargo only enables feature flags on the top-level crates being built, so something like Might be something to try if you want to be more targeted with which features are being enabled. Alternatively you could try naming your features something different/unique to minimize colliding with other features used across other workspace dependencies |
Beta Was this translation helpful? Give feedback.
-
This is what I'm doing with cargo. Ah, now I remember. I had turned on the feature in the build command. However, that obviously won't propagate into the dependents. The question becomes how to activate If that's not possible, we can add |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a dependency that we pass through features to.
This doesn't pass through and instead we must change the dependency when doing a production build:
other-crate
is a central repo that contains a lot of code and exposes features to cut the compile times. The leaf services use that central crate as a dependency and expose those same features for CLI usage to switch between full and mocked implementations. This style is just a productivity concern.During container builds, we always enable the same feature set with no variability. We could pass through the feature through extra cargo args, but that might collide with some other dependency's features.
I'm thinking patching our top level cargo.toml might be the simplest approach. During development, we typically don't want complex default features, which are a pain to deactivate via CLI, but we could tolerate something that activates them directly on the dependency during the Nix build.
Beta Was this translation helpful? Give feedback.
All reactions