Skip to content

Commit

Permalink
perf: use raw.githubusercontent.com direct link to avoid 302 redire…
Browse files Browse the repository at this point in the history
…cts (#132)

Small performance optimization to avoid `302` redirect, requested in
foundry-rs/foundry#7440
  • Loading branch information
zerosnacks authored Jul 12, 2024
1 parent de5bd77 commit cc893b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/svm-rs/src/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ static OLD_SOLC_RELEASES: Lazy<Releases> = Lazy::new(|| {
const LINUX_AARCH64_MIN: Version = Version::new(0, 5, 0);

static LINUX_AARCH64_URL_PREFIX: &str =
"https://github.com/nikitastupin/solc/raw/57211f3e182ce7c2a7c0fdead02656d404d9b37a/linux/aarch64";
"https://raw.githubusercontent.com/nikitastupin/solc/57211f3e182ce7c2a7c0fdead02656d404d9b37a/linux/aarch64";

static LINUX_AARCH64_RELEASES_URL: &str =
"https://github.com/nikitastupin/solc/raw/57211f3e182ce7c2a7c0fdead02656d404d9b37a/linux/aarch64/list.json";
"https://raw.githubusercontent.com/nikitastupin/solc/57211f3e182ce7c2a7c0fdead02656d404d9b37a/linux/aarch64/list.json";

// NOTE: Since version 0.8.24, universal macosx releases are available: https://binaries.soliditylang.org/macosx-amd64/list.json
const MACOS_AARCH64_NATIVE: Version = Version::new(0, 8, 5);

const UNIVERSAL_MACOS_BINARIES: Version = Version::new(0, 8, 24);

static MACOS_AARCH64_URL_PREFIX: &str =
"https://github.com/alloy-rs/solc-builds/raw/e4b80d33bc4d015b2fc3583e217fbf248b2014e1/macosx/aarch64";
"https://raw.githubusercontent.com/alloy-rs/solc-builds/e4b80d33bc4d015b2fc3583e217fbf248b2014e1/macosx/aarch64";

static MACOS_AARCH64_RELEASES_URL: &str =
"https://github.com/alloy-rs/solc-builds/raw/e4b80d33bc4d015b2fc3583e217fbf248b2014e1/macosx/aarch64/list.json";
"https://raw.githubusercontent.com/alloy-rs/solc-builds/e4b80d33bc4d015b2fc3583e217fbf248b2014e1/macosx/aarch64/list.json";

/// Defines the struct that the JSON-formatted release list can be deserialized into.
///
Expand Down Expand Up @@ -300,7 +300,7 @@ mod tests {
assert_eq!(
artifact_url(Platform::LinuxAarch64, &version, artifact).unwrap(),
Url::parse(&format!(
"https://github.com/nikitastupin/solc/raw/57211f3e182ce7c2a7c0fdead02656d404d9b37a/linux/aarch64/{artifact}"
"https://raw.githubusercontent.com/nikitastupin/solc/57211f3e182ce7c2a7c0fdead02656d404d9b37a/linux/aarch64/{artifact}"
))
.unwrap(),
)
Expand Down

0 comments on commit cc893b6

Please sign in to comment.