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

End all lines in src/stage0 with trailing newline #139721

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Apr 12, 2025

Most tools that process text files prefer if every line ends in \n. Text files without the last newline are aberrant and usually not what you want.

Before:

$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843$ ▌

After:

$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
$ 

@rustbot
Copy link
Collaborator

rustbot commented Apr 12, 2025

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue. labels Apr 12, 2025
@jieyouxu
Copy link
Member

Hm, I'm not sure if this can break other things I'm not aware of. Handing this over to someone who might have more clues.

As in, it seems very reasonable to me, but I'm not fully aware of all the things that can potentially be affected.

cc @onur-ozkan @Kobzol (in case u know more)
r? @Mark-Simulacrum

@rustbot rustbot assigned Mark-Simulacrum and unassigned jieyouxu Apr 12, 2025
@dtolnay
Copy link
Member Author

dtolnay commented Apr 13, 2025

The stage0 file already contains some blank lines:

so I would expect that any tool which isn't expecting trailing newlines on every line would just hit its existing codepath for a blank line.

@onur-ozkan
Copy link
Member

Looks good :)

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

📌 Commit 6ba9649 has been approved by onur-ozkan

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 13, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 13, 2025
End all lines in src/stage0 with trailing newline

Most tools that process text files prefer if every line ends in \n. Text files without the last newline are aberrant and usually not what you want.

**Before:**

```console
$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843$ ▌
```

**After:**

```console
$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
$ ▌
```
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…enton

Rollup of 11 pull requests

Successful merges:

 - rust-lang#138972 (std: Fix build for NuttX targets)
 - rust-lang#139177 (Use -C target-cpu=z13 on s390x vector test)
 - rust-lang#139511 (libtest: Pass the test's panic payload as Option instead of Result)
 - rust-lang#139605 (update ```miniz_oxide``` to 0.8.8)
 - rust-lang#139618 (compiletest: Make `SUGGESTION` annotations viral)
 - rust-lang#139677 (Fix profiler_builtins build script to handle full path to profiler lib)
 - rust-lang#139683 (Use `with_native_path` for Windows)
 - rust-lang#139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout)
 - rust-lang#139710 (Move `args` into `std::sys`)
 - rust-lang#139721 (End all lines in src/stage0 with trailing newline)
 - rust-lang#139726 (Move `select_unpredictable` to the `hint` module)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…enton

Rollup of 10 pull requests

Successful merges:

 - rust-lang#138972 (std: Fix build for NuttX targets)
 - rust-lang#139177 (Use -C target-cpu=z13 on s390x vector test)
 - rust-lang#139511 (libtest: Pass the test's panic payload as Option instead of Result)
 - rust-lang#139605 (update ```miniz_oxide``` to 0.8.8)
 - rust-lang#139618 (compiletest: Make `SUGGESTION` annotations viral)
 - rust-lang#139677 (Fix profiler_builtins build script to handle full path to profiler lib)
 - rust-lang#139683 (Use `with_native_path` for Windows)
 - rust-lang#139710 (Move `args` into `std::sys`)
 - rust-lang#139721 (End all lines in src/stage0 with trailing newline)
 - rust-lang#139726 (Move `select_unpredictable` to the `hint` module)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 54aff1f into rust-lang:master Apr 13, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 13, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
Rollup merge of rust-lang#139721 - dtolnay:stage0newline, r=onur-ozkan

End all lines in src/stage0 with trailing newline

Most tools that process text files prefer if every line ends in \n. Text files without the last newline are aberrant and usually not what you want.

**Before:**

```console
$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843$ ▌
```

**After:**

```console
$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
$ ▌
```
@dtolnay dtolnay deleted the stage0newline branch April 13, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants