Skip to content

server : fix macOS build in prompt cache key - #1

Closed
sammcj wants to merge 2 commits into
yitizi:pr2-standalonefrom
sammcj:fix-macos-file-clock-int128
Closed

sammcj wants to merge 2 commits into
yitizi:pr2-standalonefrom
sammcj:fix-macos-file-clock-int128

Conversation

@sammcj

@sammcj sammcj commented Sep 2, 2026

Copy link
Copy Markdown

Fixes the macOS build break I mentioned in ggml-org#28092.

std::filesystem::file_clock::duration::rep is __int128 in libc++, and no operator<< overload accepts it, so server_prompt_cache_key_add_file fails to compile:

error: use of overloaded operator '<<' is ambiguous
       (with operand types 'basic_ostream<...>' and 'rep' (aka '__int128'))

Casting to long long before the stream insertion is enough. The value only feeds the cache key hash, so narrowing is harmless here.

Built and tested on macOS 26.x / M5 Max with a Metal build.

Local Dev and others added 2 commits September 3, 2026 04:00
Assisted-by: Codex
Assisted-by: Claude Opus 5
std::filesystem::file_clock has an __int128 representation in libc++, which no operator<< overload accepts, so the mtime stream insertion fails to compile on macOS with 'use of overloaded operator '<<' is ambiguous'.
@sammcj

sammcj commented Sep 6, 2026

Copy link
Copy Markdown
Author

Closing: the cast landed in the force-push to 6deebd4 as static_cast<long long>, so this PR is superseded. Confirmed building on macOS 26 / M5 Max Metal at that head.

@sammcj sammcj closed this Sep 6, 2026
sammcj added a commit to sammcj/llamacpp-ini that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant