idb icon indicating copy to clipboard operation
idb copied to clipboard

Cannot build idb_companion in Xcode 15.0 on the current master (2022-09-19)

Open mforys opened this issue 1 year ago • 4 comments

Description

I cannot build idb_companion in Xcode 15.0 on the current master (2022-09-19).

Reproduction

RuleScriptExecution /Users/marek/Library/Developer/Xcode/DerivedData/idb_companion-egamwafdjrhfidaompecbbuqtunn/Build/Intermediates.noindex/idb_companion.build/Debug/IDBGRPCSwift.build/DerivedSources/idb.pb.swift /Users/marek/Library/Developer/Xcode/DerivedData/idb_companion-egamwafdjrhfidaompecbbuqtunn/Build/Intermediates.noindex/idb_companion.build/Debug/IDBGRPCSwift.build/DerivedSources/idb.grpc.swift /Users/marek/_repos/_originals/idb/proto/idb.proto normal undefined_arch (in target 'IDBGRPCSwift' from project 'idb_companion')
    cd /Users/marek/_repos/_originals/idb
    /bin/sh -c \#\ Generate\ grpc\ code\ from\ .proto'
'PATH\=\$PATH:/opt/homebrew/bin/:/usr/local/bin:\$HOME/homebrew/bin/'
''
'GRPC_PACKAGE_DIR\=\$\{BUILD_DIR%Build/\*\}SourcePackages/checkouts/grpc-swift'
''
'protoc\ \\'
'\ \ --proto_path\=\$INPUT_FILE_DIR\ \\'
'\ \ --swift_out\=\$DERIVED_FILE_DIR\ \\'
'\ \ --grpc-swift_out\=\$DERIVED_FILE_DIR\ \\'
'\ \ --grpc-swift_opt\=Visibility\=Public\ \\'
'\ \ --swift_opt\=Visibility\=Public\ \\'
'\ \ --plugin\=protoc-gen-grpc-swift\=\$GRPC_PACKAGE_DIR/.build/release/protoc-gen-grpc-swift\ \\'
'\ \ --plugin\=protoc-gen-swift\=\$GRPC_PACKAGE_DIR/.build/release/protoc-gen-swift\ \\'
'\ \ \$INPUT_FILE_PATH'
'

/bin/sh: line 6: protoc: command not found
Command RuleScriptExecution failed with a nonzero exit code

Additional Information

  • idb revision:
commit fdb96ec46b9826762adfe0b34b5b1a892ee4ac6d (HEAD -> main, origin/main, origin/HEAD)
Author: Endre Fejes <[email protected]>
Date:   Mon Sep 18 02:18:52 2023 -0700

    Add iPhone 14* and 15* devices

mforys avatar Sep 19 '23 10:09 mforys

Actually, when I follow the documentation even this step fails as there is no Podfile ...

➜  idb git:(main) pod install
[!] No `Podfile' found in the project directory.
➜  idb git:(main) 

mforys avatar Sep 19 '23 10:09 mforys

@mforys you should install protoc first.

answer-huang avatar Sep 24 '23 04:09 answer-huang

Similar issue here,

./idb_build.sh idb_companion build /Users/JJ/Downloads
/bin/sh: line 6: protoc: command not found
Command RuleScriptExecution failed with a nonzero exit code

note: Run script build phase 'Build Shimulators' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'FBControlCore' from project 'FBSimulatorControl')
/Users/jj/Github/idb/idb_companion.xcodeproj: warning: DEFINES_MODULE was set, but no umbrella header could be found to generate the module map (in target 'IDBGRPCSwift' from project 'idb_companion')
** BUILD FAILED **


The following build commands failed:
	RuleScriptExecution /Users/jj/Github/idb/build/Build/Intermediates.noindex/idb_companion.build/Release/IDBGRPCSwift.build/DerivedSources/idb.pb.swift /Users/jj/Github/idb/build/Build/Intermediates.noindex/idb_companion.build/Release/IDBGRPCSwift.build/DerivedSources/idb.grpc.swift /Users/jj/Github/idb/proto/idb.proto normal undefined_arch (in target 'IDBGRPCSwift' from project 'idb_companion')

Fixed by re-installing protobuf and force symlinking it.

brew install protobuf
brew link --overwrite protobuf
which protoc
/opt/homebrew/bin/protoc

Re-running the idb_build.sh works now.

Compiling using idb_companion.xcworkspace works now too!

JJdeGroot avatar Sep 26 '23 15:09 JJdeGroot

This might be slightly off-topic, but I didn't find any information on this elsewhere: If we build idb-companion, how can we "use" it? Do I need to tell the python client somehow to use the built version rather than the official version?

stoefln avatar Jan 31 '24 11:01 stoefln