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

feat: setup rust-toolchain.toml to use nightly by default #698

Closed
wants to merge 1 commit into from

Conversation

LeoBorai
Copy link
Contributor

@LeoBorai LeoBorai commented Sep 9, 2023

Introduces rust-toolchain.toml which forces cargo to use latest Nightly.
This is useful for users using stable as the default toolchain, Rustup
responds to the presence of this file as follows:

➜  sea-query git:(master) rustup default stable
info: using existing install for 'stable-aarch64-apple-darwin'
info: default toolchain set to 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin unchanged - rustc 1.72.0 (5680fa18f 2023-08-23)

info: note that the toolchain 'nightly-aarch64-apple-darwin' is currently in use (overridden by '~/Repos/sea-query/rust-toolchain.toml')

@LeoBorai
Copy link
Contributor Author

LeoBorai commented Sep 9, 2023

@ikrivosheev , @billy1624 not sure why we use stable for clippy and nightly for rustfmt?

rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- run: cargo fmt --manifest-path Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-attr/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-binder/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-derive/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-postgres/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path sea-query-rusqlite/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path examples/sqlx_sqlite/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path examples/sqlx_any/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path examples/rusqlite/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path examples/sqlx_postgres/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path examples/postgres/Cargo.toml --all -- --check
- run: cargo fmt --manifest-path examples/sqlx_mysql/Cargo.toml --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- run: cargo clippy --all-features --workspace -- -D warnings
- run: cargo clippy --manifest-path sea-query-binder/Cargo.toml --workspace --features runtime-async-std-rustls --features=with-chrono,with-json,with-rust_decimal,with-bigdecimal,with-uuid,with-time,with-ipnetwork,with-mac_address,postgres-array -- -D warnings
- run: cargo clippy --manifest-path sea-query-rusqlite/Cargo.toml --all-features --workspace -- -D warnings
- run: cargo clippy --manifest-path sea-query-postgres/Cargo.toml --all-features --workspace -- -D warnings

@tyt2y3
Copy link
Member

tyt2y3 commented Sep 10, 2023

I think our default support target is always the latest stable.
nightly... we only needed it for cargo fmt, specifically to fmt the code in doc tests.

@LeoBorai
Copy link
Contributor Author

Gotcha! Will se if that can be configured via the toolchain file!

@LeoBorai
Copy link
Contributor Author

Hi @tyt2y3! After reading through rust-toolchain.toml docs and also seeking for more references, I ended up without any approach to have a Rust Toolchain setup that uses rustfmt on Nightly but Stable on other commands.

Im closing this to keep the inbox clear!

@LeoBorai LeoBorai closed this Oct 21, 2023
@LeoBorai LeoBorai deleted the chore/toolchain branch October 21, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants