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

Refactor //library/rocksdbjni: replace 'make' in favour of '@rules_foreign_cc' #212

Open
lolski opened this issue Oct 26, 2020 · 1 comment

Comments

@lolski
Copy link
Member

lolski commented Oct 26, 2020

We found a Bazel rule @rules_foreign_cc [link] which allows for building make projects from inside a Bazel workspace. We should replace our builder script RocksDbBuilder.kt with this rule if possible

@lolski
Copy link
Member Author

lolski commented Oct 26, 2020

I couldn't get it to work on the first try, but the Bazel WORKSPACE and BUILD files would roughly look like this, according to the @rules_foreign_cc's README:

# WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
files = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""

http_archive(
   name = "rules_foreign_cc",
   strip_prefix = "rules_foreign_cc-master",
   url = "https://github.com/bazelbuild/rules_foreign_cc/archive/master.zip",
)
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()

http_archive(
   name = "rocksdbjni_dev",
   build_file_content = files,
   strip_prefix = "rocksdb-6.11.4",
   urls = ["https://github.com/facebook/rocksdb/archive/v6.11.4.tar.gz"],
)
# BUILD

load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")

cmake_external(
   name = "rocksdbjni-dev",
   lib_source = "@rocksdbjni_dev//:all",
)

And here's how you would actually trigger the make compilation

bazel build //library/rocksdbjni:rocksdbjni-dev

@vmax vmax removed their assignment Jan 20, 2022
lolski pushed a commit to lolski/dependencies that referenced this issue Oct 7, 2022
## What is the goal of this PR?

Recently,  a problem in`assemble_pip` was discovered:
```
  File "/home/********/.cache/bazel/_bazel_********/a3bf690c4bacc2f8a31e33bc35f6090b/sandbox/linux-sandbox/191/execroot/graknlabs_client_python/bazel-out/host/bin/external/graknlabs_bazel_distribution/pip/assemble.runfiles/pypi__setuptools_45_0_0/pkg_resources/__init__.py", line 93, in <module>
    raise RuntimeError("Python 3.5 or later is required")
RuntimeError: Python 3.5 or later is required
```

Given that we are still using Python 2 to build and test `client-python`, we need to downgrade `setuptools` to a supported version

## What are the changes implemented in this PR?

Depend on exact version of `setuptools` in `pip/requirements.txt`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants