Re: Anybody knows how to patch tarballs that bazel extracts?
On Tue, Jul 18, 2017 at 08:33:57AM +0200, Klaus T. Aehlig wrote: > Actually, it is not that far in the future; in fact, event today, bazel's > cc_library rule accepts an .so in the sources attribute, making a work around > possible (patching WORKSPACE to point to a hand-crafted directory under WRKDIR > as a local_repository, with hand-crafted BUILD-files, essentially taking > things from ${LOCALBASE}). Related bazel issue: https://github.com/bazelbuild/bazel/issues/3402 ___ freebsd-ports@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"
Re: Anybody knows how to patch tarballs that bazel extracts?
On 07/17/2017 23:33, Klaus T. Aehlig wrote: Actually, it is not that far in the future; in fact, event today, bazel's cc_library rule accepts an .so in the sources attribute, making a work around possible (patching WORKSPACE to point to a hand-crafted directory under WRKDIR as a local_repository, with hand-crafted BUILD-files, essentially taking things from ${LOCALBASE}). Thank you Klaus, I will follow your suggestion. Yuri ___ freebsd-ports@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"
Re: Anybody knows how to patch tarballs that bazel extracts?
On Mon, Jul 17, 2017 at 09:37:34AM +0200, Klaus T. Aehlig wrote: > However, even with that approach, you should be aware that you're > embedding the relevant dependencies rather than using them from > ${LOCALBASE}. So, in the long run, it might be desirable to patch the > relevant targets in the BUILD files using those external resources to > point to ${LOCALBASE}. Maybe, one could even lobby for a new_local_library > WORKSPACE rule at bazel-...@googlegroups.com. But that's all long-term > perspective... Actually, it is not that far in the future; in fact, event today, bazel's cc_library rule accepts an .so in the sources attribute, making a work around possible (patching WORKSPACE to point to a hand-crafted directory under WRKDIR as a local_repository, with hand-crafted BUILD-files, essentially taking things from ${LOCALBASE}). ___ freebsd-ports@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"
Re: Anybody knows how to patch tarballs that bazel extracts?
> Bazel (devel/bazel) based projects tend to fetch tarballs directly. > WORKSPACE can be patched to change the fetch URL to one in > /usr/ports/distfiles. However, what to do when the contents of tarballs > need to be patched? Unfortunately, there is no real good bazel way to do this. It was discussed serveral times to add a patch option to the new_http_archive rule, but unfortunately, it was never implemented. Such discussion is best done at bazel-...@googlegroups.com. If you want to solve the problem within bazel, you can, of course, always write a skylark-rule that, given a tar ball, unpacks it, applies the patches, and repacks it. Fortunately, for the ports tree, we have a better way to solve the problem. The ports infrastructure allows to extract all the relevant tar balls into separate directories under ${WRKDIR}, and also patch them there. Then, you can patch WORKSPACE to point to a new_local_repository rather than a new_http_archive. However, even with that approach, you should be aware that you're embedding the relevant dependencies rather than using them from ${LOCALBASE}. So, in the long run, it might be desirable to patch the relevant targets in the BUILD files using those external resources to point to ${LOCALBASE}. Maybe, one could even lobby for a new_local_library WORKSPACE rule at bazel-...@googlegroups.com. But that's all long-term perspective... Best, Klaus ___ freebsd-ports@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"