Skip to content

Error on unsafe TLS in fluent API#63

Merged
netanel-haber merged 1 commit intomainfrom
fluent-tls-guards
Feb 10, 2026
Merged

Error on unsafe TLS in fluent API#63
netanel-haber merged 1 commit intomainfrom
fluent-tls-guards

Conversation

@netanel-haber
Copy link
Owner

Summary

  • #error if fluent API is compiled into an MSVC DLL (_WINDLL), since __declspec(thread) is broken in DLLs loaded via LoadLibrary — PE/COFF loader allocates TLS slots once at process startup and cannot grow them for late-loaded DLLs
  • Replace silent non-thread-safe fallback with a hard #error when no TLS mechanism is available

Test plan

  • CI passes (POSIX unaffected, Windows EXE builds unaffected)
  • Verify MSVC /LD build hits the #error

🤖 Generated with Claude Code

__declspec(thread) is broken in DLLs loaded via LoadLibrary (PE/COFF
loader allocates TLS slots once at process startup). Error at compile
time if SNAKEPATH_FLUENT is used in an MSVC DLL build (_WINDLL).

Also replace the silent non-thread-safe fallback with a hard error
when no TLS mechanism is available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netanel-haber netanel-haber merged commit f700823 into main Feb 10, 2026
2 checks passed
@netanel-haber netanel-haber deleted the fluent-tls-guards branch February 10, 2026 21:38
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