Failed to build from source with --no-download-thirdparty

Hi,

I am trying to build YugabyteDB on ubuntu 22.04, amd64 by using –no-download-thirdparty and --no-linuxbrew by following Build from source code on Ubuntu | YugabyteDB Docs.

However I am facing below error:
YB_THIRDPARTY_DIR is set to '/home/test/stable/yugabyte-db/thirdparty' but it does not exist and is not within '/opt/yb-build' so we would not be able to download it.

I could work around this error by creating a “thirdparty” dir and tweaking this https://github.com/yugabyte/yugabyte-db/blob/master/build-support/invoke_thirdparty_build.sh#L19-L21 to allow cloning yugabyte-db-thirdparty.git

However I am stuck with below error next:
yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py: error: argument --build-type: invalid choice: 'uninstrumented' (choose from COMMON, UNINSTRUMENTED, ASAN, TSAN)
I tried below patch :

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e697ff710..e443d1bdeb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -234,7 +234,7 @@ include(CompilerInfo)
 if ("${YB_BUILD_TYPE}" MATCHES "^(asan|tsan)$")
   set(THIRDPARTY_INSTRUMENTATION_TYPE "${YB_BUILD_TYPE}")
 elseif (IS_CLANG OR IS_GCC)
-  set(THIRDPARTY_INSTRUMENTATION_TYPE "uninstrumented")
+  set(THIRDPARTY_INSTRUMENTATION_TYPE "UNINSTRUMENTED")
 else()
   message(FATAL_ERROR "Unknown compiler family: '${COMPILER_FAMILY}'.")
 endif()

but still get
yugabyte-db/thirdparty/python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py: error: argument --build-type: invalid choice: 'UNINSTRUMENTED' (choose from COMMON, UNINSTRUMENTED, ASAN, TSAN)

Could someone please help?
command used for build:
./yb_build.sh release --no-download-thirdparty --ninja --shellcheck --gcc11 debug --no-linuxbrew

Hi NamB,

May I ask why you need to use --no-download-thirdparty? We have a pre-built third-party package available for Ubuntu 22.04 x86_64.

I suggest that you use the Docker image yugabyteci/yb_build_infra_ubuntu2204_x86_64:v2023-10-25T03_33_00 to do the build (currently the latest one obtained from GitHub - yugabyte/build-infra: Infrastructure for building YugabyteDB). It already has all the necessary packages preinstalled for building both the third-party dependencies and YugabyteDB itself.

E.g. you could try:

docker run -it yugabyteci/yb_build_infra_ubuntu2204_x86_64:v2023-10-25T03_33_00

and in the Docker container run the following:

mkdir -p ~/code
cd ~/code
git clone https://github.com/yugabyte/yugabyte-db
cd yugabyte-db
./yb_build.sh release

This will use the Clang 16 compiler that is currently the default compiler for YugabyteDB.

If you still need to build the third-party dependencies from scratch for some reason (e.g. if you are planning to update some of the libraries), you can do that in the same Docker container:

mkdir -p ~/code
cd ~/code
git clone https://github.com/yugabyte/yugabyte-db-thirdparty
cd yugabyte-db-thirdparty
./build_thirdparty.sh --toolchain=llvm16 --skip-sanitizers

and then use the results of that build to build YugabyteDB itself:

cd ~/code/yugabyte-db
export YB_THIRDPARTY_DIR=~/code/yugabyte-db-thirdparty
./yb_build.sh release --clean --force

Regards,
Mikhail

Hi Mikhail,
Thanks for your response.

I was interested in checking steps for setting up YugaByte on non-amd architectures, thus wanted to build from source. The above command helped. Thank you.

Regards,