On Tue, May 15, 2018 at 10:49 AM, Mats Wichmann <[email protected]> wrote:
> On 05/14/2018 10:58 AM, Gregg Reynolds wrote:
> > Hi folks,
> >
> > I've got Iotivity building with Bazel. It was surprizingly easy and the
> > result is surprizingly simple.
>
>
> so just out of curiosity... I've heard about bazel the comment - perhaps
> not criticism, but assessment - that it really likes the Google model of
> dependency management, namely, "you always get the latest of
> everything", and is not as amenable to keeping fixed/known versions of
> dependencies in play. we're very much in the latter camp, in fact it's
> been uncomfortably hard to keep step with our dependencies (extlibs
> pieces, in other words), and we have quite a bit of scons material
> dedicated to holding back versions of things to something "known", where
> "known" sometimes involves patches that upstream doesn't even want.
>
> How does your conversion experience square with this? Have I just
> gotten the wrong impression? You said the extlibs stuff was working fine.
>
I don't get that impression at all. I would say reliability is a priority,
rather than "the latest".
In fact it seems like the opposite to me: you get exactly what you ask for.
For external repos, you can provide a sha256 to make sure you always get
what you want. E.g.
new_http_archive(
name = "mbedtls",
urls = ["https://github.com/ARMmbed/mbedtls/archive/mbedtls-2.4.2.zip"],
sha256 =
"dacb9f5dd438c456b9ef6627637f46e16fd41e86d828217ec9f8547d3d22a338",
strip_prefix = "mbedtls-mbedtls-2.4.2",
build_file = "config/mbedtls/BUILD",
)
Of course you can also keep a local copy.
Furthermore, every dependency must be explicitly listed. This can be
tedious, but there is globbing support, and it means the builds are more
reliable than is the case with other tools.
Yes, the external stuff works great. You can easily verify this by just
building them. E.g. to build tinycbor:
$ bazel build @tinycbor//:tinycbor-lib
If you want more detail about what's happening see this blog post
<http://blog.mobileink.com/2018/05/bazel-genrule-patching-external-repo.html>
.
I think it would be much easier to manage such dependencies with Bazel.
HTH,
Gregg