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

target tier policy compliance #116004

Closed

Conversation

davidtwco
Copy link
Member

@davidtwco davidtwco commented Sep 20, 2023

Fixes #113739

This pull request makes a lot of changes to our targets (nothing that affects their behaviour!) to start making sure that they all comply with our target tier policy.

  • I've done a quick check to see if each target complies with our policies which don't require documentation (no onerous licensing, etc).
  • Each target now has a platform support page, most of these are newly added and just have "Missing!" on them a lot. I need your help to populate these!
  • Each target now has an assembly test in tests/assembly/targets, it's the same simple code in each test, it just confirms that we can in fact produce something resembling assembly given the target triple.
  • I've moved some things around in compiler/rustc_target/spec. Previously, we had the base targets (e.g. windows_msvc_base, which all the Windows MSVC targets would inherit from) in the same directory as the targets themselves. I've moved these to compiler/rustc_target/spec/base. This change makes the implementation of a new tidy lint easier.
  • Similarly, in our platform support index, we had pages like windows_msvc.md which would be linked to by all of the Windows MSVC targets. I've changed it so that every target has its own page, and when multiple targets were linking to one page, then only one of those targets has the content of that previous page, and the others symlink to that target. Likewise, this change makes the implementation of a new tidy lint easier.
  • I've introduced a tidy lint which checks that for every target file in compiler/rustc_target/spec, there exists a test with the same filename in tests/assembly/target and platform support documentation in src/doc/rustc/src/platform-support/. After all of my changes, this tidy lint isn't reporting any errors.

With respect to specific targets:

  • I've technically added i386-unknown-linux-gnu and i486-unknown-linux-gnu. Originally added in Added support for i386-unknown-linux-gnu and i486-unknown-linux-gnu #80662, these targets never actually got added to the compiler, the target definitions were there but the compiler never knew about them.
  • NetBSD’s platform support page had some targets listed that no longer existed or had different names (e.g. amd64 to x86_64 and mipsel removed) - I’ve updated it to reflect the targets which exist.
  • i686-pc-windows-msvc and x86_64-pc-windows-msvc were listed as both tier 1 and tier 3, depending on the version of Windows, which seems like a misuse of the tier system, so I've removed them from tier 3. Support for different versions of the target can be documented in the platform support page.
  • powerpc-unknown-openbsd wasn't listed in OpenBSD's platform support page like every other OpenBSD target - I've added it but maybe I shouldn't have.

Tier 1 w/ Host Tools

  • aarch64-unknown-linux-gnu
    • Incomplete platform support document
  • i686-pc-windows-gnu
    • Incomplete platform support document
  • i686-pc-windows-msvc
    • Incomplete platform support document
  • i686-unknown-linux-gnu
    • Incomplete platform support document
  • x86_64-apple-darwin
    • Incomplete platform support document
  • x86_64-pc-windows-gnu
    • Incomplete platform support document
  • x86_64-pc-windows-msvc
    • Incomplete platform support document
  • x86_64-unknown-linux-gnu
    • Incomplete platform support document

Tier 2 w/ Host Tools

  • aarch64-apple-darwin
    • Relevant PRs: #74541
    • Incomplete platform support document
  • aarch64-pc-windows-msvc
    • Incomplete platform support document
  • aarch64-unknown-linux-musl
    • Relevant PRs: #44779
    • Incomplete platform support document
  • arm-unknown-linux-gnueabi
    • Incomplete platform support document
  • arm-unknown-linux-gnueabihf
    • Incomplete platform support document
  • armv7-unknown-linux-gnueabihf
    • Relevant PRs: #30948
    • Incomplete platform support document
  • loongarch64-unknown-linux-gnu
  • mips-unknown-linux-gnu
    • Incomplete platform support document
  • mips64-unknown-linux-gnuabi64
    • Relevant PRs: #36024
    • Incomplete platform support document
  • mips64el-unknown-linux-gnuabi64
    • Relevant PRs: #36024
    • Incomplete platform support document
  • mipsel-unknown-linux-gnu
    • Incomplete platform support document
  • powerpc-unknown-linux-gnu
  • powerpc64-unknown-linux-gnu
    • Relevant PRs: #30776
    • Incomplete platform support document
  • powerpc64le-unknown-linux-gnu
    • Relevant PRs: #30776
    • Incomplete platform support document
  • riscv64gc-unknown-linux-gnu
    • Relevant PRs: #66661
    • Incomplete platform support document
  • s390x-unknown-linux-gnu
    • Relevant PRs: #36028
    • Incomplete platform support document
  • x86_64-unknown-freebsd
    • Incomplete platform support document
  • x86_64-unknown-illumos
    • Relevant PRs: #71145
    • Incomplete platform support document
  • x86_64-unknown-linux-musl
    • Relevant PRs: #24777
    • Incomplete platform support document
  • x86_64-unknown-netbsd
    • NetBSD's platform support page had some targets listed that no longer existed or had different names (e.g. amd64 -> x86_64 and mipsel removed) - I've updated it to reflect the targets which exist
    • This target otherwise complies, it's only marked as incomplete so the above gets a look.

