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

Create homebrew formula for fbsimctl #120

Closed
lawrencelomax opened this issue Dec 21, 2015 · 21 comments
Closed

Create homebrew formula for fbsimctl #120

lawrencelomax opened this issue Dec 21, 2015 · 21 comments

Comments

@lawrencelomax
Copy link
Contributor

No description provided.

@gblotter
Copy link
Contributor

+1

1 similar comment
@tapthaker
Copy link

+1

@lawrencelomax
Copy link
Contributor Author

WIP gist of how far I currently am. I can easily create and install the framework, but the build of fbsimctl fails with xcodebuild as it can't find the FBSimulatorControl module when compiling the fbsimclt target.

Current plan is to:

  1. Build the FBSimulatorControl Framework target
  2. Install it with the Homebrew API
  3. Build fbsimctl.
  4. Use install_name_tool to modify the rpath of the fbsimctl binary to include the install path of the FBSimulatorControl framework.
  5. Install the binary with the Homebrew API.

@lawrencelomax lawrencelomax mentioned this issue Jan 5, 2016
18 tasks
@tapthaker
Copy link

I will take up the task of installing fbsimctl with the Homebrew API.

@tapthaker
Copy link

Modified the Formula that you have given, you can find it here , however, facing some problems while modifying the rpath.

Also how do we generally proceed with brew formula ? Should I send a pull request to this Repo or should I directly send a pull request to HomeBrew.

@tapthaker
Copy link

Updated the above referenced gist, was able to install it 😎 . Let me know about how do you want to integrate with the repo, or do i directly submit it to homebrew.

@lawrencelomax
Copy link
Contributor Author

Awesome Work 👍!

Also how do we generally proceed with brew formula ? Should I send a pull request to this Repo or should I directly send a pull request to HomeBrew.

Opening a PR in this repo with the formula in the fbsimctl directory. It means that we can review the changes in a PR for this repo and have a canonical source until this gets merged into the true Homebrew formula repo.

You should probably also open a PR on the Homebrew repo. Homebrew prefer formulas that aren't submitted by the 'owner'. You'll also be able to get feedback on the acceptability of the formula.

You will want to confirm whether you can rely on the derivedData location rather than fixing the underlying issue. I've grepped the Homebrew repo and can't find that this is used before. All of the formulas that use xcodebuild use SYMROOT and DSTROOT. I would imagine this has something to do with how Homebrew approaches sandboxing. I understand that you were probably hitting the same build issue that I was when building the fbsimctl scheme, but this may be a requirement that is necessary for a homebrew formula.

One of the requirements for a homebrew formula is a tagged version, which we do not currently have. There's a number of tasks that need finishing before I'm happy to tag a provisional version #70. I think we can get to this place pretty soon, but I'm sure it's possible to run from a forked homebrew with --head until that point.

@lawrencelomax
Copy link
Contributor Author

It looks like -derivedDataPath foobar will work in place of SYMROOT=foobar to make the build directory relative to the checkout. I'm looking to tag a v0.1 once there's some more documentation for fbsimctl.

@odlp
Copy link

odlp commented May 31, 2016

@tapthaker I was trying out the latest version of your gist formula (thanks!) but can't install fbsimctl.

When the xcodebuild config is release (as per the gist) I get the following issue:

** BUILD FAILED **


The following build commands failed:
    CompileC derivedData/Build/Intermediates/FBSimulatorControl.build/Release/XCTestBootstrap.build/Objects-normal/x86_64/XCTestBootstrapFrameworkLoader.o XCTestBootstrap/Utility/XCTestBootstrapFrameworkLoader.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

With the debug config I get an error about Swifter missing (presumably because there's no Carthage bootstrap step):


/tmp/fbsimctl-20160531-39335-adas5y/FBSimulatorControl-master/fbsimctl/FBSimulatorControlKit/Sources/HttpRelay.swift:12:8: error: no such module 'Swifter'
import Swifter
       ^

** BUILD FAILED **


The following build commands failed:
    CompileSwift normal x86_64 /tmp/fbsimctl-20160531-39335-adas5y/FBSimulatorControl-master/fbsimctl/FBSimulatorControlKit/Sources/CLI.swift
    CompileSwift normal x86_64 /tmp/fbsimctl-20160531-39335-adas5y/FBSimulatorControl-master/fbsimctl/FBSimulatorControlKit/Sources/CommandBuffer.swift
    CompileSwift normal x86_64 /tmp/fbsimctl-20160531-39335-adas5y/FBSimulatorControl-master/fbsimctl/FBSimulatorControlKit/Sources/Arguments.swift
    CompileSwift normal x86_64 /tmp/fbsimctl-20160531-39335-adas5y/FBSimulatorControl-master/fbsimctl/FBSimulatorControlKit/Sources/Environment.swift
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(5 failures)

Any ideas what I'm doing wrong?

@lawrencelomax
Copy link
Contributor Author

@odlp you're correct. Swifter is a dependency of fbsimctl (needed to provide the HTTP Server).

There have been some changes FBSimulatorControl builds, which means you'll just need fbsimctl to have the @rpath to FBSimulatorControlKit. FBSimulatorControlKit is now the only dependency of fbsimctl, as long as it can be dynamically linked then you should be golden.

@odlp
Copy link

odlp commented Jun 3, 2016

@lawrencelomax thanks for the tip, I'll give that a try!

@tapthaker
Copy link

Updated the formula.

Swifter is a dependency that gets installed using Carthage

Turns out I had to change rpath for FBControlCore & XCTestBootstrap as well. If only we can bundle these frameworks into the FBSimulatorControlKit.

@lawrencelomax
Copy link
Contributor Author

Turns out I had to change rpath for FBControlCore & XCTestBootstrap as well. If only we can bundle these frameworks into the FBSimulatorControlKit

I have something locally for doing this, it's just a matter of adding them to the bundled FBSimulatorControlKit and they will then exist on the @rpath

@tapthaker
Copy link

Hey, @lawrencelomax let me know when this is done. I will submit the formula to homebrew after that.

@lanzelot1989
Copy link

lanzelot1989 commented Jul 21, 2016

+1
Hey, is there any new information on that? Using fbsimctl via Homebrew would be a huge timesaver for us.

@lawrencelomax
Copy link
Contributor Author

@lanzelot1989 I have a formula ready. I just need to update the README, tag a version and then get it merged.

I'll probably have it merged to the facebook tap for the time being.

@lanzelot1989
Copy link

Doing God's work. Is there a documentation available for the parameters of fbsimctl?

@lawrencelomax
Copy link
Contributor Author

Is there a documentation available for the parameters of fbsimctl?

That's where finishing up the README comes in! If you want something to look at immediately, there are unit tests for the CLI parsers.

I'm also building out an e2e test suite in Python for testing the cli, with some additional logging it could provide some good usage examples.

@lawrencelomax
Copy link
Contributor Author

I have a pull request that I'll update with the appropriate hashes and will tag a release once I land some imminent documentation changes.

@lawrencelomax
Copy link
Contributor Author

lawrencelomax commented Jul 25, 2016

This is now merged you have to brew tap facebook/fb first to get the formulas from the Facebook tap, then just brew install fbsimctl. Must be run with Xcode 7.1 or greater. Will not build on Xcode 8 until the Swift source is migrated.

@lawrencelomax
Copy link
Contributor Author

This is now documented in the fbsimctl readme. Have Fun!

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

No branches or pull requests

5 participants