mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
update CI to macos 13 (#24157)
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 4a63186cda)
This commit is contained in:
2
.github/workflows/ci_docs.yml
vendored
2
.github/workflows/ci_docs.yml
vendored
@@ -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 }}
|
||||
|
||||
3
.github/workflows/ci_packages.yml
vendored
3
.github/workflows/ci_packages.yml
vendored
@@ -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 }})'
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
@@ -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 &
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -2,6 +2,7 @@ discard """
|
||||
cmd: "nim c --gc:boehm $options $file"
|
||||
output: '''meep'''
|
||||
disabled: "windows"
|
||||
disabled: osx
|
||||
"""
|
||||
|
||||
proc callit(it: proc ()) =
|
||||
|
||||
@@ -3,7 +3,6 @@ discard """
|
||||
output: '''
|
||||
6.0
|
||||
0'''
|
||||
disabled: "windows" # pending bug #18011
|
||||
"""
|
||||
|
||||
# bug #4730
|
||||
|
||||
@@ -3,7 +3,6 @@ discard """
|
||||
output: '''
|
||||
int
|
||||
float'''
|
||||
disabled: "windows" # pending bug #18011
|
||||
"""
|
||||
|
||||
import typetraits
|
||||
|
||||
38
tests/cpp/tmanual_exception.nim
Normal file
38
tests/cpp/tmanual_exception.nim
Normal file
@@ -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()
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user