Skip to content

Commit

Permalink
Remove arm64 download option
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonGrodin committed Sep 1, 2024
1 parent 08ed1ef commit 4b6cb58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,10 @@ function acquireNJ(version) {
function defaultBits(version) {
return semver.satisfies(format(version), ">=110.98") ? 64 : 32;
}
function getArchitecture(version, armAllowed = false) {
function getArchitecture(version) {
switch (process.platform) {
case "darwin":
core.debug(`process.arch = ${process.arch}`);
return defaultBits(version) == 32 ? "x86" :
armAllowed && process.arch.startsWith("arm") ? "arm64" : "amd64";
return defaultBits(version) == 32 ? "x86" : "amd64";
case "linux":
return "amd64";
default:
Expand All @@ -71,7 +69,7 @@ function getArchitecture(version, armAllowed = false) {
function acquireNJGitHub(version) {
return __awaiter(this, void 0, void 0, function* () {
yield exec.exec("git", ["clone", "--depth", "1", "--branch", "v" + version, "--recurse-submodules", "https://github.com/smlnj/smlnj.git"]);
let filename = util.format("boot.%s-unix.tgz", getArchitecture(version, true));
let filename = util.format("boot.%s-unix.tgz", getArchitecture(version));
let downloadUrl = util.format("https://smlnj.org/dist/working/%s/%s", version, filename);
core.debug(`Downloading SML/NJ from: ${downloadUrl}`);
try {
Expand Down
8 changes: 3 additions & 5 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ function defaultBits(version: string): 32 | 64 {
return semver.satisfies(format(version), ">=110.98") ? 64 : 32;
}

function getArchitecture(version: string, armAllowed: boolean = false): string {
function getArchitecture(version: string): string {
switch (process.platform) {
case "darwin":
core.debug(`process.arch = ${process.arch}`);
return defaultBits(version) == 32 ? "x86" :
armAllowed && process.arch.startsWith("arm") ? "arm64" : "amd64";
return defaultBits(version) == 32 ? "x86" : "amd64";
case "linux":
return "amd64";
default:
Expand All @@ -59,7 +57,7 @@ function getArchitecture(version: string, armAllowed: boolean = false): string {
async function acquireNJGitHub(version: string): Promise<string> {
await exec.exec("git", ["clone", "--depth", "1", "--branch", "v" + version, "--recurse-submodules", "https://github.com/smlnj/smlnj.git"]);

let filename: string = util.format("boot.%s-unix.tgz", getArchitecture(version, true))
let filename: string = util.format("boot.%s-unix.tgz", getArchitecture(version))

let downloadUrl: string = util.format(
"https://smlnj.org/dist/working/%s/%s",
Expand Down

0 comments on commit 4b6cb58

Please sign in to comment.