[GH-ISSUE #332] [Bug] Go Module Version Conflict Occurs When Running Build Script #122

Closed
opened 2026-10-29 21:09:42 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @Risc-lt on GitHub (May 7, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/332

In dependencies.sh, the Go version is specified as GOVER=1.23.8. However, when running make -j, the following errors occur:

# runtime
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:53:2: mallocHeaderSize redeclared in this block
        /usr/local/go/src/runtime/mbitmap.go:71:2: other declaration of mallocHeaderSize
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:54:2: minSizeForMallocHeader redeclared in this block
        /usr/local/go/src/runtime/mbitmap.go:101:2: other declaration of minSizeForMallocHeader
...
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:936:6: heapBitsSlice redeclared in this block
        /usr/local/go/src/runtime/mbitmap.go:587:6: other declaration of heapBitsSlice
/usr/local/go/src/runtime/mbitmap_noallocheaders.go:936:6: too many errors
make[2]: *** [mooncake-common/etcd/CMakeFiles/build_etcd_wrapper.dir/build.make:73: mooncake-common/etcd/libetcd_wrapper.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:417: mooncake-common/etcd/CMakeFiles/build_etcd_wrapper.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

These errors indicate a version conflict between the installed Go toolchain and the Go source code being built. I initially tried running go mod tidy, but that didn't resolve the issue.

Upon further inspection, I discovered that mooncake-p2p-store/src/p2pstore/go.mod specifies toolchain go1.24.1 as the required version. After upgrading my Go installation to 1.24.1, the make process completed successfully.

For reference, my working environment is inside the Docker image alogfans/mooncake (based on Ubuntu 22.04.4 LTS, x86_64). I'm happy to help fix this version inconsistency if needed.

Originally created by @Risc-lt on GitHub (May 7, 2025). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/332 In `dependencies.sh`, the Go version is specified as `GOVER=1.23.8`. However, when running `make -j`, the following errors occur: ```bash # runtime /usr/local/go/src/runtime/mbitmap_noallocheaders.go:53:2: mallocHeaderSize redeclared in this block /usr/local/go/src/runtime/mbitmap.go:71:2: other declaration of mallocHeaderSize /usr/local/go/src/runtime/mbitmap_noallocheaders.go:54:2: minSizeForMallocHeader redeclared in this block /usr/local/go/src/runtime/mbitmap.go:101:2: other declaration of minSizeForMallocHeader ... /usr/local/go/src/runtime/mbitmap_noallocheaders.go:936:6: heapBitsSlice redeclared in this block /usr/local/go/src/runtime/mbitmap.go:587:6: other declaration of heapBitsSlice /usr/local/go/src/runtime/mbitmap_noallocheaders.go:936:6: too many errors make[2]: *** [mooncake-common/etcd/CMakeFiles/build_etcd_wrapper.dir/build.make:73: mooncake-common/etcd/libetcd_wrapper.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:417: mooncake-common/etcd/CMakeFiles/build_etcd_wrapper.dir/all] Error 2 make: *** [Makefile:146: all] Error 2 ``` These errors indicate a version conflict between the installed Go toolchain and the Go source code being built. I initially tried running `go mod tidy`, but that didn't resolve the issue. Upon further inspection, I discovered that `mooncake-p2p-store/src/p2pstore/go.mod` specifies `toolchain go1.24.1` as the required version. After upgrading my Go installation to 1.24.1, the `make` process completed successfully. For reference, my working environment is inside the Docker image `alogfans/mooncake` (based on Ubuntu 22.04.4 LTS, x86\_64). I'm happy to help fix this version inconsistency if needed.
Author
Owner

@doujiang24 commented on GitHub (May 8, 2025):

@Risc-lt Could you please show your full commands?

Or you can follow the commands in ci, it should be workable.
Let's check what is the difference.
https://github.com/kvcache-ai/Mooncake/blob/main/.github/workflows/ci.yml#L152

<!-- gh-comment-id:2862403131 --> @doujiang24 commented on GitHub (May 8, 2025): @Risc-lt Could you please show your full commands? Or you can follow the commands in ci, it should be workable. Let's check what is the difference. https://github.com/kvcache-ai/Mooncake/blob/main/.github/workflows/ci.yml#L152
Author
Owner

@Risc-lt commented on GitHub (May 8, 2025):

@doujiang24 Thx for your reply. I followed exactly the same commands as listed in /doc/en/build.md:

bash dependencies.sh
mkdir build
cd build
cmake ..
make -j

Compared to ci.yml, the flags like WITH_P2P_STORE and BUILD_UNIT_TESTS are overridden from OFF to ON in CMakeLists.txt. . I guess this might be the cause of the conflict.

<!-- gh-comment-id:2863287159 --> @Risc-lt commented on GitHub (May 8, 2025): @doujiang24 Thx for your reply. I followed exactly the same commands as listed in `/doc/en/build.md`: ```bash bash dependencies.sh mkdir build cd build cmake .. make -j ``` Compared to `ci.yml`, the flags like `WITH_P2P_STORE` and `BUILD_UNIT_TESTS` are overridden from OFF to ON in CMakeLists.txt. . I guess this might be the cause of the conflict.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#122
No description provided.