Skip to content

Create an apitest tool for stabilizing core interfaces. #6508

Closed
@brson

Description

@brson
Contributor

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.

Activity

brson

brson commented on May 15, 2013

@brson
ContributorAuthor

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

thestinger

thestinger commented on May 15, 2013

@thestinger
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

brson commented on May 16, 2013

@brson
ContributorAuthor

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

brson commented on May 16, 2013

@brson
ContributorAuthor

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

brson

brson commented on May 16, 2013

@brson
ContributorAuthor

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

brson

brson commented on May 16, 2013

@brson
ContributorAuthor

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

brson

brson commented on Jun 1, 2013

@brson
ContributorAuthor

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

metajack

metajack commented on Aug 8, 2013

@metajack
Contributor

visiting for triage. nothing to add.

huonw

huonw commented on Jan 12, 2014

@huonw
Member

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

alexcrichton

alexcrichton commented on Sep 29, 2014

@alexcrichton
Member
steveklabnik

steveklabnik commented on Feb 15, 2015

@steveklabnik
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

steveklabnik commented on Apr 28, 2015

@steveklabnik
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@metajack@alexcrichton@brson@huonw

        Issue actions

          Create an `apitest` tool for stabilizing core interfaces. · Issue #6508 · rust-lang/rust