Hi,I have an external repo downloading and compiling just fine. Problem is I need to apply a patch to it before compiling. I'm not having any luck; the patch cmd runs but there are no input files. When I examine the execroot using:
genrule(name = "gentest",srcs = glob(["include/**/*h"]),outs = ["gentest.log"],#cmd = "pwd > $@"#cmd = "ls -l external/mbedtls/include/mbedtls > $@"#cmd = "ls -l bazel-out/darwin-fastbuild/genfiles/external/mbedtls > $@"cmd = "find -L bazel-out -name *.h > $@")I find no files from the external repo.
My BUILD.mbedtls file looks like:cc_library(name = "mbedtls-lib",copts = [# the library headers:"-Iexternal/mbedtls/include/mbedtls","-Iexternal/mbedtls/include/",
# custom config.h:"-Iconfig","-Iconfig/mbedtls",
],srcs = glob(["library/*.c"]),hdrs = glob(["include/mbedtls/*.h"],exclude=["include/mbedtls/config.h"])+ ["@//config/mbedtls:config.h",],
visibility = ["//visibility:public"])
genrule(name = "patch",srcs = ["include/mbedtls/certs.h",..."@//config/mbedtls:ocf.patch"],outs = ["out/include/mbedtls/certs.h" ...],cmd = "patch -p1 -l -f < $(location @//config/mbedtls:ocf.patch")
--
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/CAO40Mi%3D6JK%2B5P5UcdmNys0tGAnNQU8yuYotWk9JqS07%3Dgmn6MQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAP01z6KNwt20KjF61_B%2B9qmWntbS6ybtFzAwgB8WucvwKKJOBw%40mail.gmail.com.
+aehligKlaus added the ability to apply patches to the Skylark http_archive implementation [1] a few months ago. Does this work for you?
On Sun, May 13, 2018 at 10:45 AM, Gregg Reynolds <d...@mobileink.com> wrote:Hi,I have an external repo downloading and compiling just fine. Problem is I need to apply a patch to it before compiling. I'm not having any luck; the patch cmd runs but there are no input files. When I examine the execroot using:I'm going to assume your external repo is called @mbedtls in my answers, although I'm not completely sure.genrule(name = "gentest",srcs = glob(["include/**/*h"]),outs = ["gentest.log"],#cmd = "pwd > $@"#cmd = "ls -l external/mbedtls/include/mbedtls > $@"#cmd = "ls -l bazel-out/darwin-fastbuild/genfiles/external/mbedtls > $@"cmd = "find -L bazel-out -name *.h > $@")I find no files from the external repo.What package is that genrule in? If it's in @mbedtls, then `find -L include -name *.h` should find the files. Otherwise, that glob is going to be empty (because glob doesn't match files in other packages) and it's not going to find anything.
Also, a tool I find helpful for debugging globs is `bazel query --output=build`, which will print your BUILD files with globs (and macros as a side effect) expanded. For example, try `bazel query --output=build @mbedtls//...` to see what the globs in your cc_library target are matching.
Hi,I have an external repo downloading and compiling just fine. Problem is I need to apply a patch to it before compiling.