Tier 2

  • aarch64-apple-ios
    • Relevant PRs: #20699
    • Incomplete platform support document
  • aarch64-apple-ios-sim
  • aarch64-fuchsia
  • aarch64-unknown-fuchsia
  • aarch64-linux-android
  • aarch64-unknown-none-softfloat
    • Relevant PRs: #64589
    • Incomplete platform support document
  • aarch64-unknown-none
    • Relevant PRs: #53233
    • Incomplete platform support document
  • aarch64-unknown-uefi
  • arm-linux-androideabi
  • arm-unknown-linux-musleabi
    • Relevant PRs: #35060
    • Incomplete platform support document
  • arm-unknown-linux-musleabihf
    • Relevant PRs: #35060
    • Incomplete platform support document
  • armebv7r-none-eabi
    • Relevant PRs: #53679
    • Incomplete platform support document
  • armebv7r-none-eabihf
    • Relevant PRs: #53679
    • Incomplete platform support document
  • armv5te-unknown-linux-gnueabi
    • Relevant PRs: #37615
    • Incomplete platform support document
  • armv5te-unknown-linux-musleabi
    • Relevant PRs: #50423
    • Incomplete platform support document
  • armv7-linux-androideabi
  • armv7-unknown-linux-gnueabi
    • Relevant PRs: #63107
    • Incomplete platform support document
  • armv7-unknown-linux-musleabi
    • Relevant PRs: #63107
    • Incomplete platform support document
  • armv7-unknown-linux-musleabihf
    • Relevant PRs: #35060
    • Incomplete platform support document
  • armv7a-none-eabi
    • Relevant PRs: #68253
    • Incomplete platform support document
  • armv7r-none-eabi
    • Relevant PRs: #53679
    • Incomplete platform support document
  • armv7r-none-eabihf
    • Relevant PRs: #53679
    • Incomplete platform support document
  • asmjs-unknown-emscripten
  • i586-pc-windows-msvc
    • Incomplete platform support document
  • i586-unknown-linux-gnu
    • Relevant PRs: #31629
    • Incomplete platform support document
  • i586-unknown-linux-musl
    • Relevant PRs: #47282
    • Incomplete platform support document
  • i686-linux-android
  • i686-unknown-freebsd
    • Incomplete platform support document
  • i686-unknown-linux-musl
    • Relevant PRs: #30629
    • Incomplete platform support document
  • i686-unknown-uefi
  • mips-unknown-linux-musl
    • Relevant PRs: #31298
    • Incomplete platform support document
  • mips64-unknown-linux-muslabi64
    • Relevant PRs: #63165
    • Incomplete platform support document
  • mips64el-unknown-linux-muslabi64
    • Relevant PRs: #63165
    • Incomplete platform support document
  • mipsel-unknown-linux-musl
    • Relevant PRs: #31298
    • Incomplete platform support document
  • nvptx64-nvidia-cuda
  • riscv32i-unknown-none-elf
    • Relevant PRs: #62784
    • Incomplete platform support document
  • riscv32imac-unknown-none-elf
    • Relevant PRs: #52787
    • Incomplete platform support document
  • riscv32imc-unknown-none-elf
    • Relevant PRs: #53822
    • Incomplete platform support document
  • riscv64gc-unknown-none-elf
    • Relevant PRs: #58406
    • Incomplete platform support document
  • riscv64imac-unknown-none-elf
    • Relevant PRs: #58406
    • Incomplete platform support document
  • sparc64-unknown-linux-gnu
    • Relevant PRs: #38726
    • Incomplete platform support document
  • sparcv9-sun-solaris
    • Relevant PRs: #39903
    • Incomplete platform support document
  • thumbv6m-none-eabi
    • Relevant PRs: #36874
    • Incomplete platform support document
  • thumbv7em-none-eabi
    • Relevant PRs: #36874
    • Incomplete platform support document
  • thumbv7em-none-eabihf
    • Relevant PRs: #36874
    • Incomplete platform support document
  • thumbv7m-none-eabi
    • Relevant PRs: #36874
    • Incomplete platform support document
  • thumbv7neon-linux-androideabi
  • thumbv7neon-unknown-linux-gnueabihf
  • thumbv8m.base-none-eabi
    • Relevant PRs: #55041
    • Incomplete platform support document
  • thumbv8m.main-none-eabi
    • Relevant PRs: #56000
    • Incomplete platform support document
  • thumbv8m.main-none-eabihf
    • Relevant PRs: #56000
    • Incomplete platform support document
  • wasm32-unknown-emscripten
    • Relevant PRs: #36339
    • Incomplete platform support document
  • wasm32-unknown-unknown
    • Relevant PRs: #45905
    • Incomplete platform support document
  • wasm32-wasi
  • wasm32-wasi-preview1-threads
  • x86_64-apple-ios
    • Incomplete platform support document
  • x86_64-fortanix-unknown-sgx
  • x86_64-fuchsia
  • x86_64-unknown-fuchsia
  • x86_64-linux-android
  • x86_64-pc-solaris
    • Relevant PRs: #82216
    • Incomplete platform support document
  • x86_64-unknown-linux-gnux32
    • Relevant PRs: #45224
    • Incomplete platform support document
  • x86_64-unknown-none
  • x86_64-unknown-redox
    • Relevant PRs: #38401
    • Incomplete platform support document
  • x86_64-unknown-uefi

