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

[#21963] YSQL: Add build definition for AWS clockbound FFI. #280

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

pao214
Copy link
Contributor

@pao214 pao214 commented Sep 3, 2024

https://github.com/aws/clock-bound lets us retrieve clock accuracies. This is accurate as long as the reference clock is accurate. This information helps us improve transaction performance.

Compiling clock-bound-ffi using rust generates a C library for use in YugabyteDB. This source code is licensed Apache 2.0.

As a part of this change, build clock-bound-ffi using rust. We package only the header file and the static library (not the shared library. Using static library consistently across all the build types reduces surprises).

clock-bound-ffi is a C library and not built with sanitizer support.

The option --toolchain=llvm17 has no bearing in how clock-bound-ffi is built.


Also, replace ubuntu 23.04 with ubuntu 24.04 since (1) 24.04 is the newer and stable version and (2) yugabyte's 23.04 docker image does not have rust installed.

python/build_definitions/clockbound.py Show resolved Hide resolved
@@ -175,3 +175,6 @@ def copy_include_files(
rel_src_include_path: str,
dest_include_path: str) -> None:
raise NotImplementedError()

def prepare_for_build_tool_invocation(self, dep: 'Dependency') -> bool:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this def is for.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an already implemented function and it does the following things

  1. There is a skip_build_invocations command line option. And if this is set, then we should return immediately without building.
  2. It also checks that we are in the correct directory for building the library.

I simply added an interface here since no other library uses the rust compiler. I need to invoke the rust compiler myself because there is no API to do so. But I need to call this function similar to what C++ builds do.

Copy link

@karthik-ramanathan-3006 karthik-ramanathan-3006 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Orthogonal question: Do we want to lock the version of cargo/rust that we are using or does not matter? For ex, I think we use specific versions of pip, clang etc.

@pao214
Copy link
Contributor Author

pao214 commented Sep 17, 2024

LGTM!

Orthogonal question: Do we want to lock the version of cargo/rust that we are using or does not matter? For ex, I think we use specific versions of pip, clang etc.

The rust is pinned at version 1.78.0 in the build machines. We are not installing rust here.

@pao214 pao214 merged commit 2e00d5d into yugabyte:master Sep 17, 2024
19 checks passed
@pao214 pao214 deleted the clockbound branch September 17, 2024 19:29
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

Successfully merging this pull request may close these issues.

3 participants