xchammer icon indicating copy to clipboard operation
xchammer copied to clipboard

Running from rule fails: Missing XCHammerAssets (& more)

Open cpsauer opened this issue 3 years ago • 9 comments

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

cpsauer avatar Oct 22 '20 01:10 cpsauer

I am experiencing these issues as well.

daltonclaybrook avatar Dec 10 '20 02:12 daltonclaybrook

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

joprice avatar Jan 24 '21 23:01 joprice

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

cpsauer avatar Jan 25 '21 01:01 cpsauer

It generates the project, and then I hit a likely unrelated bug to this one I opened an issue for here: https://github.com/pinterest/xchammer/issues/273

joprice avatar Jan 25 '21 01:01 joprice

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).

cpsauer avatar Jan 25 '21 02:01 cpsauer

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?

joprice avatar Jan 25 '21 20:01 joprice

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 https://github.com/bazelbuild/tulsi/issues/187#issuecomment-732642704

cpsauer avatar Nov 11 '21 07:11 cpsauer

Any updates on this issue?

dnlbl avatar Nov 29 '21 10:11 dnlbl

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.

cpsauer avatar Nov 29 '21 19:11 cpsauer