Tier 3

  • aarch64-apple-ios-macabi
    • Relevant PRs: #63467, #111384, #106925
    • Incomplete platform support document
    • Unknown if supports host in index
    • Otherwise compliant
  • aarch64-apple-tvos
    • Unknown if supports host in index
    • Otherwise compliant
  • aarch64-apple-watchos-sim
  • aarch64-kmc-solid_asp3
  • aarch64-nintendo-switch-freestanding
  • aarch64-pc-windows-gnullvm
  • aarch64-unknown-linux-ohos
  • aarch64-unknown-teeos
  • aarch64-unknown-nto-qnx710
  • aarch64-unknown-freebsd
    • Incomplete platform support document
  • aarch64-unknown-hermit
  • aarch64-unknown-linux-gnu_ilp32
    • Relevant PRs: #81455
    • Incomplete platform support document
  • aarch64-unknown-netbsd
  • aarch64-unknown-openbsd
  • aarch64-unknown-redox
    • Relevant PRs: #60547
    • Incomplete platform support document
    • Unknown if supports host in index
  • aarch64-uwp-windows-msvc
    • Relevant PRs: #63155
    • Incomplete platform support document
    • Unknown if supports host in index
  • aarch64-wrs-vxworks
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Unknown if supports host in index
  • aarch64_be-unknown-linux-gnu_ilp32
    • Relevant PRs: #81455
    • Incomplete platform support document
  • aarch64_be-unknown-linux-gnu
    • Relevant PRs: #81455
    • Incomplete platform support document
  • aarch64_be-unknown-netbsd
  • arm64_32-apple-watchos
    • Naming inconsistency? aarch64_32-apple-watchos?
    • Otherwise compliant
  • armeb-unknown-linux-gnueabi
    • Unknown if supports host in index
    • Otherwise compliant
  • armv4t-none-eabi
  • armv4t-unknown-linux-gnueabi
    • Relevant PRs: #47018
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • armv5te-none-eabi
  • armv5te-unknown-linux-uclibceabi
    • Relevant PRs: #78142
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • armv6-unknown-freebsd
    • Incomplete platform support document
  • armv6-unknown-netbsd-eabihf
  • armv6k-nintendo-3ds
  • armv7-apple-ios
    • Incomplete platform support document
  • armv7-sony-vita-newlibeabihf
    • Relevant PRs: #105712, #110638, #111819
    • Table row in platform support index is incomplete (supports std now?)
    • Otherwise compliant
  • armv7-unknown-linux-ohos
  • armv7-unknown-linux-uclibceabi
  • armv7-unknown-linux-uclibceabihf
    • Unknown if supports host in index
    • Otherwise compliant
  • armv7-unknown-freebsd
    • Incomplete platform support document
  • armv7-unknown-netbsd-eabihf
  • armv7-wrs-vxworks-eabihf
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • armv7a-kmc-solid_asp3-eabi
  • armv7a-kmc-solid_asp3-eabihf
  • armv7a-none-eabihf
    • Relevant PRs: #68253
    • Incomplete platform support document
  • armv7k-apple-watchos
  • armv7s-apple-ios
    • Incomplete platform support document
  • avr-unknown-gnu-atmega328
    • Relevant PRs: #74941
    • Incomplete platform support document
  • bpfeb-unknown-none
    • Relevant PRs: #79608
    • Incomplete platform support document
  • bpfel-unknown-none
    • Relevant PRs: #79608
    • Incomplete platform support document
  • csky-unknown-linux-gnuabiv2
  • hexagon-unknown-linux-musl
    • Relevant PRs: #62814
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • i386-apple-ios
    • Incomplete platform support document
  • i586-pc-nto-qnx700
  • i686-apple-darwin
    • Incomplete platform support document
  • i686-pc-windows-msvc
    • Target exists in two tiers - only in Tier 3 for Windows XP
    • Removed, this seems like a incorrect use of the tier system
  • i686-pc-windows-gnullvm
  • i686-unknown-haiku
    • Relevant PRs: #36727, #51757
    • Incomplete platform support document
  • i686-unknown-netbsd
  • i686-unknown-openbsd
  • i686-uwp-windows-gnu
    • Relevant PRs: #60260
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • i686-uwp-windows-msvc
    • Relevant PRs: #63155
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • i686-wrs-vxworks
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • loongarch64-unknown-none
  • loongarch64-unknown-none-softfloat
  • m68k-unknown-linux-gnu
  • mips-unknown-linux-uclibc
    • Relevant PRs: #35734
    • Incomplete platform support document
  • mips64-openwrt-linux-musl
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • mipsel-sony-psp
    • Relevant PRs: #72062, #97843
    • Incomplete platform support document
  • mipsel-sony-psx
  • mipsel-unknown-linux-uclibc
    • Relevant PRs: #35734
    • Incomplete platform support document
  • mipsel-unknown-none
    • Relevant PRs: #78676
    • Incomplete platform support document
  • mipsisa32r6-unknown-linux-gnu
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • mipsisa32r6el-unknown-linux-gnu
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • mipsisa64r6-unknown-linux-gnuabi64
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • mipsisa64r6el-unknown-linux-gnuabi64
  • msp430-none-elf
  • powerpc-unknown-linux-gnuspe
    • Relevant PRs: #48484
    • Incomplete platform support document
  • powerpc-unknown-linux-musl
    • Relevant PRs: #55562
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • powerpc-unknown-netbsd
  • powerpc-unknown-openbsd
    • This wasn't included in the OpenBSD platform support page with the rest of the targets - I've added it - should I have?
  • powerpc-wrs-vxworks-spe
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • powerpc-wrs-vxworks
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • powerpc64-unknown-freebsd
    • Incomplete platform support document
  • powerpc64le-unknown-freebsd
    • Incomplete platform support document
  • powerpc-unknown-freebsd
    • Incomplete platform support document
  • powerpc64-unknown-linux-musl
    • Relevant PRs: #55562
    • Incomplete platform support document
  • powerpc64-wrs-vxworks
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • powerpc64le-unknown-linux-musl
    • Relevant PRs: #51619
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • powerpc64-unknown-openbsd
  • powerpc64-ibm-aix
    • Relevant PRs: #102293, compiler-team#553
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • riscv32gc-unknown-linux-gnu
    • Relevant PRs: #76048
    • Incomplete platform support document
  • riscv32gc-unknown-linux-musl
    • Relevant PRs: #82202
    • Incomplete platform support document
  • riscv32im-unknown-none-elf
    • Relevant PRs: #93749
    • Incomplete platform support document
    • Target maintainer doesn't have an email, just a handle, is that okay?
  • riscv32imac-unknown-xous-elf
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • riscv32imc-esp-espidf
  • riscv32imac-esp-espidf
  • riscv64gc-unknown-hermit
  • riscv64gc-unknown-freebsd
    • Incomplete platform support document
  • riscv64gc-unknown-fuchsia
  • riscv64gc-unknown-linux-musl
    • Relevant PRs: #82202
    • Incomplete platform support document
  • riscv64gc-unknown-netbsd
  • riscv64gc-unknown-openbsd
  • riscv64-linux-android
  • s390x-unknown-linux-musl
    • Relevant PRs: #107127, #82166
    • Incomplete platform support document
  • sparc-unknown-linux-gnu
    • Relevant PRs: #114496, #48297
    • Incomplete platform support document
  • sparc-unknown-none-elf
  • sparc64-unknown-netbsd
  • sparc64-unknown-openbsd
  • thumbv4t-none-eabi
  • thumbv5te-none-eabi
  • thumbv7a-pc-windows-msvc
    • Relevant PRs: #53621
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • thumbv7a-uwp-windows-msvc
    • Relevant PRs: #63155
    • Incomplete platform support document
  • thumbv7neon-unknown-linux-musleabihf
    • Relevant PRs: #66103
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • wasm64-unknown-unknown
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • x86_64-apple-ios-macabi
  • x86_64-apple-tvos
    • Table row in platform support index is incomplete
    • Otherwise compliant
  • x86_64-apple-watchos-sim
  • x86_64-pc-nto-qnx710
  • x86_64-pc-windows-gnullvm
  • x86_64-pc-windows-msvc
    • Target exists in two tiers - only in Tier 3 for Windows XP
    • Removed, this seems like a incorrect use of the tier system
  • x86_64-sun-solaris
    • Relevant PRs: #31078, #82216
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • x86_64-unikraft-linux-musl
  • x86_64-unknown-dragonfly
    • Relevant PRs: #20024
    • Incomplete platform support document
  • x86_64-unknown-haiku
    • Relevant PRs: #36727, #51757
    • Incomplete platform support document
  • x86_64-unknown-hermit
  • x86_64-unknown-l4re-uclibc
    • Relevant PRs: #43639, #85967, #48725, #44011
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • x86_64-unknown-linux-ohos
  • x86_64-unknown-openbsd
  • x86_64-uwp-windows-gnu
    • Relevant PRs: #60260
    • Incomplete platform support document
  • x86_64-uwp-windows-msvc
    • Relevant PRs: #63155
    • Incomplete platform support document
  • x86_64-wrs-vxworks
    • Relevant PRs: #61946
    • Incomplete platform support document
    • Table row in platform support index is incomplete
  • x86_64h-apple-darwin

