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

Also sort crt-static in --print target-features output #126424

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Jun 13, 2024

I didn't find crt-static at first (for x86_64-unknown-linux-gnu), because it was put at the bottom of the large and otherwise sorted list.

Fully sort the list before we print it.

Note that llvm_target_features starts out and remains sorted and does not need to be sorted an extra time.

On my machine the diff is just:

$ diff -u /tmp/before2.txt /tmp/after2.txt
--- /tmp/before2.txt    2024-06-13 20:40:27.091636592 +0200
+++ /tmp/after2.txt     2024-06-13 20:39:54.584894891 +0200
@@ -20,6 +20,7 @@
     bmi1                            - Support BMI instructions.
     bmi2                            - Support BMI2 instructions.
     cmpxchg16b                      - 64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips).
+    crt-static                      - Enables C Run-time Libraries to be statically linked.
     ermsb                           - REP MOVS/STOS are fast.
     f16c                            - Support 16-bit floating point conversion instructions.
     fma                             - Enable three-operand fused multiple-add.
@@ -49,7 +50,6 @@
     xsavec                          - Support xsavec instructions.
     xsaveopt                        - Support xsaveopt instructions.
     xsaves                          - Support xsaves instructions.
-    crt-static                      - Enables C Run-time Libraries to be statically linked.

 Code-generation features supported by LLVM for this target:
     16bit-mode                      - 16-bit mode (i8086).

I couldn't find a ui test that tested this output. Let's see if CI finds a regression tests.

@rustbot
Copy link
Collaborator

rustbot commented Jun 13, 2024

r? @lcnr

rustbot has assigned @lcnr.
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 13, 2024
llvm_target_features.retain(|(f, _d)| !known_llvm_target_features.contains(f));
llvm_target_features.sort();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could the llvm target features already be sorted? there's a binary search just above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, llvm_target_features appears to be sorted.

Turns out there is no regression test for the output. Probably because it is highly target specific and probably would be a pain to maintain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have a few that check --print and -Z output so it was still worth a shot, but they should have failed locally.

@rust-log-analyzer

This comment was marked as outdated.

@lqd
Copy link
Member

lqd commented Jun 13, 2024

(cc #126430 on that last failure, which is unfortunate as it stops CI from possibly finding a failing test for this PR...)

@lcnr
Copy link
Contributor

lcnr commented Jun 14, 2024

r? @lqd

@rustbot rustbot assigned lqd and unassigned lcnr Jun 14, 2024
@lqd
Copy link
Member

lqd commented Jun 14, 2024

Relaunched PR CI jobs now that the rustdoc tests are fixed

This LGTM once we have the answer on the existing order.

I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`),
because it was put at the bottom the large and otherwise sorted list.

Fully sort the list before we print it.

Note that `llvm_target_features` starts out sorted and does not need to
be sorted an extra time.
@Enselic Enselic changed the title Sort output of --print target-features Also sort crt-static in --print target-features output Jun 14, 2024
@Enselic Enselic marked this pull request as ready for review June 14, 2024 18:30
@lqd
Copy link
Member

lqd commented Jun 14, 2024

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jun 14, 2024

📌 Commit 04af371 has been approved by lqd

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 Jun 14, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 15, 2024
 Also sort `crt-static` in `--print target-features` output

I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`), because it was put at the bottom of the large and otherwise sorted list.

Fully sort the list before we print it.

Note that `llvm_target_features` starts out and remains sorted and does not need to be sorted an extra time.

On my machine the diff is just:

```diff
$ diff -u /tmp/before2.txt /tmp/after2.txt
--- /tmp/before2.txt    2024-06-13 20:40:27.091636592 +0200
+++ /tmp/after2.txt     2024-06-13 20:39:54.584894891 +0200
`@@` -20,6 +20,7 `@@`
     bmi1                            - Support BMI instructions.
     bmi2                            - Support BMI2 instructions.
     cmpxchg16b                      - 64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips).
+    crt-static                      - Enables C Run-time Libraries to be statically linked.
     ermsb                           - REP MOVS/STOS are fast.
     f16c                            - Support 16-bit floating point conversion instructions.
     fma                             - Enable three-operand fused multiple-add.
`@@` -49,7 +50,6 `@@`
     xsavec                          - Support xsavec instructions.
     xsaveopt                        - Support xsaveopt instructions.
     xsaves                          - Support xsaves instructions.
-    crt-static                      - Enables C Run-time Libraries to be statically linked.

 Code-generation features supported by LLVM for this target:
     16bit-mode                      - 16-bit mode (i8086).
```

