Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at Bazel for iOS developers and outline #235

Merged
merged 43 commits into from
Aug 19, 2020

Conversation

jerrymarino
Copy link
Collaborator

This document is an introduction to Bazel for iOS developers.

Putting this up in the current state to get feedback and suggestions
from the community

Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
This document is an introduction to Bazel for iOS developers.

Putting this up in the current state to get feedback and suggestions
from the community
@jerrymarino jerrymarino force-pushed the jmarino_bazel_for_ios_developers branch from d194162 to 7f82b3f Compare August 6, 2020 22:01
@jerrymarino jerrymarino changed the title WIP: first pass at Bazel for iOS developers and outline First pass at Bazel for iOS developers and outline Aug 6, 2020
Copy link
Collaborator

@rahul-malik rahul-malik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pretty helpful guide, I would get a handful of product engineers less familiar with Bazel to read through and see if it makes sense or if clarifications are needed.

It could be cool at the end to demonstrate how to use things like bazel query or writing a simple custom rule to show off the advantages

Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Show resolved Hide resolved
Copy link
Contributor

@jszumski jszumski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested some grammar and typo fixes, but overall this is fantastic! I think there's an opportunity to beef up the "Fixing common Bazel errors" section with a few more examples.

Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved
Docs/BazelForiOSDevelopers.md Outdated Show resolved Hide resolved

### Generated Xcode projects

In an Xcode world, folks checked in a project which contains an listing of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In an Xcode world, folks checked in a project which contains an listing of
In an Xcode world, folks checked in a project which contains a listing of


Generators like XCHammer and Tulsi take care of integrating Bazel into the IDE.
Bazel builds are invoked a shell script build phase from the IDE. Basically,
Xcode shells out to Bazel to produce the application, and then Xcode picks up
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Xcode pick it up directly from derived data path? I guess it's worth mentioning that Tulsi manages that at least, otherwise one may think that it works out of the box with just a run script phase that builds the app.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BalestraPatrick This is a really good point, simply put, yes we currently rsync artifacts into the built products in derived data for xcode to pick it up.

For our internal simulator dev builds, there's a much more performant code path than what Xcode can do. We have a dynamic library architecture and integration where dyld3 loads dylibs residing in bazel-out via an rpath written into the binary. This is probably too in-depth and should be in a performance optimization segment along with the rules that allow this.

@jerrymarino jerrymarino merged commit 54c70ed into master Aug 19, 2020
@jerrymarino jerrymarino deleted the jmarino_bazel_for_ios_developers branch August 19, 2020 23:53
@jerrymarino
Copy link
Collaborator Author

Thank you all kindly for your contributions and edits to this document. So many thanks to @rahul-malik and @garrettmoon and @jszumski @BalestraPatrick for all the edits!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants