Skip to content

Commit

Permalink
Merge pull request #67 from nim-lang/pr_fix_macos_updateself
Browse files Browse the repository at this point in the history
fixes macos arm64 update self
  • Loading branch information
ringabout authored Feb 5, 2025
2 parents e71f941 + c07b8b2 commit a46c3e2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
# ----------------------------------------------------------------------------
# this uses choosenim by itself - you may need to build manually if you break choosenim
build-macos:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: jiro4989/setup-nim-action@v2
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
file: ${{ runner.workspace }}/choosenim/bin/choosenim

build-macos_arm64:
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: jiro4989/setup-nim-action@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
# ----------------------------------------------------------------------------
# this uses choosenim by itself - you may need to build manually if you break choosenim
build-macos:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: jiro4989/setup-nim-action@v2
Expand All @@ -87,7 +87,7 @@ jobs:
nimble test
build-macos_arm64:
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: jiro4989/setup-nim-action@v2
Expand Down
3 changes: 2 additions & 1 deletion src/choosenim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ proc updateSelf(params: CliParams) =

# https://stackoverflow.com/a/9163044/492186
let tag = "v" & $version
let filename = "choosenim-" & $version & "_" & hostOS & "_" & hostCPU.addFileExt(ExeExt)
let cpuName = if isAppleSilicon(): "arm" else: hostCPU
let filename = "choosenim-" & $version & "_" & hostOS & "_" & cpuName.addFileExt(ExeExt)
let url = "https://github.com/nim-lang/choosenim/releases/download/$1/$2" % [
tag, filename
]
Expand Down
2 changes: 1 addition & 1 deletion src/choosenimpkg/switcher.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ proc isMacOSBelowBigSur(): bool =

return twoVersion < 11

proc isAppleSilicon(): bool =
proc isAppleSilicon*(): bool =
when not defined(macosx):
return false
else:
Expand Down

0 comments on commit a46c3e2

Please sign in to comment.