Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Unify compiled dependencies of old and new crate #41

Open
ibabushkin opened this issue Jan 26, 2018 · 1 comment
Open

Unify compiled dependencies of old and new crate #41

ibabushkin opened this issue Jan 26, 2018 · 1 comment

Comments

@ibabushkin
Copy link
Contributor

ibabushkin commented Jan 26, 2018

Currently, we just disambiguate the crates compiled as dependencies of the old and new crate version. This has some issues, however: unchanged types from the two copies of a dependency aren't recognized as the same type, and various smaller issues appear.

A clean solution would be to determine the dependencies of both the old and the new crate, and to compile only one copy of each crate, preferably in a place where we don't interfere with any other tools and can reuse a maximum amount of work already done by cargo for previous compilations. After that, we can proceed to recursively determine matching crates and check them, until we reach the root crates. At this point we'd have all information needed to determine the change category of unchanged types from different crates.

@elichai
Copy link
Contributor

elichai commented Jul 22, 2020

This is a major problem right now, we want to use this tool but I get a lot of false positives because we expose types from dependencies
i.e.:

error: breaking changes in `PublicKey`                                                                                                                                                                                                                                          
  --> /home/elichai2/gits/rust-bitcoin/src/util/key.rs:75:1                                                                             
   |                                                                                                                                                                                                                                                                            
75 | / pub struct PublicKey {                                                                                                           
76 | |     /// Whether this public key should be serialized as compressed                                                               
77 | |     pub compressed: bool,                                                                                                        
78 | |     /// The actual ECDSA key                                                                                                     
79 | |     pub key: secp256k1::PublicKey,                                                                                               
80 | | }                                                                                                                                
   | |_^                                                                                                                                
   |                                                                                                                                    
   = warning: type error: expected struct `old::secp256k1::PublicKey`, found struct `new::secp256k1::PublicKey` (breaking):             
           Changing the type of an item is a breaking change, because user code                                                         
           using the item becomes type-incorrect.                                                                                       

on the other hand, if that dependency was bumped a major version then now it's a breaking change (because if a user is using that type then we now break his code)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants