Skip to content

Commit

Permalink
update CI to macos 13 (#24157)
Browse files Browse the repository at this point in the history
Followup to #24154, packages aren't ready for macos 14 (M1/ARM CPU) yet
and it seems to be preview on azure, so upgrade to macos 13 for now.

Macos 12 gives a warning:

```
You are using macOS 12.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from Homebrew or its maintainers on social media.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
```

(cherry picked from commit 4a63186)
  • Loading branch information
metagn authored and narimiran committed Oct 9, 2024
1 parent 4fe17a2 commit e2ef322
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- target: windows
os: windows-2019
- target: osx
os: macos-12
os: macos-13

name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-12]
os: [ubuntu-20.04, macos-13]
cpu: [amd64]
batch: ["allowed_failures", "0_3", "1_3", "2_3"] # list of `index_num`
name: '${{ matrix.os }} (batch: ${{ matrix.batch }})'
Expand Down Expand Up @@ -48,6 +48,7 @@ jobs:
- name: 'Install dependencies (macOS)'
if: runner.os == 'macOS'
run: brew install boehmgc make sfml gtk+3
# XXX can't find boehm and gtk on macos 13
- name: 'Install dependencies (Windows)'
if: runner.os == 'Windows'
shell: bash
Expand Down
5 changes: 3 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
# vmImage: 'ubuntu-18.04'
# CPU: i386
OSX_amd64:
vmImage: 'macOS-12'
vmImage: 'macOS-13'
CPU: amd64
OSX_amd64_cpp:
vmImage: 'macOS-12'
vmImage: 'macOS-13'
CPU: amd64
NIM_COMPILE_TO_CPP: true
Windows_amd64_batch0_3:
Expand Down Expand Up @@ -130,6 +130,7 @@ jobs:
- bash: brew install boehmgc make sfml
displayName: 'Install dependencies (OSX)'
condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Darwin'))
# XXX can't find boehm on macos 13

- bash: |
set -e
Expand Down
2 changes: 1 addition & 1 deletion doc/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -5083,7 +5083,7 @@ It is possible to raise/catch imported C++ exceptions. Types imported using
`importcpp` can be raised or caught. Exceptions are raised by value and
caught by reference. Example:

```nim test = "nim cpp -r $1"
```nim
type
CStdException {.importcpp: "std::exception", header: "<exception>", inheritable.} = object
## does not inherit from `RootObj`, so we use `inheritable` instead
Expand Down
6 changes: 4 additions & 2 deletions testament/categories.nim
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ proc dllTests(r: var TResults, cat: Category, options: string) =
runBasicDLLTest c, r, cat, options & " -d:release --mm:refc"
runBasicDLLTest c, r, cat, options, isOrc = true
runBasicDLLTest c, r, cat, options & " -d:release", isOrc = true
when not defined(windows):
when not defined(windows) and not defined(osx):
# boehm library linking broken on macos 13
# still cannot find a recent Windows version of boehm.dll:
runBasicDLLTest c, r, cat, options & " --gc:boehm"
runBasicDLLTest c, r, cat, options & " -d:release --gc:boehm"
Expand All @@ -130,7 +131,8 @@ proc gcTests(r: var TResults, cat: Category, options: string) =

template test(filename: untyped) =
testWithoutBoehm filename
when not defined(windows) and not defined(android):
when not defined(windows) and not defined(android) and not defined(osx):
# boehm library linking broken on macos 13
# AR: cannot find any boehm.dll on the net, right now, so disabled
# for windows:
testSpec r, makeTest("tests/gc" / filename, options &
Expand Down
7 changes: 6 additions & 1 deletion testament/important_packages.nim
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ pkg "nesm", "nimble tests", "https://github.com/nim-lang/NESM", useHead = true
pkg "netty"
pkg "nico", allowFailure = true
pkg "nicy", "nim c -r src/nicy.nim"
pkg "nigui", "nim c -o:niguii -r src/nigui.nim"
when defined(osx):
# gives "could not load: libgtk-3.0.dylib" on macos 13
# just test compiling instead of running
pkg "nigui", "nim c -o:niguii src/nigui.nim"
else:
pkg "nigui", "nim c -o:niguii -r src/nigui.nim"
pkg "nimcrypto", "nim r --path:. tests/testall.nim" # `--path:.` workaround needed, see D20210308T165435
pkg "NimData", "nim c -o:nimdataa src/nimdata.nim"
pkg "nimes", "nim c src/nimes.nim"
Expand Down
1 change: 1 addition & 0 deletions tests/closure/tboehmdeepcopy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ discard """
cmd: "nim c --gc:boehm $options $file"
output: '''meep'''
disabled: "windows"
disabled: osx
"""

proc callit(it: proc ()) =
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/temitlist.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ discard """
output: '''
6.0
0'''
disabled: "windows" # pending bug #18011
"""

# bug #4730
Expand Down
1 change: 0 additions & 1 deletion tests/cpp/tempty_generic_obj.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ discard """
output: '''
int
float'''
disabled: "windows" # pending bug #18011
"""

import typetraits
Expand Down
38 changes: 38 additions & 0 deletions tests/cpp/tmanual_exception.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
discard """
# doesn't work on macos 13 seemingly due to libc++ linking issue https://stackoverflow.com/a/77375947
disabled: osx
targets: cpp
"""

# manual example

type
CStdException {.importcpp: "std::exception", header: "<exception>", inheritable.} = object
## does not inherit from `RootObj`, so we use `inheritable` instead
CRuntimeError {.requiresInit, importcpp: "std::runtime_error", header: "<stdexcept>".} = object of CStdException
## `CRuntimeError` has no default constructor => `requiresInit`
proc what(s: CStdException): cstring {.importcpp: "((char *)#.what())".}
proc initRuntimeError(a: cstring): CRuntimeError {.importcpp: "std::runtime_error(@)", constructor.}
proc initStdException(): CStdException {.importcpp: "std::exception()", constructor.}

proc fn() =
let a = initRuntimeError("foo")
doAssert $a.what == "foo"
var b: cstring
try: raise initRuntimeError("foo2")
except CStdException as e:
doAssert e is CStdException
b = e.what()
doAssert $b == "foo2"

try: raise initStdException()
except CStdException: discard

try: raise initRuntimeError("foo3")
except CRuntimeError as e:
b = e.what()
except CStdException:
doAssert false
doAssert $b == "foo3"

fn()
3 changes: 2 additions & 1 deletion tests/exception/tcpp_imported_exc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ finally 2
expected
cpp exception caught
'''
disabled: "windows" # pending bug #18011
# doesn't work on macos 13 seemingly due to libc++ linking issue https://stackoverflow.com/a/77375947
disabled: osx
"""

type
Expand Down

0 comments on commit e2ef322

Please sign in to comment.