Skip to content

bug(windows): MSVC link failure in goosed when v8 and llama-cpp are linked together (LNK2038/LNK2005/LNK1169) #7410

@bavadim

Description

@bavadim

Windows MSVC desktop builds fail at link stage when goosed links both v8/deno_core and llama-cpp-sys-2 in the same binary. Observed failures include CRT/runtime-library mismatch and duplicate C++ exception symbol definitions.

This appears to be a regression after local inference (llama.cpp) integration (commit ddd35f6d4, 2026-02-19).

To Reproduce

Steps to reproduce the behavior:

  1. Use Windows MSVC environment (windows-latest / VS2022).
  2. Ensure build includes both dependency groups:
    • deno_core / v8
    • llama-cpp-2 / llama-cpp-sys-2
  3. Run:
    • rustup target add x86_64-pc-windows-msvc
    • cargo clean
    • cargo build --release -p goose-server --target x86_64-pc-windows-msvc --verbose
  4. Observe linker failure near final goosed.exe link step.

CI reproduction:

  1. Trigger desktop Windows workflow.
  2. Open Windows build job (Build goosed (Windows)).
  3. See linker signatures below.

Expected behavior

Windows MSVC build should complete successfully without runtime-library mismatch or duplicate symbol linker errors.

Screenshots

N/A (CI run/job links and log excerpt below).

System information

  • OS & Arch: Windows Server 2025 x64 (windows-latest)
  • Interface: CI / desktop workflow
  • Version: 1.24.0 line
  • Extensions enabled: N/A
  • Provider & Model: N/A

Additional context

Relevant log excerpt:

error: linking with link.exe failed: exit code: 1169

libv8-...rlib(exception.obj) : error LNK2005:
std::exception_ptr::exception_ptr(...) already defined in
libllama_cpp_sys_2-...rlib(llama-model-loader.obj)

libv8-...rlib(exception.obj) : error LNK2005:
std::exception_ptr::~exception_ptr(void) already defined in
libllama_cpp_sys_2-...rlib(llama-model-loader.obj)

libv8-...rlib(exception.obj) : error LNK2005:
std::current_exception(void) already defined in
libllama_cpp_sys_2-...rlib(llama-model-loader.obj)

libv8-...rlib(exception.obj) : error LNK2005:
std::rethrow_exception(std::exception_ptr) already defined in
libllama_cpp_sys_2-...rlib(llama-model-loader.obj)

LINK : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs
...goosed.exe : fatal error LNK1169: one or more multiply defined symbols found

Also observed in another run:

  • LNK2038 mismatch detected for 'RuntimeLibrary': MT_StaticRelease vs MD_DynamicRelease
    followed by LNK2005 / LNK1169.

Notes:

  • Forcing dynamic CRT in CI (LLAMA_STATIC_CRT=OFF, CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL, CMAKE_ARGS=...) did not eliminate the failure.
  • This is a link-stage issue in goosed.exe, not a compile-stage Rust error.
  • Separate run 22258803948 failed for unrelated UI import resolution after local revert experimentation; Build goosed (Windows) passed there.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions