{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/2075","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/2075/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/2075/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/2075/events","html_url":"https://github.com/rust-lang/cargo/issues/2075","id":112869400,"number":2075,"title":"Feature request: single source of truth for crate versions","user":{"login":"Diggsey","id":451321,"avatar_url":"https://avatars.githubusercontent.com/u/451321?v=3","gravatar_id":"","url":"https://api.github.com/users/Diggsey","html_url":"https://github.com/Diggsey","followers_url":"https://api.github.com/users/Diggsey/followers","following_url":"https://api.github.com/users/Diggsey/following{/other_user}","gists_url":"https://api.github.com/users/Diggsey/gists{/gist_id}","starred_url":"https://api.github.com/users/Diggsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Diggsey/subscriptions","organizations_url":"https://api.github.com/users/Diggsey/orgs","repos_url":"https://api.github.com/users/Diggsey/repos","events_url":"https://api.github.com/users/Diggsey/events{/privacy}","received_events_url":"https://api.github.com/users/Diggsey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-22T19:04:14Z","updated_at":"2015-10-22T19:04:14Z","closed_at":null,"body":"Often you need to specify the crate version in several places:\r\n- Cargo.toml\r\n- CLI config file (to support --version)\r\n- Within the code itself\r\n\r\nAdditionally, you sometimes have several crates within the same repository, whose versions you want to keep in lock-step. The crate version must then additionally be specified:\r\n- In the sub-crate's Cargo.toml\r\n- Within the [dependencies] section of the parent Cargo.toml\r\n\r\nFor more complex projects, it's easy to imagine that there's other information which may be desirable, eg. git commit hash, build date, and additional configuration options (think rust's channel system).\r\n\r\nAll in all, this can make publishing a new version somewhat tedious and error-prone. Honestly I don't know what a good and general solution is that covers all of these cases.\r\n\r\nCurrently the only way I can see of doing it would be to turn most of the project into template files which are passed through a pre-processor by the build script, but this is extremely intrusive, and wouldn't work for redundancy within Cargo.toml itself."}}