Open
Conversation
Replace deps/marisa-0.2.6 with marisa-trie v0.3.1 downloaded from https://github.com/s-yata/marisa-trie/releases/tag/v0.3.1 and update all build system references (CMakeLists.txt, node_opencc.gypi). https://claude.ai/code/session_01Lw2Sjg4RgnMG6PuDoKRay4
18699d9 to
6aefa5c
Compare
The upstream marisa-0.3.1 CMakeLists.txt is a full standalone project (cmake_minimum_required 3.22, project(), tools, tests, install rules) which conflicts when used via add_subdirectory() from OpenCC (which requires CMake 3.5). Replace it with a minimal version matching the old 0.2.6 style that just builds a static library. The original is preserved as CMakeLists.txt.upstream. https://claude.ai/code/session_01Lw2Sjg4RgnMG6PuDoKRay4
marisa 0.3.1 uses PrefetchVirtualMemory and WIN32_MEMORY_RANGE_ENTRY in mapper.cc, which require _WIN32_WINNT >= Windows 8. Add the compile definition for MINGW builds. https://claude.ai/code/session_01Lw2Sjg4RgnMG6PuDoKRay4
_BitScanForward64 is not available on 32-bit MSVC targets (Win32/x86). Fall back to two _BitScanForward calls on the low and high 32-bit halves of the uint64_t. https://claude.ai/code/session_01Lw2Sjg4RgnMG6PuDoKRay4
The compile definition in CMakeLists.txt may not take effect early enough. Define _WIN32_WINNT=0x0602 (Windows 8) directly in mapper.cc before #include <windows.h> to ensure PrefetchVirtualMemory and WIN32_MEMORY_RANGE_ENTRY are available. https://claude.ai/code/session_01Lw2Sjg4RgnMG6PuDoKRay4
This was referenced Mar 27, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revert mapper.cc to upstream 0.3.1 and conditionally compile the PrefetchVirtualMemory call so it builds on older Windows targets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
@codex review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update the bundled marisa-trie dependency from 0.2.6 to 0.3.1.
Changes
deps/marisa-0.2.6withdeps/marisa-0.3.1(downloaded from https://github.com/s-yata/marisa-trie/releases/tag/v0.3.1)CMakeLists.txt,src/CMakeLists.txt, andnode/node_opencc.gypiCMakeLists.txtwith a minimal subdirectory-compatible version (original preserved asCMakeLists.txt.upstream)_WIN32_WINNT=0x0602inmapper.ccbefore<windows.h>forPrefetchVirtualMemory/WIN32_MEMORY_RANGE_ENTRY_BitScanForward64with two_BitScanForwardcalls on 32-bit targets inbit-vector.ccMODULE.bazelto update the Bazel dependency when marisa-trie 0.3.1 becomes available on the Bazel Central RegistryNotes
MODULE.bazeldependency remains at 0.2.6 because 0.3.1 is not yet published to the Bazel Central Registry.Binary compatibility
Verified that marisa 0.3.1 can read
.ocd2dictionaries serialized by marisa 0.2.6. Built all 16 dictionaries with 0.2.6, then ran the full test suite against them using 0.3.1 — all 16 tests passed. The trie binary format is unchanged between versions.