diff options
| author | Johan Anderholm <johan.anderholm@axis.com> | 2026-04-27 15:51:23 +0200 |
|---|---|---|
| committer | Paul Barker <paul@pbarker.dev> | 2026-04-28 17:13:27 +0100 |
| commit | b0134a0f1382a267f79ec881af916d641d41b235 (patch) | |
| tree | 04d8698e40a8d63bb3db6ce299f53231f9302ed8 | |
| parent | 4a5e618f5713600552c6c3edb1bfaa42c4506789 (diff) | |
| download | poky-kirkstone.tar.gz | |
bitbake: fetch2/crate: use CDN for fetching crateskirkstone
This avoids the 1 req/sec that the API has.
Reference: https://github.com/rust-lang/crates.io/issues/13482
Reference: https://blog.rust-lang.org/2024/03/11/crates-io-download-changes/
[RP: Tweak to apply to 2.8]
(Bitbake rev: a9f09b9e2f187f07a6f6dfd1caa3fd2f3d564a8a)
Signed-off-by: Johan Anderholm <johanam@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Paul Barker <paul@pbarker.dev>
| -rw-r--r-- | bitbake/lib/bb/fetch2/crate.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/crate.py b/bitbake/lib/bb/fetch2/crate.py index f4ddc782a9..2c10eabb5e 100644 --- a/bitbake/lib/bb/fetch2/crate.py +++ b/bitbake/lib/bb/fetch2/crate.py | |||
| @@ -66,8 +66,11 @@ class Crate(Wget): | |||
| 66 | # if using upstream just fix it up nicely | 66 | # if using upstream just fix it up nicely |
| 67 | if host == 'crates.io': | 67 | if host == 'crates.io': |
| 68 | host = 'crates.io/api/v1/crates' | 68 | host = 'crates.io/api/v1/crates' |
| 69 | cdn_host = 'static.crates.io/crates' | ||
| 70 | else: | ||
| 71 | cdn_host = host | ||
| 69 | 72 | ||
| 70 | ud.url = "https://%s/%s/%s/download" % (host, name, version) | 73 | ud.url = "https://%s/%s/%s/download" % (cdn_host, name, version) |
| 71 | ud.parm['downloadfilename'] = "%s-%s.crate" % (name, version) | 74 | ud.parm['downloadfilename'] = "%s-%s.crate" % (name, version) |
| 72 | ud.parm['name'] = name | 75 | ud.parm['name'] = name |
| 73 | 76 | ||
