Skip to content

Commit

Permalink
Revert "Fix macOS 14 2024.X installation (#146)"
Browse files Browse the repository at this point in the history
This reverts commit ad079db.
  • Loading branch information
HarrisonGrodin authored Sep 2, 2024
1 parent ad079db commit f11622b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ jobs:
- ubuntu-latest
- macos-12
- macos-13
- macos-14
smlnj-version:
- 2024.1
- 2024.2
Expand Down
9 changes: 5 additions & 4 deletions lib/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ function acquireNJ(version) {
function defaultBits(version) {
return semver.satisfies(format(version), ">=110.98") ? 64 : 32;
}
function getArchitecture(version) {
function getArchitecture(version, armAllowed = false) {
switch (process.platform) {
case "darwin":
return defaultBits(version) == 32 ? "x86" : "amd64";
return defaultBits(version) == 32 ? "x86" :
armAllowed && process.arch.startsWith("arm") ? "arm64" : "amd64";
case "linux":
return "amd64";
default:
Expand All @@ -69,9 +70,9 @@ function getArchitecture(version) {
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));
let filename = util.format("boot.%s-unix.tgz", getArchitecture(version, true));
let downloadUrl = util.format("https://smlnj.org/dist/working/%s/%s", version, filename);
core.debug(`Downloading SML/NJ from: ${downloadUrl}`);
core.debug("Downloading SML/NJ from: " + downloadUrl);
try {
yield tc.downloadTool(downloadUrl, path.join("smlnj", filename));
}
Expand Down
9 changes: 5 additions & 4 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ function defaultBits(version: string): 32 | 64 {
return semver.satisfies(format(version), ">=110.98") ? 64 : 32;
}

function getArchitecture(version: string): string {
function getArchitecture(version: string, armAllowed: boolean = false): string {
switch (process.platform) {
case "darwin":
return defaultBits(version) == 32 ? "x86" : "amd64";
return defaultBits(version) == 32 ? "x86" :
armAllowed && process.arch.startsWith("arm") ? "arm64" : "amd64";
case "linux":
return "amd64";
default:
Expand All @@ -57,15 +58,15 @@ function getArchitecture(version: string): 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))
let filename: string = util.format("boot.%s-unix.tgz", getArchitecture(version, true))

let downloadUrl: string = util.format(
"https://smlnj.org/dist/working/%s/%s",
version,
filename
);

core.debug(`Downloading SML/NJ from: ${downloadUrl}`);
core.debug("Downloading SML/NJ from: " + downloadUrl);

try {
await tc.downloadTool(downloadUrl, path.join("smlnj", filename));
Expand Down

0 comments on commit f11622b

Please sign in to comment.