Skip to content

process bug: stabilization of extended_varargs_abi_support without FCP? #136896

Closed

Description

@workingjubilee

In #116161 the extended_varargs_abi_support feature was stabilized, effectively without a stabilization report. As far as I can find, it was also without an FCP for either relevant team, neither T-compiler nor T-lang. It seems like it wasn't really discussed extensively, or at least I can't find the meat of the discussion? I am guessing people felt it was conceptually good to go ahead... but no FCP was initiated, and there was no RFC for it either.

There is a bit of confusion to me on this point because extern "system", on the (ahem) systems where it is meaningful (i.e. distinct from extern "C" in some way), is translated to extern "stdcall" which is incompatible in varargs. In the PR where extern "system" was added to extended_varargs_abi_support, it was proposed to make extern "system" transparently translate to extern "C" when varargs are involved because sometimes the MSVC toolchain will make that implicit translation: #119587 (comment)

However, in #87678 we added a future compatibility warning specifically for the fact that we realized, a bit late, that we didn't actually want to support this sort of implicit ABI translation, and preferred to have these names be, er... meaningful? We had decided we wanted to limit the use of these ABIs to cases where they had an explicit and clearly indicated meaning, so that we can e.g. give them the meanings they may need to have if they are in fact given such a meaning in the future... or at least not have pointless confusion.

Thus there are a few problems, mostly about process:

  • A decision that needed an FCP (from some team) glided through without one?
  • The initial feature kept feature-creeping through gradual additions without much discussion and the "has this been suitably reflected on?" checking process (a stability report) did not kick in, resulting in a decision that seems inconsistent being made without apparent discussion of that inconsistency.

