Jack47
unread,May 7, 2015, 10:19:31 AM5/7/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Han-Wen Nienhuys, Kristina Chodorow, Jack47, Damien Martin-guillerez, bazel-...@googlegroups.com
Yes, use genrule to execute shell commands can extract .a files from .rpm files. But these .rpm files is stored on the yum repository, Bazel need to fetch it from yum repo. What's more, there are tens of rpm files and these rpm files is related, e.g, A.rpm need B.rpm, B.rpm needs C.rpm. Bazel should compute these dependencies, I need Bazel download these rpm files as concurrently as possible and cache the output result.
@ Kristina
I designed a new_http_rpm rule:
new_rpm_repository (
name = "search-utility-2.4.1", # name is the rpm file name, need to specify the exact rpm version
branch = "test", # test release or product release, default is product release
sha256 = "" # if not specified, will not compare sha256, so if search-utility-2.4.1_x86_64.rpm exists in the .external-repository, Bazel don't need to refetch the rpm from yum repository.
deps = "string-utility-1.0.0", # dependencies of this rule
build_file = "search-utility-2.4.1.BUILD" # A file to use as a BUILD file for this rpm repository.
)
To implement this feature, I need to implement these functions:
1. RpmDownloadFunction: find the rpm's download url according to the yum repository configs and then fetch this rpm to local directory.
2. implement rpm decompress class in DecompressFactory
3. import build file specified by build_file attribute.
If there is something wrong with my design, please correct me.