rules_swift icon indicating copy to clipboard operation
rules_swift copied to clipboard

Update remote swift debugging doc

Open keith opened this issue 3 years ago • 8 comments

As far as I can tell at this point the local debugging options enabled module is no longer required at least with Swift 5.6+, as long as you correctly set the framework search paths to include the directories containing XCTest.

keith avatar Jun 10 '22 23:06 keith

Lyft integration job started: https://buildkite.com/lyft/rules-swift/builds/408 (must be Lyft employee to view)

lyft-lint-bot avatar Jun 10 '22 23:06 lyft-lint-bot

I've seen otherwise. I was going to have to set lots of LLDB settings, and it wouldn't fully cover every situation that _LocalDebugOptions would cover.

I'll test again next week and report some detailed findings here. Maybe I was holding it wrong.

brentleyjones avatar Jun 11 '22 00:06 brentleyjones

Yea I'd love to see any case you can come up with. I dropped this internally and it seems to work in my testing. Although it's a bit sketchy sometimes because I found I had to kill lldb-rpc-server sometimes to invalidate it's cache

keith avatar Jun 11 '22 01:06 keith

I re-read your changes. They are technically correct, since setting target.swift-framework-search-paths, target.clang-module-search-paths, etc. will work around most issues. I asked about this here though: https://ios-dev-at-scale.slack.com/archives/C019VJ6LK2T/p1651788632722239, and my main concern is if you end up using different flags for PCM compilation, or having same named frameworks at different paths, for various top-level targets. Maybe that will never really happen in practice, but it's been my main hesitation to not telling people about the _LocalDebugOptions technique.

brentleyjones avatar Jun 13 '22 18:06 brentleyjones

If I understand that conversation correctly I don't think we're really solving that in the original solution or this new solution as we still recommend you disable that globally, so if there isn't 1 set of flags that works for you (that are also the ones passed to the local debug options module), it wouldn't work either way since you're dropping these for all the others regardless? So you could just set the one set of flags that would otherwise apply to your single local module to the lldb setting? I think the real solution in general is https://github.com/bazelbuild/rules_swift/issues/842 but I don't have time to investigate that at the moment

keith avatar Jun 13 '22 18:06 keith

bump, am i missing a case with this?

keith avatar Jul 07 '22 18:07 keith

@brentleyjones bump

keith avatar Sep 02 '22 17:09 keith

Setup a lldbinit that restores any of the options that were intended to be set in the swiftmodule files

It does require more than you state in the PR description, when dealing with Objective-C dependencies. And Use `-serialize-debugging-options` locally in one empty module can be a nice solution for some. Doing the lldbinit correctly can be tricky: https://github.com/buildbuddy-io/rules_xcodeproj/blob/f95830d20cbee5fb30ccca95db1574cc10844548/tools/generator/src/Generator/CreateFilesAndGroups.swift#L634-L841

But, since rules_xcodeproj now solves this for any use case I'm going to recommend, I'm fine with removing that portion 🤷‍♂️.

brentleyjones avatar Sep 02 '22 18:09 brentleyjones