Activity

  1. added
    A-ABIArea: Concerning the application binary interface (ABI)
    C-bugCategory: This is a bug.
    I-compiler-nominatedNominated for discussion during a compiler team meeting.
    I-lang-nominatedNominated for discussion during a lang team meeting.
    on Feb 12, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 12, 2025
  3. added
    T-langRelevant to the language team
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    A-metaArea: Issues & PRs about the rust-lang/rust repository itself
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 12, 2025
  4. workingjubilee commented on Feb 12, 2025

    @workingjubilee
    MemberAuthor

    I will admit that I noticed all this because I was working out a way to map between all the ABIs that we have that effectively alias each other so that some of our tooling can emit useful errors when we catch an ABI-incompatible call in e.g. miri, as on some platforms the following is perfectly valid and the truth of the matter can only be determined via dynamic checks:

    extern "system" {
        fn system_abi_function(input: i32);
    }
    mem::transmute::<_, extern "C" fn()>(system_abi_function)(5i32)

    The "extern "system" but it's varargs" case introduced a surprising amount of complication in the implementation I was working on, which prompted me to take a closer look, along with @chorman0773, at everything. Such a complication may make it less likely that our error messages will be correct, useful, or understood, though I haven't worked through all the parts of it... we noticed the recent stabilization, were surprised, and @jieyouxu noticed this was a stabilization without an FCP, at which point I kinda dropped everything.

    Anyway, I will divert any further comments on the practical end of this to #100189 or related issues.

  5. added a commit that references this issue on Feb 12, 2025
  6. apiraino commented on Feb 12, 2025

    @apiraino
    Contributor

    Given the context I am slowly trying to get about this topic, I think this was an evaluation error from both T-lang and T-compiler, we stabilized something that shouldn't. If reverting in #136897 won't cause now any problems, I think it would make sense to do that.

    The other question is of course why was it stabilized in the first place: were the approvals given with enough context? That's probably why the FCP could have helped (getting more expert eyes). AFAICS the rough timeline was:

  7. jieyouxu commented on Feb 12, 2025

    @jieyouxu
    Member

    I suspect it was a misunderstanding that everyone thought T-lang approved (or rather, FCP'd somewhere, including T-lang ppl themselves). There was also a later T-compiler triage meeting general "in favor" vibe check, which I suspect added to the misunderstanding.

  8. apiraino commented on Feb 12, 2025

    @apiraino
    Contributor

    @workingjubilee to be sure I understand: the technical discussion about the revert should happen in #136897 and this issue is to discuss a procedure failure (or misunderstanding), correct? Asking because the former one could probably be quickly approved and pushed forward in the short time we have before the release. OTOH the discussion about procedures maybe takes more time (ref: the recent discussion about a better, cross-team, process for stabilizations)

  9. jieyouxu commented on Feb 12, 2025

    @jieyouxu
    Member

    @apiraino The revert PR (#136897) is already in the queue but will need T-compiler (or T-lang) approval for beta-backport1 (in fact, it's being tested right now), this issue is specifically to discuss the process problem (and maybe how we can make this less likely to happen in the future).

    Footnotes

    1. This should be very easy because it never went through FCP ↩

  10. 4 remaining items

  11. RalfJung commented on Feb 12, 2025

    @RalfJung
    Member

    I would argue #119587 is the one that should have been reverted. But anyway, reverting the stabilization is definitely the safer choice.

  12. workingjubilee commented on Feb 12, 2025

    @workingjubilee
    MemberAuthor

    Well, I have beef with the stabilization too, because I agree with Waffle. I feel like the hack here is definitely "submit a stabilization PR without including anything resembling a stabilization report, allowing everyone to project their own idea of what it means onto it, and thereby get effectively anything approved".

    This is funny/sad to me because anyone who writes a reasonably thorough stabilization report, even if they also make it concise and understandable, almost always gets a little more discussion of it... and thus delays. Sometimes just a day or two, but even then, whatever needs to happen to unclog that delay can be surprisingly frustrating. That makes it feel like writing a correct stability report is punished, while doing nothing is seemingly rewarded?

    It's not like there was much to talk about here, at least for the original feature. The stability report for that feature could have been like a paragraph. With extern "system" it gets a lot weirder.

  13. chorman0773 commented on Feb 12, 2025

    @chorman0773
    Contributor

    Yes, at the very least, IMO we should follow the proper process here. And who knows - maybe someone will uncover something else spicy in this matter that deserves at least discussion. So reverting the stabilization is probably the right call here. At the very least, to give us some breathing room to get a proper look over of a stabilization report.

  14. RalfJung commented on Feb 12, 2025

    @RalfJung
    Member

    Ah true, the lack of an FCP definitely means we should revert.

    @workingjubilee The stabilization PR took two months from submission to merging. That doesn't look to me like it was "rewarded" or moved particularly fast.

  15. workingjubilee commented on Feb 12, 2025

    @workingjubilee
    MemberAuthor

    oh, well, that's true, I guess I'm assuming the taking forever is almost a constant, thus the "punishment" is a relatively mild "forever + 1" :^)

  16. traviscross commented on Feb 18, 2025

    @traviscross
    Contributor

    @rustbot labels -I-lang-nominated

    We discussed this in the lang call on 2025-02-12. Obviously we were in support of the revert.

    On the process matter, historically, sometimes we have just waved things through when they seemed perfunctory and especially if we also had the full team together.1 Even by September, when this was waved though under those and some other unique circumstances, we were doing less of that when it involved any kind of stabilization, and we've since moved toward doing that even less often.

    Clearly something more in the way of a stabilization report might have helped here too.

    Anyway, exceptional though this case was in many ways, you'll get no argument from us that this could have gone better, and we expect that changes we've already made since September will help here.

    Something that came up in our discussion was that it'd be good if we could put together ping groups for special areas of expertise, not otherwise covered by our subteams, so that we have something to reach for on matters related to those areas. We'll think about how to best follow up on that.

    Footnotes

    1. Think, e.g., of the routine kind of judgment calls we make in deciding whether something is actually a bug fix or whether it falls near enough to something we've already approved. ↩

  17. removed
    I-lang-nominatedNominated for discussion during a lang team meeting.
    on Feb 18, 2025
  18. RalfJung commented on Feb 20, 2025

    @RalfJung
    Member

    T-lang #116161 (comment) (I have no logs of the discussion)

    @workingjubilee managed to find the meeting notes for that: https://hackmd.io/foOkwHNPRA2YFi4CMxEcoA

  19. apiraino commented on Feb 25, 2025

    @apiraino
    Contributor

    Pasting here some thoughts during the discussion on Zulip
    (relevant comments from here).

    • The lack of a stabilization report or an FCP for it was overlooked, so this is a bug that slipped in (comment)
    • Then some assumptions were given (t-compiler r+ was given because T-lang approval made it look like they decided on a stabilization report)
    • Nikos' stabilization template could help keeping track of implementation history and important design decisions (I think relevant Zulip thread, see stabilization template, docs rustc-dev-guide#2219)
    • Pinging relevant groups could also be an idea (suggested in comment)

    I think the TL;DR could be: next time let's all pay more attention and ensure to crosslink documentation (report, FCP, ...) needed to rubberstamp a stabilization.

    @rustbot label -I-compiler-nominated

  20. jieyouxu commented on Feb 25, 2025

    @jieyouxu
    Member

    Nikos' stabilization template could help keeping track of implementation history and important design decisions (I think relevant Zulip thread, unsure where work is happening though)

    rust-lang/rustc-dev-guide#2219

  21. jieyouxu commented on Feb 25, 2025

    @jieyouxu
    Member

    rubberstamp a stabilization

    I think Niko's stabilization template is exactly to help avoid making stabilizations seem like a rubberstamp process, since without sufficient context, it's not feasible for stabilization reviewers to try to dig through all relevant discussions/context/history/decisions themselves, especially if they aren't closely involved in the feature development.

  22. added 2 commits that reference this issue on Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)A-metaArea: Issues & PRs about the rust-lang/rust repository itselfC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions