Skip to content

Commit

Permalink
v.pref: set DYLD_FALLBACK_LIBRARY_PATH on macos, when `-use-corouti…
Browse files Browse the repository at this point in the history
…nes` is used, so that `v run` can work, and the executable can find the downloaded photonwrapper shared library (#23516)
  • Loading branch information
germankrause authored Jan 19, 2025
1 parent 9871050 commit 11c59cf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vlib/v/pref/pref.v
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand Down

0 comments on commit 11c59cf

Please sign in to comment.