0

I have a simple example package served with uwsgi, that I'm trying to switch from building with makefile rules to bazel. The WORKSPACE file that, in addition to loading rules_python and other default stuff (registering toolchains) also gets uwsgi as follows

load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")

new_git_repository(
    name = "uwsgi",
    remote = "git@github.com:unbit/uwsgi.git",
    commit = "ca8bc6acc98b2c062b5b00668acd851e210fcbca",
    build_file_content = """
...
"""
)

What I can't quite get my head around is how to build uwsgi. Technically, you're building a C package. However, I'm building it using the provided python script (uwsgiconfig.py) and my configuration file (I'll call it myconf.ini that I manually copy into the uwsgi/buildconf/ directory then build the package using python uwsgiconfig.py --build myconfig This is the stage I'm (hopefully) trying to accomplish with bazel. However, I'm not sure if I should be using a cc_binary or a py_binary rule for to build uwsgi.
Any assistance is greatly appreciated.

legend855
  • 45
  • 7
  • Are you trying to use uwsgi in a python project or are you using the C interface? – silvergasp Jul 27 '22 at 21:13
  • In a python project – legend855 Jul 29 '22 at 02:24
  • Have you tried using the pip package? – silvergasp Jul 29 '22 at 03:07
  • Unfortunately, there's a few bug fixes and flags that regard the usage of HTTP 1.1's chunked transfer encoding that didn't make it to the latest available release via `pip`. Hence why we're resorting to building a particular commit number from github for the package. – legend855 Aug 01 '22 at 16:41
  • Have you considered building the standalone ".whl", and uploading that to a server? Then download and consume the .whl file using Bazel instead. – silvergasp Aug 01 '22 at 17:11
  • I hadn't considered that. I'll give it a try and report back. Thanks for the suggestion – legend855 Aug 01 '22 at 17:19
  • No problem, [this](https://github.com/bazelbuild/rules_python/blob/ac5b9736356638df6669376be73fa17b05ab1bf9/python/pip_install/repositories.bzl) might be a good resource. In particular [the build_file_content](https://github.com/bazelbuild/rules_python/blob/ac5b9736356638df6669376be73fa17b05ab1bf9/python/pip_install/repositories.bzl#L72-L85) – silvergasp Aug 01 '22 at 17:22

0 Answers0