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

Dependencies update for C# driver. #515

Merged
merged 13 commits into from
Mar 21, 2024
Merged

Conversation

farost
Copy link
Member

@farost farost commented Mar 15, 2024

What is the goal of this PR?

We add all the needed dependencies for building the new C# driver for TypeDB.

What are the changes implemented in this PR?

This PR contains bazel's csharp rules' pulling commands and additional bazel rules for building the native C# library used in the driver and its automatic tests.

TODOs will be completed in a separate PR.
C# driver's PR.

I've put a status: blocked label for explicitness, but I'm not sure what's the correct process, so feel free to correct me.

@farost farost added status: blocked dependencies Pull requests that update a dependency file labels Mar 15, 2024
@typedb-bot
Copy link
Member

typedb-bot commented Mar 15, 2024

PR Review Checklist

Do not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed.


Trivial Change

  • This change is trivial and does not require a code or architecture review.

Code

  • Packages, classes, and methods have a single domain of responsibility.
  • Packages, classes, and methods are grouped into cohesive and consistent domain model.
  • The code is canonical and the minimum required to achieve the goal.
  • Modules, libraries, and APIs are easy to use, robust (foolproof and not errorprone), and tested.
  • Logic and naming has clear narrative that communicates the accurate intent and responsibility of each module (e.g. method, class, etc.).
  • The code is algorithmically efficient and scalable for the whole application.

Architecture

  • Any required refactoring is completed, and the architecture does not introduce technical debt incidentally.
  • Any required build and release automations are updated and/or implemented.
  • Any new components follows a consistent style with respect to the pre-existing codebase.
  • The architecture intuitively reflects the application domain, and is easy to understand.
  • The architecture has a well-defined hierarchy of encapsulated components.
  • The architecture is extensible and scalable.

# along with this program. If not, see <https://www.gnu.org/licenses/>.
#

# TODO: Generalise and move the same functions (used by java, python, csharp)
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if it's still relevant. There are some similarities, but such refactoring could make the readability worse. Will think on the deployment stage.


return [
DefaultInfo(files = depset([wrap_cxx, wrap_csharp])),
OutputGroupInfo(
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a useful technique to save separate sets of files for future usage. I had troubles with separating C# and CXX files from each other to compile both source and test libraries, and it was a perfect solution!

files = depset([ctx.file.native_lib]),
runfiles = ctx.runfiles(files = [ctx.file.native_lib])
),
DotnetAssemblyCompileInfo(
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to put DotnetAssembly*Info to build our test (specifically BDD test) targets, which require this information for dependencies.

native_lib_name_root = "typedb_driver"
native_lib_name = "{}_native".format(native_lib_name_root)

# TODO: On Mac, it's enough to pass native_lib_name_root (lib and .dylib are added by the rule)
Copy link
Member Author

Choose a reason for hiding this comment

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

Will make an additional PR for it.

srcs = [swig_wrapper_name],
linkshared = True,
linkopts = select({
# TODO: move http certificate/encryption libraries into arguments
Copy link
Member Author

Choose a reason for hiding this comment

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

Will check it out in an additional PR for deployment.

Copy link
Member

@dmitrii-ubskii dmitrii-ubskii left a comment

Choose a reason for hiding this comment

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

Generally approved provided the couple minor comments are addressed

builder/csharp/deps.bzl Outdated Show resolved Hide resolved
WORKSPACE Outdated Show resolved Hide resolved
builder/swig/csharp.bzl Show resolved Hide resolved
@dmitrii-ubskii
Copy link
Member

Looks like you have some unsigned commits. You'll want to amend them with a signature before you merge.

@farost farost merged commit 7518f8a into typedb:development Mar 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants