johnno1962 / InjectionIII

Re-write of Injection for Xcode in (mostly) Swift
MIT License
4.01k stars 318 forks source link

[Question] Does InjectionIII supports Bazel 6.1.x? #452

Closed Kingtous closed 1 year ago

Kingtous commented 1 year ago

Recently I upgraded bazel to 6.x in my project, And I've found the same complains as https://github.com/johnno1962/InjectionIII/issues/448 mentioned. It says:

Could not locate compile command for
This could be due to one of the following:
1. Injection does not work with Whole Module Optimization.
2. There are restrictions on characters allowed in paths.
3. File paths in the simulator are case sensitive.
4. The modified source file is not in the current project.
5. The source file is an XCTest that has not been run yet.
6. Xcode has removed the build logs. Edit a file and re-run.
Try a build clean then rebuild to make logs available or
consult: "/Users/xxx/Library/Developer/CoreSimulator/Devices/C9FBD644-3B3C-4223-A894-491E9205E223/data/Containers/Data/Application/9C926E27-345F-4906-87B5-824B76B90369/tmp/command.sh".

eval101.error and eval101.sh are both empty.

The project does not use Swift but PURE Objective-C.

I've tried the latest version of InjectionIII on Github, XCode 14.2, iOS Simulator.

Maybe Bazel 6.x.x is not supported by InjectionIII yet?

johnno1962 commented 1 year ago

Hi, I haven't looked at it at all to be honest. Any chance you could prepare a small example Bazel/Objective-C project.I could look at? Actually, I don't think I can support Objective-C + Bazel given how the patch worked. Did it work in the past?

Kingtous commented 1 year ago

Yes. 4.6.x - latest(4.7.x) of InjectionIII work on my project if I downgrade bazel to 5.0.0.

I'll try to make a small example these days. Anyway, any suggestions I can debug this problem when using Bazel 6.x?

johnno1962 commented 1 year ago

At this stage I have no idea what the problem could be and I'm surprised it ever worked with Objective-C TBH. If you could prepare the example project that would be a big help but Bazel support is not really core InjectionIII functionality. You may be the only person in the world using it!

johnno1962 commented 1 year ago

It's all a question of what is logged by the Bazel build. If you want to look at this (I remember your PR when I broke Bazel builds a couple of months ago) Start by adding the HotReloading project to your target project and getting it working with Bazel 5, then upgrading to 6.0 and looking at what the scripts see when they try to extract the build command and start debugging. Perhaps you just have to add a verbose loging option somewhere.

Kingtous commented 1 year ago

It's all a question of what is logged by the Bazel build. If you want to look at this (I remember your PR when I broke Bazel builds a couple of months ago) Start by adding the HotReloading project to your target project and getting it working with Bazel 5, then upgrading to 6.0 and looking at what the scripts see when they try to extract the build command and start debugging. Perhaps you just have to add a verbose loging option somewhere.

Yes, i've agree maybe a verbose is needed. Investigating.

Kingtous commented 1 year ago

At this stage I have no idea what the problem could be and I'm surprised it ever worked with Objective-C TBH. If you could prepare the example project that would be a big help but Bazel support is not really core InjectionIII functionality. You may be the only person in the world using it!

Yes, It works with Objective-C too.

johnno1962 commented 1 year ago

Hi, any luck working this out?

Kingtous commented 1 year ago

Sorry for being late due to busy these weeks. I've tried a bear new objective-c project with bazel 6.x and it works. Perhaps the development environment of mine has some specific configurations which disables or omits the build log. I've checked again these days. Thanks. :). I think we can close this issue and if i have any news I will open a new issue or pr.