Skip to content

Fix AppleClang parsing and static initialization - #16

Open
Jme-Tau wants to merge 1 commit into
masterfrom
codex/macos-appleclang-static-init
Open

Fix AppleClang parsing and static initialization#16
Jme-Tau wants to merge 1 commit into
masterfrom
codex/macos-appleclang-static-init

Conversation

@Jme-Tau

@Jme-Tau Jme-Tau commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Make the parser compile reliably under AppleClang and remove a static-initialization-order dependency exposed by global Tau BDD construction on macOS arm64.

Tracks IDNI/tau-lang#78.

Changes

  • copy the predictor set index into a local size_t before comparing it with U.size()
    • avoids AppleClang parsing the dependent it->set < U.size() expression as template syntax
    • does not change parser behavior
  • replace inline-static tree and hook mutex objects with function-local static accessors
    • guarantees each mutex is initialized before its first lock
    • avoids pre-main mutex lock failed: Invalid argument aborts when another global initializer calls bintree::get() or create_cache()

Verification

Using AppleClang 17 on arm64 macOS:

  • parser static library builds successfully as the Tau submodule
  • Tau native Release executable builds and reports version 0.7.0-alpha
  • Tau Python 3.14 binding builds and imports
  • the combined parser + Tau fix set runs 327 Release tests with no segfaults or aborts

The standalone parser debug-tests and release-tests presets were also attempted. They currently stop in existing char32_t stream tests because libc++ does not provide the required std::ctype<char32_t> / std::numpunct<char32_t> locale facets. That failure is independent of these changes and occurs before the affected parser tests can run.

git diff --check passes.

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