mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
Enable ASAN for macOS CI builds in ci.py
This commit is contained in:
parent
903d2a5335
commit
bf7689b211
3 changed files with 8 additions and 4 deletions
7
.github/workflows/ci.py
vendored
7
.github/workflows/ci.py
vendored
|
|
@ -20,6 +20,7 @@ NERD_URL = 'https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Ner
|
|||
is_bundle = os.environ.get('KITTY_BUNDLE') == '1'
|
||||
is_codeql = os.environ.get('KITTY_CODEQL') == '1'
|
||||
is_macos = 'darwin' in sys.platform.lower()
|
||||
running_under_sanitizer = os.environ.get('KITTY_SANITIZE') == '1'
|
||||
SW = ''
|
||||
|
||||
|
||||
|
|
@ -134,10 +135,8 @@ def install_deps() -> None:
|
|||
def build_kitty() -> None:
|
||||
python = shutil.which('python3') if is_bundle else sys.executable
|
||||
cmd = f'{python} setup.py build --verbose'
|
||||
if os.environ.get('KITTY_SANITIZE') == '1':
|
||||
if running_under_sanitizer:
|
||||
cmd += ' --debug --sanitize'
|
||||
elif is_macos:
|
||||
cmd += ' --debug' # for better crash report to debug SIGILL issue
|
||||
run(cmd)
|
||||
|
||||
|
||||
|
|
@ -145,6 +144,8 @@ def test_kitty() -> None:
|
|||
if is_macos:
|
||||
run('ulimit -c unlimited')
|
||||
run('sudo chmod -R 777 /cores')
|
||||
if running_under_sanitizer:
|
||||
os.environ['MallocNanoZone'] = '0'
|
||||
run('./test.py', print_crash_reports=True)
|
||||
|
||||
|
||||
|
|
|
|||
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
|
|
@ -143,6 +143,7 @@ jobs:
|
|||
os: [ubuntu-latest, macos-latest]
|
||||
env:
|
||||
KITTY_BUNDLE: 1
|
||||
KITTY_SANITIZE: 1
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v6.0.3
|
||||
|
|
|
|||
|
|
@ -127,8 +127,10 @@ class TestBuild(BaseTest):
|
|||
exe = os.path.join(tdir, 'dictation_probe')
|
||||
with open(src, 'w') as f:
|
||||
f.write(probe)
|
||||
nm = subprocess.run(['nm', '-g', cocoa_module], capture_output=True, text=True)
|
||||
asan_flags = ['-fsanitize=address,undefined', '-fno-omit-frame-pointer'] if '__asan_init' in nm.stdout else []
|
||||
cp = subprocess.run(
|
||||
['clang', '-framework', 'AppKit', src, '-o', exe],
|
||||
['clang', '-framework', 'AppKit'] + asan_flags + [src, '-o', exe],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True
|
||||
)
|
||||
self.assertEqual(cp.returncode, 0, cp.stdout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue