forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#14366] Improve usability of yb_release with LTO build
Summary: Prior to this diff, yb_release would not work with LTO builds unless a full build had already been done. There was an assumption that all protobufs would be generated by the time dependency graph traversal starts. Relaxing that assumption in case we know the build might be incomplete. Other changes: - Fixing the usability of --no-tests mode. Prior to this diff, the dependency graph framework self-test would fail. - Deduplicating command line flags used to build Postgres. - Removing a couple of unnecessary protobuf imports. Test Plan: Jenkins: compile only Manual tests (a clean build in each case): - LTO build through yb_release: - `./yb_release --build_args="--clang14 --lto=full" --force` - `build-support/dependency_graph --build-root=build/release-clang14-linuxbrew-full-lto-ninja --incomplete-build self-test` - LTO build through yb_release without use of Linuxbrew: - `./yb_release --build_args="--lto=full --no-linuxbrew" --force` - `build-support/dependency_graph --build-root=build/release-clang14-full-lto-ninja --incomplete-build self-test` - A build with no tests: - `./yb_build.sh --clang14 debug --no-tests --export-compile-commands` - `build-support/dependency_graph --build-root=build/debug-clang14-dynamic-ninja self-test` - A build with tests: - `./yb_build.sh --clang14 fastdebug --export-compile-commands` - `build-support/dependency_graph --build-root=build/fastdebug-clang14-dynamic-ninja self-test` Reviewers: sergei Reviewed By: sergei Subscribers: ybase, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D20333
- Loading branch information
Showing
12 changed files
with
338 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# See https://code.visualstudio.com/docs/python/environments#_environment-variable-definitions-file | ||
# for details on how this file is used | ||
|
||
# Refer to this file as follows in your VSCode user settings or workspace settings: | ||
# | ||
# "python.envFile:": "${workspaceFolder}/python/python_vscode.env" | ||
|
||
PYTHONPATH=python |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) Yugabyte, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
# in compliance with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software distributed under the License | ||
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
# or implied. See the License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
import re | ||
from typing import Dict, Tuple, Any | ||
|
||
|
||
CMAKE_CACHE_VAR_RE = re.compile(r'^([a-zA-Z_0-9-]+):([A-Z]+)=(.*)$') | ||
|
||
|
||
class CMakeCache: | ||
name_to_val_and_type: Dict[str, Tuple[str, str]] = {} | ||
|
||
def __init__(self, path: str) -> None: | ||
self.name_to_val_and_type = {} | ||
with open(path) as input_file: | ||
for line in input_file: | ||
line = line.strip() | ||
if line.startswith(('#', '//')) or not line: | ||
continue | ||
m = CMAKE_CACHE_VAR_RE.match(line) | ||
if not m: | ||
raise ValueError(f'Invalid line in CMake Cache at {path}: {line}') | ||
self.name_to_val_and_type[m.group(1)] = (m.group(3), m.group(2)) | ||
|
||
def get(self, key: str, default_value: Any = None) -> Any: | ||
if key not in self.name_to_val_and_type: | ||
return default_value | ||
value, type_name = self.name_to_val_and_type[key] | ||
if type_name == 'BOOL': | ||
assert value in ['ON', 'OFF'] | ||
return value == 'ON' | ||
return value |
This file contains 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
Oops, something went wrong.