Skip to content

compiletest: technically potential false positives for filecheck annotations #125825

Closed

Description

@jieyouxu

This is a fun one: in #121561 I added checks to error if we detect any legacy-directives-like comments (which are of the form // <known_directive_name>.

In codegen tests, we have filecheck directives that can be revisioned:

//@ revisions: known_directive_name
// known_directive_name: noundef

... but unfortunately, // known_directive_name looks like a legacy directive to compiletest so we might error here even though it is not actually a legacy directive (it just "looks" like one for the heuristic I added).

Technically a bug (false positive), but in practice changing the revision name to something else would sidestep this check.

Note: the legacy directive check would also fire on

// this is a block of comment that has a
// ignore in the middle of the sentence
// that looks like a legacy directive

Activity

  1. added
    A-testsuiteArea: The testsuite used to check the correctness of rustc
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    A-compiletestArea: The compiletest test runner
    on May 31, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on May 31, 2024
  3. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on May 31, 2024
  4. jieyouxu commented on May 31, 2024

    @jieyouxu
    MemberAuthor

    Realized this in #125813 (comment), the long term solution is probably to have compiletest directive handling be cooperative between "base" directives and test suite "customized" directives.

  5. workingjubilee commented on Jun 1, 2024

    @workingjubilee
    Member

    fwiw despite noting the issue, I think the prefix doesn't matter too much: I reviewed FileCheck's code (as much as I understood it, anyways) and it seems FileCheck is very simple. I don't think it is aware of any comment styles itself. I think it literally just scans for the prefix on a line and assumes you won't introduce code that resembles a FileCheck directive.

  6. moved this from Needs Triage / Backlog to Ready in compiletest maintenance and improvementson Jun 9, 2024
  7. jieyouxu commented on Oct 17, 2024

    @jieyouxu
    MemberAuthor

    compiletest triage: I deleted the legacy directive check so this is no longer a problem.

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-compiletestArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions