PodToBUILD icon indicating copy to clipboard operation
PodToBUILD copied to clipboard

Use rules_pods as a source dependency

Open thii opened this issue 5 years ago • 4 comments

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?

thii avatar Mar 08 '19 03:03 thii

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.

jerrymarino avatar Mar 08 '19 04:03 jerrymarino

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

rahul-malik avatar Mar 08 '19 06:03 rahul-malik

@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 avatar Mar 20 '19 00:03 rahul-malik

@rahul-malik Thanks a lot!

thii avatar Mar 20 '19 07:03 thii