Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an apitest tool for stabilizing core interfaces. #6508

Closed
brson opened this issue May 15, 2013 · 12 comments
Closed

Create an apitest tool for stabilizing core interfaces. #6508

brson opened this issue May 15, 2013 · 12 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc

Comments

@brson
Copy link
Contributor

brson commented May 15, 2013

This would be a tool to guarantee stability and backwards-compatibility of core library interfaces. It takes a rust source file (the 'spec') that declares the item's and pub uses in core, without implementation. It then parses both the spec and the library and compares them. Any mismatches are errors. Report various metrics about stable/unstable APIs.

The goal is to make it very difficult to change interfaces that are stable. The downside is that you have to ultimately redeclare all of core.

@brson
Copy link
Contributor Author

brson commented May 15, 2013

I'd be interested to hear other ideas on this topic.

@thestinger
Copy link
Contributor

This would be neat, there are a lot of bits of the container interfaces that definitely aren't ever going to change (everything in Container/Map/Set that isn't an iterator).

I'd like to be able to mark them as stable, even if it was somewhat painful/redundant.

@brson
Copy link
Contributor Author

brson commented May 16, 2013

After thinking about this further let's adopt node's stability levels. We can use attributes to tag items. The tool then would periodically extract the public item signatures, exporting them to a file or comparing them against a file. Approved API changes would then need to use the tool to regenerate the signatures file and check it in. Depending on how elaborate you want the tool's reporting to be there could be overlap in functionality with rustdoc.

@brson
Copy link
Contributor Author

brson commented May 16, 2013

The compiler can also warn about using unstable, experimented, deprecated apis.

@brson
Copy link
Contributor Author

brson commented May 16, 2013

If there is already a #[deprecated] attribute let's fold that in to the stability levels attributes.

@brson
Copy link
Contributor Author

brson commented May 16, 2013

If we wanted to validate test coverage for stable features this would probably be the tool for that as well.

@brson
Copy link
Contributor Author

brson commented Jun 1, 2013

I've started work on this in my apilock branch.

@metajack
Copy link
Contributor

metajack commented Aug 8, 2013

visiting for triage. nothing to add.

@huonw
Copy link
Member

huonw commented Jan 12, 2014

Triage: we now have semi-supported stability attributes, nothing else to add.

@alexcrichton
Copy link
Member

cc rust-lang/cargo#374

@steveklabnik
Copy link
Member

Triage: we have stability attributes for this purpose, and while it's not quite the same thing, it's working at the moment. I feel like this may be a conceptual dup of another issue relating to stability detection, but I'm not sure, so leaving it open for now.

@steveklabnik
Copy link
Member

Revisiting a few months later, we have a good story with how we ensure lack of breakage here, through stability attributes. So giving this a close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc
Projects
None yet
Development

No branches or pull requests

6 participants