File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -418,16 +418,6 @@ jobs:
418418 with :
419419 release : ${{ matrix.matlab-version }}
420420
421- # macOS: MATLAB's bundled libssl is missing _SSL_get0_group_name needed by
422- # netCDF4's libcurl. Set DYLD_LIBRARY_PATH so conda's OpenSSL is found first.
423- # NOTE: Must be AFTER "Set up MATLAB" or MATLAB installer fails with _iconv error
424- - name : Fix OpenSSL compatibility for macOS
425- if : runner.os == 'macOS'
426- shell : bash -l {0}
427- run : |
428- conda activate mhkit_conda_env
429- echo "DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
430-
431421 # - name: Configure OpenSSL for MacOS/MATLAB
432422 # if: runner.os == 'macOS'
433423 # shell: bash -l {0}
@@ -447,12 +437,17 @@ jobs:
447437 python -c "
448438 import sys
449439 import platform
440+ import os
450441
451442 python_exe = sys.executable
452443 is_macos = platform.system() == 'Darwin'
453444
454- # macOS needs DYLD_LIBRARY_PATH passed to MATLAB
455- dyld_line = \"setenv('DYLD_LIBRARY_PATH', getenv('DYLD_LIBRARY_PATH'));\" if is_macos else ''
445+ # macOS: Set DYLD_LIBRARY_PATH directly in run.m (not via env var)
446+ # This avoids breaking MATLAB's launcher while still fixing OpenSSL for Python
447+ dyld_line = ''
448+ if is_macos:
449+ conda_lib_path = os.path.join(os.path.dirname(os.path.dirname(python_exe)), 'lib')
450+ dyld_line = f\"setenv('DYLD_LIBRARY_PATH', '{conda_lib_path}');\"
456451
457452 content = f'''pyenv(Version='{python_exe}', ExecutionMode='OutOfProcess')
458453 {dyld_line}
You can’t perform that action at this time.
0 commit comments