发布

  • mlx: remove noisy error output from dynamic library loading (#14346)

    frostbyte_neo 发布于 2026-02-21 07:46:07 +00:00

    The recent change in #14322 added tryLoadByName() which attempts to
    load libmlxc.dylib via rpath before searching directories. This is an
    optimization for Homebrew installations where rpath is correctly set.

    However, when rpath isn't set (which is the common case for app bundle
    installations), dlopen fails and the CHECK macro prints an error to
    stderr:

    ERROR - dynamic.c:21 - CHECK failed: handle->ctx != NULL

    This error is misleading because it's an expected failure path - the
    code correctly falls back to searching the executable directory and
    loads the library successfully. The error message causes user confusion
    and makes it appear that something is broken.

    Replace the CHECK macro with a simple return code so the C code fails
    silently. The Go code already handles error logging appropriately:
    tryLoadByName() fails silently (intentional fallback), while
    tryLoadFromDir() logs via slog.Error() when explicit path loading fails.

    下载附件