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

Enhance diff_check with more unicode et al #5884

Open
calebcartwright opened this issue Aug 13, 2023 · 13 comments
Open

Enhance diff_check with more unicode et al #5884

calebcartwright opened this issue Aug 13, 2023 · 13 comments
Assignees
Labels
good first issue Issues up for grabs, also good candidates for new rustfmt contributors help wanted

Comments

@calebcartwright
Copy link
Member

calebcartwright commented Aug 13, 2023

Follow up action item from a topic I raised in #5864 (comment) relative to adding some additional test repos to improve our coverage of string formatting with various characters and encodings.

One suggested repo to include is https://github.com/unicode-org/icu4x as well as some from https://github.com/unicode-rs

I opted to simply mention icu4x as part of this instead of directly adding it because I noticed that repo is using cargo make and I didn't have bandwidth to determine if that'd cause any issues/require any additional changes to our script.

New repos can be wired up by adding a call site with respective args here:

rustfmt/ci/check_diff.sh

Lines 170 to 192 in b069aac

check_repo "https://github.com/rust-lang/rust.git" rust-lang-rust
check_repo "https://github.com/rust-lang/cargo.git" cargo
check_repo "https://github.com/rust-lang/miri.git" miri
check_repo "https://github.com/rust-lang/rust-analyzer.git" rust-analyzer
check_repo "https://github.com/bitflags/bitflags.git" bitflags
check_repo "https://github.com/rust-lang/log.git" log
check_repo "https://github.com/rust-lang/mdBook.git" mdBook
check_repo "https://github.com/rust-lang/packed_simd.git" packed_simd
check_repo "https://github.com/rust-lang/rust-semverver.git" check_repo
check_repo "https://github.com/Stebalien/tempfile.git" tempfile
check_repo "https://github.com/rust-lang/futures-rs.git" futures-rs
check_repo "https://github.com/dtolnay/anyhow.git" anyhow
check_repo "https://github.com/dtolnay/thiserror.git" thiserror
check_repo "https://github.com/dtolnay/syn.git" syn
check_repo "https://github.com/serde-rs/serde.git" serde
check_repo "https://github.com/rust-lang/rustlings.git" rustlings
check_repo "https://github.com/rust-lang/rustup.git" rustup
check_repo "https://github.com/SergioBenitez/Rocket.git" Rocket
check_repo "https://github.com/rustls/rustls.git" rustls
check_repo "https://github.com/rust-lang/rust-bindgen.git" rust-bindgen
check_repo "https://github.com/hyperium/hyper.git" hyper
check_repo "https://github.com/actix/actix.git" actix
check_repo "https://github.com/denoland/deno.git" denoland_deno

@calebcartwright calebcartwright added good first issue Issues up for grabs, also good candidates for new rustfmt contributors help wanted labels Aug 13, 2023
@raymondyegon
Copy link

@rustbot claim

@ytmimi
Copy link
Contributor

ytmimi commented Aug 30, 2023

@calebcartwright I don't think the use of cargo make on any project we test would be an issue. The diff check job just runs rustfmt againsg all .rs files it finds in the repo.

rustfmt/ci/check_diff.sh

Lines 59 to 62 in f89cd3c

for i in `find . | grep "\.rs$"`
do
$1 --unstable-features --skip-children --check --color=always $config $i >> $2 2>/dev/null
done

@calebcartwright
Copy link
Member Author

Forgot we were running rustfmt directly. The only potential downside to this would be our ability to pull in any target repositories that needed 2018+ edition & didn't have edition defined in a rustfmt.toml file.

Orthogonal to this particular issue, but at some point would like to think/talk through whether that has any implications once style_edition enters the ecosystem

@ytmimi
Copy link
Contributor

ytmimi commented Sep 11, 2023

@calebcartwright good point. I guess if we landed support for cargo fmt to be passed individual files then that would mostly solve the edition issue. I'm nearly 100% sure style_edition is going to be implemented in such a way that we'll derive it from the --edition if you don't explicitly configure style_edition.

@rufevean
Copy link
Contributor

@ytmimi , is this issue still open to be worked on as the old assignee doesnt seem like he is working on this anymore?

@ytmimi
Copy link
Contributor

ytmimi commented Sep 18, 2024

@rufevean yeah this one is still open

@rufevean
Copy link
Contributor

got it, thank you

@rufevean
Copy link
Contributor

@rustbot claim

@rufevean
Copy link
Contributor

i have added the follow repos into ./check_diff.sh file and i executed it . i am receiving an error stating
./check_diff.sh: line 148: /tmp/rustfmt-IVGzB32u/feature_rustfmt: No such file or directory .
is this part of the issue or am i missing something?

    check_repo "https://github.com/unicode-org/icu4x.git" icu4x
    check_repo "https://github.com/unicode-rs/unicode-segmentation.git" unicode-segmentation
    check_repo "https://github.com/unicode-rs/unicode-normalization.git" unicode-normalization

@ytmimi
Copy link
Contributor

ytmimi commented Sep 22, 2024

it's unclear what the issue is here. Are you able to run the script on your machine without adding those new repos?

@rufevean
Copy link
Contributor

its working perfectly fine when i removed the repos

@ytmimi
Copy link
Contributor

ytmimi commented Sep 23, 2024

Line 148 is where we try to get the version value for the feature binary. Not sure why adding those lines would cause an issue there. The error message suggests that we're failing to build the binary or we're failing to copy it to the temporary directory. Let me know if you're able to investigate further.

@rufevean
Copy link
Contributor

i have added the follow repos into ./check_diff.sh file and i executed it . i am receiving an error stating ./check_diff.sh: line 148: /tmp/rustfmt-IVGzB32u/feature_rustfmt: No such file or directory . is this part of the issue or am i missing something?

    check_repo "https://github.com/unicode-org/icu4x.git" icu4x
    check_repo "https://github.com/unicode-rs/unicode-segmentation.git" unicode-segmentation
    check_repo "https://github.com/unicode-rs/unicode-normalization.git" unicode-normalization

okay, i have tested it now, i was wrong. i wasnt specifying the branch correctly last time. it running well this time with all these three repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues up for grabs, also good candidates for new rustfmt contributors help wanted
Projects
None yet
Development

No branches or pull requests

4 participants