Skip to content

Set the CARGO_PKG_README environment variable #11597

@nagisa

Description

@nagisa

Problem

Cargo may rewrite the package’s Cargo.toml and move the README file around, relative to the manifest. I would like to include_str!() this README in my lib.rs, but am unable to do so right now, because if I specify include_str!("../../README") it works for development, but I can’t package my crate. Conversely if I specify include_str!("../README") it works when packaged, but not during development.

Proposed Solution

Having an environment variable that would tell me where to find the README file would probably be the most straightforward option.

Notes

No response

Metadata

Metadata

Assignees

Labels

A-environment-variablesArea: environment variablesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: Easy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions