Skip to content

cargo should provide builtin support to let build.rs detect feature is supported #12872

@loynoir

Description

@loynoir

Problem

There is a

  • 1 ~ 2 weeks project, with 1 ~ 2 weeks cache

  • recent RA v0.3.1705

  • deep dependency tree have recent version, thiserror-1.0.50 anyhow-1.0.75, same author dtolnay

I encounter same old bug on thiserror-1.0.50 anyhow-1.0.75.

  • #![feature] may not be used on the stable release channel`

This bug was happening one year ago, but then fix.

In conclusion, this is maybe a mix problem of

  • build.rs workaround to detect feature, such as error_generic_member_access, is supported

  • RA rustc wrapper for performance

  • sccache

  • cargo build cache

And I think the core problem is

  • cargo does not provide builtin support to let build.rs detect feature is supported, so dev invent themself.

Proposed Solution

cargo should provide builtin support to let build.rs detect feature is supported

Notes

Related

dtolnay/thiserror#192

https://github.com/dtolnay/thiserror/blob/e9ea67c7e251764c3c2d839b6c06d9f35b154647/build.rs#L12

https://github.com/dtolnay/anyhow/blob/05e413219e97f101d8f39a90902e5c5d39f951fe/build.rs#L17

rust-lang/rust-analyzer#15057

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-scriptsArea: build.rs scriptsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions