PodToBUILD
PodToBUILD copied to clipboard
Use rules_pods as a source dependency
I tried to use git_repository
with rules_pods
to have the latest fixes from the master branch but it looks like Bazel always looked for the pre-compiled Compiler
and RepoTools
under the bin
directory, which only exists in a release tarball. The current workaround is to do a manual build of rules_pods
and upload the release tarball somewhere.
Is the any way to use this as a host dependency of new_pod_repository
so that Bazel will build rules_pods
first and then use the build results as the build tools for the new_pod_repository
targets?
Hey @thii - I'm not sure what a good solution here is. We didn't want to couple the toolchain requirements of P2B to the source repo, so we've moved towards release packages.
I think source builds can be added in some capacity, but likely are out of band of the parent Bazel process.
Vendorizing
In update_pods.py
it calls make
to build the binary. The release packages have a makefile that simply is a noop, I believe there is a way to do source builds, but we don't do them.
WORKSPACE
A downside of using a compiled binary is it's currently difficult to build things with Bazel at the point in which a repository_rule
will run ( atleast last time I looked at this and originally implemented it ).
It might be useful to sanity check the state of the world to see if anything has changed and/or reach out to bazel-discuss. Either myself or @rahul-malik can create a release tomorrow AM 👍 and we've thought about automating this process to happen on every commit as well.
I think the compiled binary is nice so everyone isn’t building the binaries locally but that shouldn’t be the only way to integrate. Automating the release helps but the project should still be possible to integrate from source
I won’t be able to try this out or create a release until next week so feel free to take this @jerrymarino. As far as a fix, I think the bin/update_pods.py script could potentially fallback to using “bazel run” since the compiler and repotools are executable bazel targets
@thii - While we're working on a solution here, I put up a new release with what is in master currently https://github.com/pinterest/PodToBUILD/releases/tag/0.22.0-ee8466e
@rahul-malik Thanks a lot!