I couldn't find a ui test that tested this output. Let's see if CI finds a regression tests.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2024
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#125829 (rustc_span: Add conveniences for working with span formats)
 - rust-lang#126279 (Migrate `inaccessible-temp-dir`, `output-with-hyphens` and `issue-10971-temps-dir` `run-make` tests to `rmake`)
 - rust-lang#126361 (Unify intrinsics body handling in StableMIR)
 - rust-lang#126417 (Add `f16` and `f128` inline ASM support for `x86` and `x86-64`)
 - rust-lang#126424 ( Also sort `crt-static` in `--print target-features` output)
 - rust-lang#126428 (Polish `std::path::absolute` documentation.)
 - rust-lang#126429 (Add `f16` and `f128` const eval for binary and unary operationations)
 - rust-lang#126448 (End support for Python 3.8 in tidy)
 - rust-lang#126488 (Use `std::path::absolute` in bootstrap)
 - rust-lang#126511 (.mailmap: Associate both my work and my private email with me)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#125829 (rustc_span: Add conveniences for working with span formats)
 - rust-lang#126361 (Unify intrinsics body handling in StableMIR)
 - rust-lang#126417 (Add `f16` and `f128` inline ASM support for `x86` and `x86-64`)
 - rust-lang#126424 ( Also sort `crt-static` in `--print target-features` output)
 - rust-lang#126428 (Polish `std::path::absolute` documentation.)
 - rust-lang#126429 (Add `f16` and `f128` const eval for binary and unary operationations)
 - rust-lang#126448 (End support for Python 3.8 in tidy)
 - rust-lang#126488 (Use `std::path::absolute` in bootstrap)
 - rust-lang#126511 (.mailmap: Associate both my work and my private email with me)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 21de992 into rust-lang:master Jun 15, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jun 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2024
Rollup merge of rust-lang#126424 - Enselic:sort-target-features, r=lqd

 Also sort `crt-static` in `--print target-features` output

I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`), because it was put at the bottom of the large and otherwise sorted list.

Fully sort the list before we print it.

Note that `llvm_target_features` starts out and remains sorted and does not need to be sorted an extra time.

On my machine the diff is just:

```diff
$ diff -u /tmp/before2.txt /tmp/after2.txt
--- /tmp/before2.txt    2024-06-13 20:40:27.091636592 +0200
+++ /tmp/after2.txt     2024-06-13 20:39:54.584894891 +0200
``@@`` -20,6 +20,7 ``@@``
     bmi1                            - Support BMI instructions.
     bmi2                            - Support BMI2 instructions.
     cmpxchg16b                      - 64-bit with cmpxchg16b (this is true for most x86-64 chips, but not the first AMD chips).
+    crt-static                      - Enables C Run-time Libraries to be statically linked.
     ermsb                           - REP MOVS/STOS are fast.
     f16c                            - Support 16-bit floating point conversion instructions.
     fma                             - Enable three-operand fused multiple-add.
``@@`` -49,7 +50,6 ``@@``
     xsavec                          - Support xsavec instructions.
     xsaveopt                        - Support xsaveopt instructions.
     xsaves                          - Support xsaves instructions.
-    crt-static                      - Enables C Run-time Libraries to be statically linked.

 Code-generation features supported by LLVM for this target:
     16bit-mode                      - 16-bit mode (i8086).
```

I couldn't find a ui test that tested this output. Let's see if CI finds a regression tests.
@Enselic Enselic deleted the sort-target-features branch June 15, 2024 17:15
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants