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

Begin resolving cargo-semver-checks blockers for merging into cargo #104

Open
4 tasks
nikomatsakis opened this issue Jul 22, 2024 · 4 comments
Open
4 tasks
Assignees
Milestone

Comments

@nikomatsakis
Copy link
Contributor

Metadata
Owner(s) @obi1kenobi
Team(s) cargo
Goal document 2024h2/cargo-semver-checks

Summary

Design and implement cargo-semver-checks functionality that lies on the critical path for merging the tool into cargo itself.

Tasks and status

  • Implementation of cargo manifest linting + CLI (@obi1kenobi)
  • Initial design for cross-crate checking (@obi1kenobi)
  • Initial design for type-checking lints (@obi1kenobi)
  • Discussion and moral support (cargo Team)
@nikomatsakis nikomatsakis added this to the 2024h2 milestone Jul 22, 2024
@rust-lang rust-lang locked and limited conversation to collaborators Jul 25, 2024
@nikomatsakis
Copy link
Contributor Author

This issue is intended for status updates only.

For general questions or comments, please contact the owner(s) directly.

@obi1kenobi
Copy link
Member

Status update as of September 1.

Key developments: We've laid a lot of the groundwork to make manifest linting possible.

  • In preparation for the significant expansion of our CLI, we now have the ability to test how CLI invocations get interpreted internally. We can also now snapshot the output of any CLI invocation over a given workspace, allowing us to proceed with refactoring the implementation without breaking existing use cases.
  • We have a concrete design for the expansion of the CLI, and for the Trustfall schema changes that will be necessary to enable manifest linting.

Not blocked on anything. No opportunities to contribute yet, but stay tuned — there will be some in future updates!

@obi1kenobi
Copy link
Member

Status update as of September 17.

Key developments: Working prototype of manifest querying.

WIP branch here: https://github.com/obi1kenobi/trustfall-rustdoc-adapter/compare/manifest_querying

An example SemVer lint this enables would be: "a non-nightly, non-underscore-prefixed feature has been removed from the package between releases."

{
    CrateDiff {
        baseline {
            feature {
                feature: name
                    @filter(op: "!=", value: ["$nightly"])
                    @tag
                    @output
            }
        }

        current {
            feature @fold @transform(op: "count") @filter(op: "=", value: ["$zero"]) {
                name @filter(op: "=", value: ["%feature"])
            }
        }
    }
}

# args:
{
    "nightly": "nightly",
    "zero": 0
}

This is SemVer-major because it'll break uses like: my_dep = { version = "1.0", features = ["removed_feature"] }. We're ignoring any features named nightly because community consensus is that such features are unstable — I'll do some more research on other expected-unstable feature patterns in the community before we ship any lints around this.

Not blocked on anything. No opportunities to contribute yet, but stay tuned — there will be some in future updates!

@obi1kenobi
Copy link
Member

No major updates to report. Preparing my talk for next week's EuroRust has taken away most of my free time.

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