Page MenuHomeFreeBSD

Mk/bsd.sites.mk: Use non-ratelimited direct crates.io CDN link
AcceptedPublic

Authored by dch on Fri, Sep 11, 10:45 AM.
Tags
None
Referenced Files
F173278067: D59587.id186453.diff
Thu, Sep 24, 10:22 PM
F173277771: D59587.id186454.diff
Thu, Sep 24, 10:18 PM
F173277445: D59587.diff
Thu, Sep 24, 10:15 PM
Unknown Object (File)
Wed, Sep 23, 8:46 PM
Unknown Object (File)
Wed, Sep 23, 5:06 AM
Unknown Object (File)
Tue, Sep 22, 9:48 AM
Unknown Object (File)
Mon, Sep 21, 2:27 PM
Unknown Object (File)
Sun, Sep 20, 11:49 PM
Subscribers
None

Details

Reviewers
pkubaj
Group Reviewers
portmgr
rust
Summary

crates.io has rate limiting and user agent restrictions according to
https://crates.io/data-access and poudriere servers hit this quickly,
e.g.:

fetch: https://crates.io/api/v1/crates/whoami/2.1.3/download?dummy=/rust/crates/whoami-2.1.3.crate: Forbidden

Solution taken from:

I would also recommend that you download the files directly from the
CDN instead of going through our API servers: e.g.
https://static.crates.io/crates/libc/0.2.185/download or
https://static.crates.io/crates/libc/libc-0.2.185.crate. That addresses
the rate limit concern mentioned in NixOS/nixpkgs#512735 (comment) since
the 1 req/sec limit only applies to our API servers.

for completeness, the technically correct path for downloading crates
is: load https://index.crates.io/config.json, look at the dl key in the
JSON file, build the download URL via {dl}/{name}/{version}/download.

Test Plan

Works On My Machines. Perhaps people more familiar with the rust project ecosystem will know if this is the correct solution.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76767
Build 73650: arc lint + arc unit

Event Timeline

dch requested review of this revision.Fri, Sep 11, 10:45 AM
dch created this revision.
dch added reviewers: portmgr, rust.
dch added subscribers: rust, portmgr.
dch removed subscribers: portmgr, rust.

fix stray tab, the file is inconsistent

This revision is now accepted and ready to land.Tue, Sep 22, 8:05 AM