idb icon indicating copy to clipboard operation
idb copied to clipboard

Build companion via github actions workflow

Open stoefln opened this issue 2 years ago • 6 comments

Since I didn't manage to build the project locally, has anyone tried to create a github workflow for this?

stoefln avatar Jan 31 '24 11:01 stoefln

Hello, I'm very sorry to bother you.

I saw in other issues that you have successfully compiled this project. Could you please share your compilation process? Thank you so much!

I keep building failing in macOS 13.6.6 (22G630) + xcode 15.2 (15C500b) + intel cpu, I am using ./idb_build.sh idb_companion build build_output from idb_companion_oss_release.py and it seems to return got an error from grpc -swift:

/Users/dev/idb/build/SourcePackages/checkouts/grpc-swift/Sources/GRPC/GRPCServerPipelineConfigurator.swift:121:7: error: mutation of captured var 'logger' in concurrently-executing code
        logger[metadataKey: MetadataKey.h2StreamID] = "\(streamID)"
        ^
/Users/dev/idb/build/SourcePackages/checkouts/grpc-swift/Sources/GRPC/GRPCServerPipelineConfigurator.swift:125:86: error: reference to captured var 'logger' in concurrently-executing code
          let handler = self.makeHTTP2ToRawGRPCHandler(normalizeHeaders: true, logger: logger)

Any help would be greatly appreciated!

flyqie avatar May 07 '24 13:05 flyqie

I had the same issue, but I could successfully build by

  • Update the grpc-swift from 1.11.0 to 1.23.0 https://github.com/facebook/idb/blob/45666c7476b62f22e1f210e55e1fa31359d8165d/idb_companion.xcodeproj/project.pbxproj#L1592
  • Build plugins manually in the build folder https://github.com/grpc/grpc-swift?tab=readme-ov-file#getting-the-protoc-plugins

suzukieita avatar May 08 '24 04:05 suzukieita

I had the same issue, but I could successfully build by

  • Update the grpc-swift from 1.11.0 to 1.23.0 https://github.com/facebook/idb/blob/45666c7476b62f22e1f210e55e1fa31359d8165d/idb_companion.xcodeproj/project.pbxproj#L1592
  • Build plugins manually in the build folder https://github.com/grpc/grpc-swift?tab=readme-ov-file#getting-the-protoc-plugins

~~Thanks but after adding this I got the following error:~~

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/CompanionLib.h"
        ^
/Users/dev/idb/CompanionLib/CompanionLib.h:8:9: note: in file included from /Users/dev/idb/CompanionLib/CompanionLib.h:8:
#import <CompanionLib/FBIDBCommandExecutor.h>
        ^
/Users/dev/idb/CompanionLib/FBIDBCommandExecutor.h:10:9: error: 'FBControlCore/FBControlCore.h' file not found
#import <FBControlCore/FBControlCore.h>
        ^
<unknown>:0: error: could not build Objective-C module 'CompanionLib'

~~I'm so sorry, I searched a lot for related solutions but it still seems to be there, which is really frustrating.~~

Update: Sorry, there are no problems now. The previous problem was caused by me forgetting to install the ios simulator in the new environment.

flyqie avatar May 08 '24 16:05 flyqie

Since I didn't manage to build the project locally, has anyone tried to create a github workflow for this?

Not sure if you still need it now.

I have created a github actions workflow that compiles both idb.whl and idb_companion.

https://github.com/flyqie/idb/blob/main/.github/workflows/deploy_packages.yml

flyqie avatar May 09 '24 09:05 flyqie

@flyqie can someone enlighten me how to make use of those files? how can I tell my local idb installation to use the updated files?

stoefln avatar May 09 '24 10:05 stoefln

@flyqie can someone enlighten me how to make use of those files? how can I tell my local idb installation to use the updated files?

idb finds the location of the idb_companion binary in the following way.

https://github.com/facebook/idb/blob/45666c7476b62f22e1f210e55e1fa31359d8165d/idb/cli/main.py#L120-L123 https://github.com/facebook/idb/blob/45666c7476b62f22e1f210e55e1fa31359d8165d/idb/cli/main.py#L162-L167

flyqie avatar May 09 '24 10:05 flyqie