building something like apr with bazel, crazy?

79 views
Skip to first unread message

Derek Perez

unread,
Aug 17, 2017, 12:39:33 AM8/17/17
to bazel-discuss
Hi there,

I was just perusing the source code of this project https://apr.apache.org and wondering how feasible it would be to compile this code using only Bazel BUILD files?

According to the docs, this code expects you to do the standard preamble:
./configure && make && make install

One of the things that is not clear to me is how one would define an analogous BUILD infrastructure that supported specifically the ./configure step. I'm not a C expert, so I'm not really sure how feasible this is...I thought it might be an interesting learning experiment to try to get this project compiling with bazel, but on the other hand, its not immediately clear to me that this is even possible. 

Any thoughts?

Irina Iancu

unread,
Aug 18, 2017, 7:33:16 AM8/18/17
to bazel-discuss
Hi Derek,

IMO this seems a bit too much for a starting learning experiment. I took a (very) quick look at the configure script and it creates make files. Then you run make & make install. If you want the equivalent in bazel, the script should create BUILD files and then run bazel build //... . However, auto-generating BUILD files is a hard job and is not recommended. The best approach would be to look into every directory and see what makes sense to be grouped into cc_library/cc_binary (or even other rules) and manually write a BUILD file for each package. In the end, have a WORKSPACE and a BUILD file at top level that builds the whole project. I think it would require some time and energy, depending on the intricacies of the project and how familiar you are with the code.

Dmitry Lomov

unread,
Aug 18, 2017, 7:53:27 AM8/18/17
to Derek Perez, bazel-discuss
Hi Derek, 

You might be interested in this blog post: https://blog.bazel.build/2016/03/31/autoconfiguration.html (*)
In a nutshell, Bazel's solution of bringing a local/external environment into your project's universe (i.e. solving the problem "./configure && make" is solving in traditional Unix model) is external repositories [1] and repository rules [2].

HTH,
Dmitry

(*) some links on that page are not working unfortunately, I filed https://github.com/bazelbuild/bazel-blog/issues/24.


--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAD7-yfstq6%2B%3DBj%3D%3D1CGyJ9_C_8FxB8KeN7zRCr9kL7sJgCQRDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--
Google Germany GmbH
Erika-Mann-Straße 33, 80636 München, Germany
Reply all
Reply to author
Forward
0 new messages