File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,33 @@ Trade-offs:
110110-  ✅ Faster link times
111111-  ❌ Might not support all use-cases, in particular if you depend on C or C++ dependencies
112112
113+ ### Resolve features for the whole workspace  
114+ 
115+ Consider: adding to your project's ` .cargo/config.toml ` 
116+ 
117+ ``` toml 
118+ [resolver ]
119+ feature-unification  = " workspace" 
120+ ``` 
121+ 
122+ When invoking ` cargo ` ,
123+ [ features get activated] [ resolver-features ]  based on which workspace members you have selected.
124+ However, when contributing to an application,
125+ you may need to build and test various packages within the application,
126+ which can cause extraneous rebuilds because different sets of features may be activated for common dependencies.
127+ With [ ` feauture-unification ` ] [ feature-unification ] ,
128+ you can reuse more dependency builds by ensuring the same set of dependency features are activated,
129+ independent of which package you are currently building and testing.
130+ 
131+ Trade-offs:
132+ -  ✅ Fewer rebuilds when building different packages in a workspace
133+ -  ❌ ** Requires using nightly Rust and an [ unstable Cargo feature] [ feature-unification ] ** 
134+ -  ❌ A package activating a feature can mask bugs in other packages that should activate it but don't
135+ -  ❌ If the feature unification from ` --workspace `  doesn't work for you, then this won't either
136+ 
137+ [ resolver-features ] : ../reference/resolver.md#features 
138+ [ feature-unification ] : ../reference/unstable.md#feature-unification 
139+ 
113140## Reducing built code  
114141
115142### Removing unused dependencies  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments