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

Tracking issue: CI support #2614

Closed
1 of 2 tasks
nrc opened this issue Apr 10, 2018 · 6 comments
Closed
1 of 2 tasks

Tracking issue: CI support #2614

nrc opened this issue Apr 10, 2018 · 6 comments
Labels
blocked Blocked on rustc, an RFC, etc.

Comments

@nrc
Copy link
Member

nrc commented Apr 10, 2018

A key use case for Rustfmt is running on CI. A key part of that is the new check write mode. There are other issues too though.

@nrc nrc added this to the 1.0 milestone Apr 10, 2018
@nrc
Copy link
Member Author

nrc commented Apr 10, 2018

The versioning issue is that as Rustfmt evolves, the formatting will change and thus by running rustup update, we might move from passing to failing on CI. This is bad, it would be better to have the user opt-in to the version changing. We also need it to be easy for a contributor to run the exact same version of Rustfmt as is run on the CI. However, this is complicated by the Rustup distribution model: the version of Rustfmt is tied to the toolchain used by Rustfmt.

One step towards fixing this is to specify the Rustfmt version in the rustfmt.toml. Then emit a specific error if the versions don't match. This doesn't solve the problem, but it does make the problem explicit, rather than being a confusing, hard to fix error. This might be sufficient for 1.0, together with a strict channel system to ensure that formatting changes rarely.

@topecongiro
Copy link
Contributor

Versioning issue can be solved by cargo install --version, though it would be nice if rustup does have the similar functionality. Also cargo install is much slower than rustup component add.

@nrc
Copy link
Member Author

nrc commented Apr 10, 2018

Ideally we'd have a solution that worked for Rustup without having to rebuild from source. Though it might be that we just have to accept building from source (the problem of course being if the user is on a stable toolchain because we use unstable features).

On Rustup, it is difficult because we're closely tied to the compiler version (although not too closely, nowadays).

@nrc
Copy link
Member Author

nrc commented Apr 10, 2018

Perhaps we could have a story including only the diffs (and using rustfmt-format-diff). Apparently this is the Chrome/clang-format strategy.

@nrc
Copy link
Member Author

nrc commented May 14, 2018

Versioning is discussed in rust-lang/rfcs#2437

@nrc nrc added the blocked Blocked on rustc, an RFC, etc. label May 17, 2018
@nrc nrc modified the milestones: 1.0 (preview 2), 1.0 (rc) Jul 10, 2018
@nrc
Copy link
Member Author

nrc commented Jul 30, 2018

RFC 2437 is in FCP, so I believe this issue is complete (we still need to implement versioning, but that can come later).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on rustc, an RFC, etc.
Projects
None yet
Development

No branches or pull requests

2 participants