Skip to content

Add support for // only-cfg-target-has-atomic to compiletest #87377

Closed

Description

@jyn514

Right now, you have to specify the platforms and architectures you want by hand, which makes it easy to leave them out or include platforms you shouldn't. It would be nice to automate this - maybe with rustc --print cfg?

See also https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20can.20I.20ignore.20tests.20on.20platforms.20without.20atomics.3F.

Originally posted by @wesleywiser in #84039 (comment)

Activity

  1. added
    A-testsuiteArea: The testsuite used to check the correctness of rustc
    on Jul 22, 2021
  2. RalfJung commented on Jul 24, 2021

    @RalfJung
    Member

    Can't you use #[cfg(target_has_atomic)] in the test to basically stub it out?

  3. jyn514 commented on Jul 24, 2021

    @jyn514
    MemberAuthor

    @RalfJung no, because that will cause the test to fail (because it's missing the errors rustc would normally emit).

  4. RalfJung commented on Jul 24, 2021

    @RalfJung
    Member

    Ah, good point -- thanks!

  5. removed their assignment
    on Sep 20, 2022
  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
    Member

    compiletest triage: this should probably use the needs-* machinery for capability requirements, i.e. //@ needs-atomic or a better name.

  8. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Oct 17, 2024
  9. kei519 commented on Nov 13, 2024

    @kei519
    Contributor

    I want to try this as my first contribution. Is it ok?

    @rustbot claim

  10. jieyouxu commented on Nov 20, 2024

    @jieyouxu
    Member

    Apparently this is a bit more tricky than I expected initially.
    @rustbot label -E-easy +E-medium

  11. added
    E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
    and removed
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    on Nov 20, 2024
  12. added a commit that references this issue on Dec 2, 2024
  13. added a commit that references this issue on Dec 2, 2024
  14. jieyouxu commented on Dec 19, 2024

    @jieyouxu
    Member

    Implemented in #133736.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-compiletestArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcC-feature-requestCategory: A feature request, i.e: not implemented / a PR.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions