oceanbase / oceanbase/miniob

Apple M1 编译报错

Open
#393 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue question
Dominant language
C++
Stars
4.4k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Question

环境信息( 工具版本均符合文档要求):

➜  miniob git:(main) uname -a
Darwin MacBook-Pro-3.local 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:52 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8112 arm64
➜  miniob git:(main) cmake --version
cmake version 3.25.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
➜  miniob git:(main) clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
➜  miniob git:(main) g++ --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

➜  miniob git:(main) flex --version
flex 2.6.4 Apple(flex-34)
➜  miniob git:(main) bison --version
bison (GNU Bison) 3.8.2
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

编译步骤:

  1. git clone https://github.com/oceanbase/miniob.git
  2. cd miniob
  3. sudo bash build.sh init --这一步ok
  4. bash build.sh --这一步报错
  5. 查看已经生成了 二进制文件
➜  build_debug git:(main) ✗ tree bin
bin
├── arithmetic_expression_test
├── bitmap_test
├── bp_manager_test
├── bplus_tree_log_entry_test
├── bplus_tree_log_test
├── bplus_tree_test
├── client_performance_test
├── clog_dump
├── miniob
│   └── db
│       └── sys
│           ├── dblwr.db
│           └── sys.db
├── obclient
├── observer
└── observer.log.20240509
  1. 启动observer ./observer
➜  bin git:(main) ✗ ./observer

Welcome to the OceanBase database implementation course.

Copyright (c) 2021 OceanBase and/or its affiliates.

Learn more about OceanBase at https://github.com/oceanbase/oceanbase
Learn more about MiniOB at https://github.com/oceanbase/miniob

Successfully load ../etc/observer.ini
Not set log file name, use default observer.log
Output configuration
Begin dump configuration
[]

Finish dump configuration

Db already exists: sys
Extend one pool, this->size:128, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:256, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:384, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:512, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:640, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:768, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:896, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1024, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1152, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1280, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1408, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1536, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1664, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1792, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:1920, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:2048, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:2176, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:2304, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:2432, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:2560, item_num_per_pool:128, this->name:BufPool.
Extend one pool, this->size:2560, item_num_per_pool:128, this->name:BufPool.
buffer pool manager init with memory size 20971520, page num: 2560, pool num: 20
double write buffer load pages done. page num=0
Successfully read db meta file. db=sys, file=miniob/db/sys/sys.db, check_point_lsn=0
All table have been opened. num=0
Successfully recover db. db=sys checkpoint_lsn=0
Default handler init with miniob success
Successfully init utility
Listen on port 6789
Observer start success
  1. 启动客户端 ./obclient, 执行基本的show/select报错,不确定是否为编译的问题
➜  bin git:(main) ✗ ./obclient

Welcome to the OceanBase database implementation course.

Copyright (c) 2021 OceanBase and/or its affiliates.

Learn more about OceanBase at https://github.com/oceanbase/oceanbase
Learn more about MiniOB at https://github.com/oceanbase/miniob

miniob > show databases;
SQL_SYNTAX > Failed to parse sql
miniob > show tables;
Tables_in_SYS
miniob > select * from Tables_in_SYS
FAILURE
miniob >

编译过程中打印信息如下:

执行sudo bash build.sh init 的输出(看起来没有error):
output.md

执行bash build.sh报fatal error: too many errors emitted, stopping now [-ferror-limit=]
image

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [unittest/CMakeFiles/buffer_pool_log_test.dir/buffer_pool_log_test.cpp.o] Error 1
make[1]: *** [unittest/CMakeFiles/buffer_pool_log_test.dir/all] Error 2
make: *** [all] Error 2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the build on an Apple M1 using build.sh and inspect output.md for the compiler diagnostics omitted from the issue. Focus on unittest/buffer_pool_log_test.cpp and its CMake target, then compare the reported errors with the generated binaries and the show/select behavior in obclient. Done means the project builds cleanly on the stated environment and the basic commands work as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.