Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with make fails on Linux #8225

Closed
andrei-mart opened this issue Apr 29, 2021 · 5 comments
Closed

Build with make fails on Linux #8225

andrei-mart opened this issue Apr 29, 2021 · 5 comments
Assignees

Comments

@andrei-mart
Copy link
Contributor

Reproduced on CentOS 7 and CentOS 8
If either ninja-build package is missing or make build is explicitly specified with
./yb_build.sh --make
compilation fails with message

( cd "/home/yugabyte/code/yugabyte-db/build/debug-gcc-dynamic/src/yb/yql/cql/ql/util" && PATH=/opt/yb-build/brew/linuxbrew-20181203T161736v9/bin:$PATH YB_THIRDPARTY_DIR=/opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20210402083441-ee4e2e453b-centos7-linuxbrew /opt/yb-build/brew/linuxbrew-20181203T161736v9/bin/g++ -Dql_util_EXPORTS -isystem /opt/yb-build/brew/linuxbrew-20181203T161736v9/include -I/home/yugabyte/code/yugabyte-db/build/debug-gcc-dynamic/src -I/home/yugabyte/code/yugabyte-db/ent/src -I/home/yugabyte/code/yugabyte-db/src -isystem /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20210402083441-ee4e2e453b-centos7-linuxbrew/installed/common/include -isystem /opt/yb-build/thirdparty/yugabyte-db-thirdparty-v20210402083441-ee4e2e453b-centos7-linuxbrew/installed/uninstrumented/include -I/home/yugabyte/code/yugabyte-db/build/debug-gcc-dynamic/postgres/include -Werror -fno-strict-aliasing -msse4.2 -Wall -Wno-sign-compare -Wno-deprecated -Winvalid-pch -pthread -DBOOST_BIND_NO_PLACEHOLDERS -DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX -DROCKSDB_PLATFORM_POSIX -DBOOST_ERROR_CODE_HEADER_ONLY -march=ivybridge -mcx16 -DYB_COMPILER_TYPE=gcc -DYB_COMPILER_VERSION=5.5.0 -DROCKSDB_LIB_IO_POSIX -DSNAPPY -DZLIB -mno-avx -mno-bmi -mno-bmi2 -mno-fma -D__STDC_FORMAT_MACROS -Wno-deprecated-declarations -DGFLAGS=gflags -Wnon-virtual-dtor -Werror=enum-compare -Werror=reorder -Werror=switch -Werror=return-type -Werror=non-virtual-dtor -DYB_HEADERS_NO_STUBS=1 -ggdb -O1 -fno-omit-frame-pointer -mno-abm -mno-movbe -fPIC -DTCMALLOC_ENABLED -fPIC -std=gnu++14 -o CMakeFiles/ql_util.dir/cql_message.cc.o -c /home/yugabyte/code/yugabyte-db/src/yb/yql/cql/ql/util/cql_message.cc )  # Compiler exit code: 1.

/-------------------------------------------------------------------------------
| COMPILATION FAILED
|-------------------------------------------------------------------------------
In file included from src/yb/yql/cql/ql/parser/parse_context.h:21:0,
                 from src/yb/yql/cql/ql/parser/parser.h:23,
                 from src/yb/yql/cql/ql/ql_processor.h:26,
                 from src/yb/yql/cql/cqlserver/cql_processor.h:30,
                 from src/yb/yql/cql/ql/util/cql_message.cc:26:
src/yb/yql/cql/ql/parser/location.h:24:44: fatal error: yb/yql/cql/ql/parser/location.hh: No such file or directory
compilation terminated.

Input files:
  src/yb/yql/cql/ql/util/cql_message.cc
Output file (from -o): CMakeFiles/ql_util.dir/cql_message.cc.o
\-------------------------------------------------------------------------------

The yb/yql/cql/ql/parser/location.hh is supposed to be generated by Bison, so presumably the grammar file is not processed by make.

@andrei-mart
Copy link
Contributor Author

Besides, install of ninja-build is missing in the CentOS instructions, so if one follows them, build is going to fail.

@ddorian
Copy link
Contributor

ddorian commented Apr 29, 2021

@andrei-mart can you make a pull request for the docs ? Or provide the exact steps needed to be added here ?

@svarnau
Copy link
Member

svarnau commented Apr 29, 2021

This seems to have been introduced with commit 2b3be7f.
"yb_build.sh --make" works with prior commit, but fails with that one. @frozenspider

@svarnau
Copy link
Member

svarnau commented Apr 30, 2021

The earlier change moved cql_message.cc from the ql_parser library to the ql_util library. Apparently ninja can figure out a build order that works, but when using cmake, there is an unsatisfied dependency on a header file built by bison in the parser library. Adding a dependency at the library level so that ql_parser will get built before ql_util, creates a circular dependency, since ql_parser already has a dependency (two actually) on ql_util.

Instead, a lower-level dependency needs to be added so that bison is run before cql_message is built. Will put up a change shortly.

@andrei-mart
Copy link
Contributor Author

@ddorian for the docs, line "sudo yum install -y cmake3 ctest3" should be changed to be "sudo yum install -y cmake3 ctest3 ninja-build".

andrei-mart added a commit to andrei-mart/yugabyte-db that referenced this issue May 6, 2021
svarnau added a commit that referenced this issue May 6, 2021
Summary:
Earlier move of file between libraries (2b3be7f) left an unsatisfied dependency that does not show up with
ninja.

Test Plan:
yb_build.sh --make
Jenkins: compile only

Reviewers: alex, dmitry, amartsinchyk, mbautin

Reviewed By: mbautin

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D11428
@svarnau svarnau closed this as completed May 6, 2021
YintongMa pushed a commit to YintongMa/yugabyte-db that referenced this issue May 26, 2021
Summary:
Earlier move of file between libraries (2b3be7f) left an unsatisfied dependency that does not show up with
ninja.

Test Plan:
yb_build.sh --make
Jenkins: compile only

Reviewers: alex, dmitry, amartsinchyk, mbautin

Reviewed By: mbautin

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D11428
YintongMa pushed a commit to YintongMa/yugabyte-db that referenced this issue May 26, 2021
robertsami added a commit that referenced this issue May 29, 2021
Summary: See title

Test Plan: ybd --cxx-test integration-tests_tablet-split-itest --gtest_filter TabletSplitYedisTableTest.BlockSplittingYedisTablet

Reviewers: timur, bogdan

Reviewed By: bogdan

Subscribers: ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D11689
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

No branches or pull requests

3 participants