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

Running from rule fails: Missing XCHammerAssets (& more) #267

Open
cpsauer opened this issue Oct 22, 2020 · 9 comments
Open

Running from rule fails: Missing XCHammerAssets (& more) #267

cpsauer opened this issue Oct 22, 2020 · 9 comments

Comments

@cpsauer
Copy link

cpsauer commented Oct 22, 2020

Hi all,

Thanks for releasing and working on this. I was excitedly trying to give XCHammer a whirl but pretty quickly ran into issues on all avenues and didn't get it off the ground. Bummer. Conceptually it looks really great! I'd love to use it if there's a way to get it to work. If anyone is making it through the above and using XCHammer successfully, I'd love to hear from you, too!

So I'm writing what I found, thinking that others might be running into the same things. Some of the issues I hit seem to be reported already and some not.

The first issue is that trying to use bazel's xcode_project rule like in the README crashes with basically the same error as #182 reported for CLI usage.

Fatal error: Missing XCHammerAssets: <redacted>/execroot/<WORKSPACE_NAME>/external/xchammer/xchammer.app/Contents/Resources/XCHammerAssets: file Sources/XCHammer/Generator.swift, line 852

[The docs in the README also seem to be a bit stale? @xchammer//:xcodeproject.bzl doesn't exist, so I swapped in @xchammer//:BazelExtensions/xcodeproject.bzl. And used the latest release, instead of the one listed. And then paths seems to have been removed as an argument and folded into project_config rules (undocumented?). Happy to file a PR for these, but figured maybe I should get it to work before you'd want me contributing. In any event, didn't matter, because the XCHammerAssets crash seems to block use of the rule for now.]

So next up, I tried things from the command line. Ran into the same error (as noted in #182), but as described in the comments of that issue, calling it from /usr/local/bin/xchammer.app/Contents/MacOS/xchammer does avoid the crash...only to have it immediately hit something else. And it's a pretty weird one. Looks like it's trying to access a BUILD file as a directory? And com_google_protobuf isn't even a folder in the main workspace, regardless; it's brought in as an external dependency in the WORKSPACE file.

swiftException(XCHammerSources.Generator.GenerateError.some(Error Domain=NSCocoaErrorDomain Code=260 "The folder “BUILD” doesn’t exist." UserInfo={NSFilePath=<WORKSPACE DIR>/com_google_protobuf/BUILD, NSUserStringVariant=(
    Folder
), NSUnderlyingError=0x7fc2d34bb380 {Error Domain=NSOSStatusErrorDomain Code=-43 "fnfErr: File not found"}}))
The operation couldn’t be completed. (Commandant.CommandantError<XCHammerSources.CommandError> error 1.)  

So to sum: I was excited to try out XCHammer but quickly hit blocking bugs on both recommended usages. It seemed like I'd spent enough time that I should file an issue, ask for help, and see if anyone else has gotten through.

Thanks so much,
Chris

@daltonclaybrook
Copy link

I am experiencing these issues as well.

@joprice
Copy link

joprice commented Jan 24, 2021

I get this error if I don't use --spawn_strategy=standalone

@cpsauer
Copy link
Author

cpsauer commented Jan 25, 2021

Ooh, do we have a workaround!? @joprice, how far does passing that flag get you? Can anyone get XCHammer into a working state?

@joprice
Copy link

joprice commented Jan 25, 2021

It generates the project, and then I hit a likely unrelated bug to this one I opened an issue for here: #273

@cpsauer
Copy link
Author

cpsauer commented Jan 25, 2021

Bummer :/ FWIW, I did get eventually get tulsi working very nicely. Happy to help with that if this is getting you down (workarounds for all issues I needed to solve also posted in their respective issues).

@joprice
Copy link

joprice commented Jan 25, 2021

Thanks! I am interested in at least getting Tulsi to work, even though xchammer seems to be much nicer. Tulsi does build the project, but I'm not sure I have it configured correctly. Do you have a repo with an example tulsi setup?

@cpsauer
Copy link
Author

cpsauer commented Nov 11, 2021

I don't have a public example repo, but their into docs plus the import setup in this comment should get you (or anyone reading this later) well on their way bazelbuild/tulsi#187 (comment)

@dnlbl
Copy link

dnlbl commented Nov 29, 2021

Any updates on this issue?

@cpsauer
Copy link
Author

cpsauer commented Nov 29, 2021

I'd love to report otherwise, but it looks from this and other issues like perhaps they've quietly stopped working on this--or at least stopped supporting public use.

(Pinterest folks, I'd love to be wrong, and hope I haven't offended you! Let us know. Would happily edit/delete if incorrect. I'm only saying this because as is lots of folks try to evaluate XCHammer, only to be sad they can't get it to work, and I'd love to save them time.)

If that's right, I'd really recommend using tulsi! See the instructions link above. I got that working nicely and they were good about taking PRs for issues and rough edges I found.

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

4 participants