Support rust-toolchain version updates specifically #24762
Replies: 7 comments 2 replies
-
Hi there, Get your issue fixed faster by creating a minimal reproduction. This means a repository dedicated to reproducing this issue with the minimal dependencies and config possible. Before we start working on your issue we need to know exactly what's causing the current behavior. A minimal reproduction helps us with this. To get started, please read our guide on creating a minimal reproduction. We may close the issue if you, or someone else, haven't created a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
Beta Was this translation helpful? Give feedback.
-
Good evening! I am currently writing a project that uses a feature that is only available in nightly, So it would be nice if we could fix it to a specific nightly like The version of stable can be updated by using regex of renovate, P.S. For nightly, the version number is assigned a date, since it is built and published once a day. |
Beta Was this translation helpful? Give feedback.
-
Sounds like a new Renovate datasource may be required to get the nightly versions? |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think you need to add a new datasource or versioning. Either a datasource implementation to get the latest Rust nightly version, or a versioning implementation that always compares today's date with the given version. In the latter case, if a nightly build for today that has not yet been published is specified in rust-toolchain.toml, the previous day's build is automatically used. If possible, it would be preferable to implement a datasource that compares the latest nightly build at the time it is executed, but it needs to be investigated whether Rust provides an API or other means to do this. |
Beta Was this translation helpful? Give feedback.
-
@mirror-kt To address use cases like yours with the features available at the moment, you can let Renovate periodically update a stable Rust version through the regex manager feature described above. Then, during An alternative, less fragile albeit more complex solution, would be to use Renovate's custom datasources and create a file with today's date as the version when it's time to upgrade. Under normal circumstances, Rust nightlies are released daily, so it's guaranteed a nightly with the date will match. Depending on your requirements, periodically updating this version file and allowing Renovate to manage the rest may be more convenient than handling the toolchain upgrades entirely outside of Renovate. |
Beta Was this translation helpful? Give feedback.
-
Based on the suggestion from @AlexTMjugador I hacked together a cf worker for this, see https://github.com/phi-ag/renovate-rust-nightly . 🚀 {
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
":semanticCommits",
"config:best-practices",
"group:monorepos",
"group:recommended"
],
"customDatasources": {
"rust-nightly": {
"defaultRegistryUrlTemplate": "https://renovate-rust-nightly.phi-ag.workers.dev/"
}
},
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^rust-toolchain.toml$"],
"matchStrings": ["channel = \"nightly-(?<currentValue>.+?)\"\\n"],
"versioningTemplate": "regex:^(?<major>\\d{4})-(?<minor>\\d{2})-(?<patch>\\d{2})$",
"datasourceTemplate": "custom.rust-nightly",
"depNameTemplate": "rust-nightly"
}
]
} This still uses the hack where year = major, month = minor, day = patch (same problem with Minio releases). Please let me know if there is a better solution. |
Beta Was this translation helpful? Give feedback.
-
+1 for this. It looks like https://github.com/Turbo87/renovate-config/blob/master/rust/updateToolchain.json is being used by 10s of repositories, but it'd be nice for this to be built in and just-work. |
Beta Was this translation helpful? Give feedback.
-
What would you like Renovate to be able to do?
I'd like to have renovate itself to submit version bumps to the
channel
field of arust-toolchain.toml
file.It seems that it's possible to achieve this via a feature called "regex manager" and that there's a third party shareable config that does that.
But I'd feel more comfortable with a built-in feature.
If you have any ideas on how this should be implemented, please tell us here.
Implement a built in feature for this.
Is this a feature you are interested in implementing yourself?
No
Beta Was this translation helpful? Give feedback.
All reactions