Skip to content

Commit

Permalink
disabled darwin-x86_64 as it's unsupported for some time
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn committed Aug 15, 2024
1 parent 684d57d commit 10eb8d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 6 additions & 4 deletions crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ pub mod sync;
// The current version of the sandbox node we want to point to.
// Should be updated to the latest release of nearcore.
// Currently pointing to nearcore@v2.0.0 released on August 5, 2024
pub const DEFAULT_NEAR_SANDBOX_VERSION: &str = "2.0.0/1e199ded60b51fa8d4f1001491a0c39c92393ff0";
pub const DEFAULT_NEAR_SANDBOX_VERSION: &str = "2.0.0";

const fn platform() -> Option<&'static str> {
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
return Some("Linux-x86_64");

// Darwin-x86_64 is not supported for some time now.
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
return Some("Darwin-x86_64");
return None;

#[cfg(all(target_os = "macos", target_arch = "aarch64"))]
return Some("Darwin-arm64");
Expand Down Expand Up @@ -95,8 +96,9 @@ pub fn install_with_version(version: &str) -> anyhow::Result<PathBuf> {
// Download binary into temp dir
let bin_name = format!("near-sandbox-{}", normalize_name(version));
let dl_cache = Cache::at(&download_path(version));
let bin_path = bin_url(version)
.ok_or_else(|| anyhow!("Unsupported platform: only linux-x86 and macos are supported"))?;
let bin_path = bin_url(version).ok_or_else(|| {
anyhow!("Unsupported platform: only linux-x86 and darwin-arm are supported")
})?;
let dl = dl_cache
.download(true, &bin_name, &["near-sandbox"], &bin_path)
.map_err(anyhow::Error::msg)
Expand Down
5 changes: 5 additions & 0 deletions npm/.changeset/slimy-tables-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"near-sandbox": patch
---

Updated sandbox to 2.0.0 release. Removed ability to fetch darwin-x86_64 as it is not working for quite some time"
5 changes: 3 additions & 2 deletions npm/src/getBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ function getPlatform() {
const type = os.type();
const arch = os.arch();

if ((type === "Linux" || type === "Darwin") && arch === "x64") {
// Darwind x86_64 is not supported for quite some time :(
if (type === "Linux" && arch === "x64") {
return [type, "x86_64"];
} else if (type === "Darwin" && arch === "arm64") {
return [type, "arm64"];
Expand All @@ -17,7 +18,7 @@ function getPlatform() {

export function AWSUrl(): string {
const [platform, arch] = getPlatform();
return `https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${platform}-${arch}/2.0.0/1e199ded60b51fa8d4f1001491a0c39c92393ff0/near-sandbox.tar.gz`;
return `https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore/${platform}-${arch}/2.0.0/sandbox.tar.gz`;
}

export function getBinary(name: string = "near-sandbox"): Promise<Binary> {
Expand Down

0 comments on commit 10eb8d2

Please sign in to comment.