Lang/RfL meeting 2024-12-18

Attendance

People: David Wood, Boqun Feng, Gary Guo, Nell Shamrell-Harrington, Benno Lossin, Wesley Wiser, TC, Alona Enraght-Moony, Urgau, Miguel Ojeda, Josh Triplett, Niko Matsakis

Tracking

Tracking issue

Overriding flags

https://rust-lang.zulipchat.com/#narrow/channel/425075-rust-for-linux/topic/Support.20overriding.20all.20flags/near/486988024

davidtwco: I implemented a initial version of this (allowing --edition 2018 --edition 2024 to be passed, and equiv to --edition 2024), not polished up yet, but roughly what this would look like - https://github.com/rust-lang/rust/commit/3f64339755fdacbc68a2c77bb33a6d3cbb08aa77

-Ztarget-spec

davidtwco: I had implemented a flag to construct a target spec json file by passing arguments, rather than a file - this wasn't exactly what RfL needed, as it doesn't address the stability of the format (it wasn't obvious that the stability of the format was the issue, not stability of the interface)

davidtwco: https://github.com/rust-lang/rust/compare/master...davidtwco:rust:target-spec-flags#diff-da8ab8d4ff5e32307e0c1da1898f8f76315f2835f19c266ccb035eb29f0f014f

wesley: are there missing codegen flags that means you're relying on target-spec-json

Miguel: These are some of the flags that we've been discussing so far.

  • rustc: arch-related flags and target features/modifiers (so far):

    • arm64: -Zbranch-protection, -Zfixed-x18, -Zuse-sync-unwind.
    • x86: -Zcf-protection, -Zfunction-return, -Zno-jump-tables, -Zpatchable-function-entry, retpoline (+retpoline-external-thunk,+retpoline-indirect-branches,+retpoline-indirect-calls), SLS (+harden-sls-ijmp,+harden-sls-ret).
    • x86 32-bit: -Zregparm=3, -Zreg-struct-return.
    • LoongArch: -Zdirect-access-external-data.
  • rustc: production sanitizer flags: -Zsanitizer=shadow-call-stack, -Zsanitizer=kcfi, -Zsanitizer-cfi-normalize-integer.

Things that are still in the target.spec JSON:

retpoline (+retpoline-external-thunk,+retpoline-indirect-branches,+retpoline-indirect-calls), SLS (+harden-sls-ijmp,+harden-sls-ret)

https://github.com/Rust-for-Linux/linux/blob/rust-next/scripts/generate_rust_target.rs

wesley: conclusion seems to be that target.spec JSON isn't needed for stable RfL provided we have a stable way of building libcore with the codegen flags RfL needs.

rustdoc: a way to extract doctests

Currently we use a very brittle hack based on --no-run and --test-builder ("the rustdoc hack"), becuase we need to execute doctests in kernelspace.

Context: https://rust-lang.zulipchat.com/#narrow/channel/425075-rust-for-linux/topic/what's.20the.20rustdoc.20hack.3F/near/482758093

alona: A load of other people want a JSON output of doctests:

This is very analogous to the existing rustdoc-json. Presidence there for versioning, etc. @aDotInTheVoid (current maintainer of this) happy to review, but no capacity to impliment for the forseeable future.

Seems do-able on nightly, stabilizing requires being certain that the format will evolve in a backwards-compatable way.

Miguel: On the kernel side, we mostly need file (path?), line number, column number, the test name (?), the actual text/source code, the "properties" (e.g. ignore).

On the kernel side, we are happy to support several formats if needed it shouldn't be too hard.

Reviewing our existing work items

Summary: we've completed all language items but arbitrary self types, and the heavy lifting there is done. We have diagnostic work to do and then we want to get some feedback but we expect to be able to move to stabilization soon.

Arbitrary self types

The bulk of the impl work has landed, crater run showed no fallout. The only known outstanding work is improving diagnostics.

After that the next step will be stabilization. The main blocker is having some folks to play around with it and ensuring that it meets all the use cases it was meant to meet.

Derive smart pointer

  • CoercePointee stabilization report was posted #133820
  • and this is now in FCP

asm_goto

Compiler flags like fixed-x18

This will roll over to next year. We made good progress this half-year, with Alice authoring an RFC for the overall approach around the compiler. We are working on the implementation now.

Debian

TC: Are we going to get Rust 2024 into Debian Stable?

Josh: Maybe, they're aware of the deadline, but it's not clear if the schedule will make this possible. They're going to try.

Josh: Also, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1088260

build-std

Wesley: In the short term, we just need something to build core for RfL. But in the medium term, build-std will be stable, and we want it to support RfL and other users.

davidtwco: discussion with libs team on dependency lock: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/.E2.9C.94.20Build-std.20and.20std's.20Cargo.2Elock

Select a repo