I intend to go through each of these to try and fix them, but I encourage all contributions helping out!

  • Please help! If you're interested in being responsible for one of these targets, send me a PR to this PR's branch, adding yourself to the target maintainer list and complete the platform support document.
  • I'll do plenty of squashing to keep the number of commits managable but I'll preserve any contributions in co-authorship.
  • Feel free to make multiple targets point to the same platform support document if it makes sense to do. I did this when I could identify that targets were added together, or where they already were.

cc rust-lang/rust-forge#255
r? @wesleywiser

Update target tier policy to require that targets be able to produce
object code with a supported backend.

Signed-off-by: David Wood <[email protected]>
Signed-off-by: David Wood <[email protected]>
Signed-off-by: David Wood <[email protected]>
@wesleywiser
Copy link
Member

  • The *-uwp targets currently have no one maintaining them as far as I'm aware

That matches my understanding as well.

  • I believe thumbv7a (arm32) will not be supported by Microsoft going forward. In any case they should probably have dedicated maintainers, how to test, etc.

That's correct and dotnet is also dropping support for thumbv7a/arm32 Windows in the next major version.

@petrochenkov
Copy link
Contributor

@davidtwco
Could you move the infrastructural changes in rustc_target (moving subdirectories, etc) to a separate PR (while also considering #116004 (comment))?
I'll then review and merge it sooner, before info for all the individual targets is populated.

@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 21, 2023
@@ -0,0 +1,17 @@
// assembly-output: emit-asm
// compile-flags: --target aarch64_be-unknown-netbsd
// needs-llvm-components: aarch64
Copy link
Member

Choose a reason for hiding this comment

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

How identical are these tests? Does the assembly test suite support revisions? Would it be worth having a single test with a revision for each target, instead of tons of files?

@bors
Copy link
Contributor

bors commented Sep 21, 2023

☔ The latest upstream changes (presumably #115230) made this pull request unmergeable. Please resolve the merge conflicts.

@@ -0,0 +1,17 @@
// assembly-output: emit-asm
// compile-flags: --target s390x-unknown-linux-gnu
// needs-llvm-components: s390x
Copy link
Member

Choose a reason for hiding this comment

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

@cuviper are you saying this should say systemz?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, that's what the component is named in LLVM.

@ehuss
Copy link
Contributor

ehuss commented Sep 22, 2023

I'm a little concerned about the proliferation of over 200 new chapters in the rustc book. It can overwhelm the navigation, and generally a be a bit too much. Would it be possible to consider the following changes to mitigate that?

  • Don't split targets that share a common file, and retain the * groupings that existed before.
  • Or, use sub-chapters with folding to hide the huge list. For example, it could have separate sub-chapters like "Windows", "Apple", "Wasm", "Linux", "Bare", "Other". Or the sub-chapters could be the tier levels. Or just a single sub-chapter ("Platforms") under the policy chapters. Then use folding (in book.toml) so that they don't all appear at once:
[output.html.fold]
enable = true
level = 1

**Tier: 2**

| Target | Tier | Description |
| ============================== | ====================== | =============================================== |
Copy link
Contributor

@ehuss ehuss Sep 22, 2023

Choose a reason for hiding this comment

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

All of these tables do not render correctly. I believe the header separator must use ----, not ====.

@RalfJung
Copy link
Member

There will also be a lot of redundancy across these target pages, e.g. once we start documenting things that are wrong with particular targets (such as #113053). However, for those kinds of problems, grouping the pages by OS wouldn't be helpful -- we'd want them grouped by architecture.

@ecnelises
Copy link
Contributor

Is it really necessary to list every triple in platform-support document?

Triple consists of arch-variant-vendor-os-abi, variant and abi are optional, single vendor seldom differentiates targets, maintainer or build info of some OS for all architectures do not make sense. So arch-os is usually enough, and details can be explained in full triple docs if necessary.

@he32
Copy link
Contributor

he32 commented Oct 21, 2023

* NetBSD’s platform support page had some targets listed that no longer existed or had different names (e.g. `amd64` to `x86_64` and `mipsel` removed) - I’ve updated it to reflect the targets which exist.

Uh-oh. I care about this. It's evident that I need to get off my butt and upstream the mipsel bits, they currently live as patches in our pkgsrc package.

* [ ]  `x86_64-unknown-netbsd`
  
  * NetBSD's platform support page had some targets listed that no longer existed or had different names (e.g. `amd64` -> `x86_64` and `mipsel` removed) - I've updated it to reflect the targets which exist
  * This target otherwise complies, it's only marked as incomplete so the above gets a look.

Ditto, I'll take a look. "No longer existed" for mipsel is rather "exists elsewhere, not yet upstreamed"; will make a push for having those bits applied "here" instead.

Comment on lines +1 to +17
// assembly-output: emit-asm
// compile-flags: --target asmjs-unknown-emscripten
// needs-llvm-components: webassembly

#![feature(no_core, lang_items)]
#![no_std]
#![no_core]
#![crate_type = "lib"]

#[lang = "sized"]
trait Sized {}

pub fn test() -> u8 {
42
}

// CHECK: .section
Copy link
Member

Choose a reason for hiding this comment

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

Being able to write an assembly test here does not mean that this target generates the correct code: the object code this target currently generates is instead wasm, which allows it to pass the "does it generate assembly" question, but will not actually be asm.js (and makes the target redundant with wasm32-unknown-emscripten).

@Noratrieb
Copy link
Member

Noratrieb commented Oct 29, 2023

In addition to specific targets, it may be useful to have maintainers for specific architectures for issues like #117347. Really, maybe our target maintainership should be a bit more two-dimensional? Maintainers for arches and maintainers for OS/platform. This would significantly reduce the amount of necessary files and would be more useful in practice I think. There are of course exceptions like consoles that are very "single target" focused, but for something like powerpc-unknown-openbsd, it's probably more useful to have "the powerpc people" and "the openbsd people" who will then be consulted depending on the specifics of the kind of problem with the target. The actual "owner" of the target will probably be the OS people, but with this we could reduce the huge list by just listing the target as "openbsd", and having a different table somewhere for the arch specific maintainers for arch questions.

@he32
Copy link
Contributor

he32 commented Oct 30, 2023

I have taken steps to retain the mipsel-unknown-netbsd target, ref. #117356.

@RalfJung
Copy link
Member

RalfJung commented Nov 2, 2023

In addition to specific targets, it may be useful to have maintainers for specific architectures for issues like #117347. Really, maybe our target maintainership should be a bit more two-dimensional? Maintainers for arches and maintainers for OS/platform.

It would also be great to have an easier way to ping them. Right now it is quite cumbersome. We could maybe utilize ping groups for that?

@davidtwco
Copy link
Member Author

I got busy and let this bitrot a little too much, so I'm going to close this PR and take a different approach taking into account a lot of the feedback here. If you sent me information about your targets then I've kept track of that and will make use of it. If you have more feedback on this then feel free to continue to comment here or message me on Zulip.

@davidtwco davidtwco closed this Nov 8, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 8, 2023
…=petrochenkov

target: move base and target specifications

Follow-up to rust-lang#116004.

In anticipation of later PRs where we'll want to add tidy checks to ensure that, for each target, we have a test or a platform support document or something like that, this PR moves target specifications into a directory on their own so that we can just list the files in this directory to get a list of all targets.

- Base specifications are moved to `rustc_target::spec::base`.
- Target specifications are moved to `rustc_target::spec::targets`.
- All the other source files containing types used in the target specs remain in `rustc_target::spec`.
  - `rustc_target/src/spec/abi.rs` is moved to `rustc_target/src/spec/abi/mod.rs` (where there was already a `tests.rs`) for uniformity.

r? `@petrochenkov`
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 8, 2023
…=petrochenkov

target: move base and target specifications

Follow-up to rust-lang#116004.

In anticipation of later PRs where we'll want to add tidy checks to ensure that, for each target, we have a test or a platform support document or something like that, this PR moves target specifications into a directory on their own so that we can just list the files in this directory to get a list of all targets.

- Base specifications are moved to `rustc_target::spec::base`.
- Target specifications are moved to `rustc_target::spec::targets`.
- All the other source files containing types used in the target specs remain in `rustc_target::spec`.
  - `rustc_target/src/spec/abi.rs` is moved to `rustc_target/src/spec/abi/mod.rs` (where there was already a `tests.rs`) for uniformity.

r? ``@petrochenkov``
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2023
Rollup merge of rust-lang#117702 - davidtwco:target-tier-refactors, r=petrochenkov

target: move base and target specifications

Follow-up to rust-lang#116004.

In anticipation of later PRs where we'll want to add tidy checks to ensure that, for each target, we have a test or a platform support document or something like that, this PR moves target specifications into a directory on their own so that we can just list the files in this directory to get a list of all targets.

- Base specifications are moved to `rustc_target::spec::base`.
- Target specifications are moved to `rustc_target::spec::targets`.
- All the other source files containing types used in the target specs remain in `rustc_target::spec`.
  - `rustc_target/src/spec/abi.rs` is moved to `rustc_target/src/spec/abi/mod.rs` (where there was already a `tests.rs`) for uniformity.

r? ``@petrochenkov``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

"Legacy" tier 2 targets have misplaced or absent maintainer docs