v.pref: set DYLD_FALLBACK_LIBRARY_PATH on macos, when -use-coroutines is used, so that v run can work, and the executable can find the downloaded photonwrapper shared library (#23516)

This commit is contained in:
German Swan 2025-01-19 16:51:21 +02:00 committed by GitHub
parent 9871050603
commit 11c59cf8b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -987,6 +987,14 @@ pub fn parse_args_and_show_errors(known_external_commands []string, args []strin
}
res.compile_defines << 'is_coroutine'
res.compile_defines_all << 'is_coroutine'
$if macos {
dyld_fallback_paths := os.getenv('DYLD_FALLBACK_LIBRARY_PATH')
so_dir := os.dir(so_path)
if !dyld_fallback_paths.contains(so_dir) {
env := [dyld_fallback_paths, so_dir].filter(it.len).join(':')
os.setenv('DYLD_FALLBACK_LIBRARY_PATH', env, true)
}
}
} $else {
println('coroutines only work on macos & linux for now')
}