You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Xcode iOS simulator build fails when codeql is injected #147
2022-11-18T14:31:19.4879860Z dyld: dyld cache load error: shared cache file open() failed
2022-11-18T14:31:19.4882650Z dyld: could not load inserted library '/Users/runner/work/_temp/codeql3000/github/codeql/tools/osx64/libtrace.dylib' because no suitable image found. Did find:
2022-11-18T14:31:19.4885600Z /Users/runner/work/_temp/codeql3000/github/codeql/tools/osx64/libtrace.dylib: mach-o, but not built for platform iOS-sim
success.log is the same build, without codeql enabled, so that you can compare.
Also attached is codeql-init.log, with the output of the CodeQL init task.
I tested with the latest codeql, 2.11.4, and the error still happens.
Thanks for investigating & hopefully fixing or suggesting a workaround.
The hardware / OS is (I'm pretty sure) an Intel based Mac running macOS 11 (Big Sur). It's the internal-macos11 image for us. I will try with macos12 (Monterey) to see if it makes a difference.
@MathiasVP - No difference with Monterey. Would access to the https://github.com/xamarin/ios-sim-sharp help? I just granted you access - look for an invite to accept. If you clone you should be able to build locally. Note that the build currently uses Xcode 12.5 - a bit old, but required currently for builds. That may be part of the issue - you may need Xcode 12.5 to repro. You can install it from here: https://developer.apple.com/download/all/?q=xcode. Thanks.
Sorry about the delay, @BretJohnson. Thanks for the invitation. I've accepted it now. We can reproduce your issue and we're looking into a solution. Will keep you updated on this issue.
@MathiasVP - I hope you all had a good holiday break. Please holler when you have any updates here. We'd like to complete our CodeQL compliance work and this is a blocker for us. Thx again for your help.
Quick update: We're still figuring out the solution here, but suspect the underlying problem is that the CodeQL build tracer (which instruments your build to obtain information from the compilers while they run) does not correctly handle binaries built to target the ios-sim platform, and is incorrectly attempting to handle them as standard mach-o binaries.
We have two possible strategies in mind, but need to experiment with each before we can offer you a solution to test:
Short-term: Identify the exact name of the binary in your build that is targeting ios-sim, and update our build tracer configuration to ignore this binary.
Long-term: Teach the build tracer on macOS to ignore all binaries in general that are not built for the macOS target platform.
Thanks for your patience and the reminder. We have implemented the long-term fix I outlined above and it will be included in CodeQL 2.12.2, which will be rolled out from mid-February.
@MathiasVP 2.12.2 was released (per the link above) 3 weeks ago but it looks like the CodeQL task we're using is still on 2.12.1 by default. I can force use of the newer version with the variables below if I can get the hash for the 2.12.2 release. Do you know where to get that, the release hash? Thanks.
Example of forcing explicit codeql version:
CodeQL.CLIVersion: 2.11.4
CodeQL.CLIHash: d2af01639c3823249b111696f79dc611e08a7b1799b034b3cb304fa21f09bed9
Update: I found the steps and force of 2.12.2 now. Unfortunately, I still see the codeql related build error on it: " LaunchScreen.storyboard : error : dyld: could not load inserted library '/Users/runner/work/_temp/codeql3000/github/codeql/tools/osx64/libtrace.dylib' because no suitable image found. Did find: [/Users/runner/work/1/s/MonoTouch.Hosting.Tests.iOS/MonoTouch.Hosting.Tests.iOS.csproj]".
Thanks for following up on this. This part of the error message seems relevant mach-o, but not built for platform iOS-sim. I'll ask a colleague to have a look at this.
Guessing from the project name, it appears the failure happens in test code. You could try skipping the test execution or excluding the test project from the build.
Activity
MathiasVP commentedon Dec 12, 2022
Hi @BretJohnson,
Thanks for your issue. We're trying to reproduce your issue, but without any luck so far.
Could you please tell us what kind of environment (i.e., OS and hardware) you're running on?
BretJohnson commentedon Dec 13, 2022
Here is a build pipeline that fails, which may help: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7081421&view=logs&j=2531f56b-95d7-58fc-e11b-e55dd667c1ed&t=c0ac43a8-fd5c-5003-10b7-fe1098fdc19d. Let me know if you don't have access.
The hardware / OS is (I'm pretty sure) an Intel based Mac running macOS 11 (Big Sur). It's the
internal-macos11image for us. I will try with macos12 (Monterey) to see if it makes a difference.BretJohnson commentedon Dec 15, 2022
@MathiasVP - No difference with Monterey. Would access to the https://github.com/xamarin/ios-sim-sharp help? I just granted you access - look for an invite to accept. If you clone you should be able to build locally. Note that the build currently uses Xcode 12.5 - a bit old, but required currently for builds. That may be part of the issue - you may need Xcode 12.5 to repro. You can install it from here: https://developer.apple.com/download/all/?q=xcode. Thanks.
MathiasVP commentedon Dec 15, 2022
Sorry about the delay, @BretJohnson. Thanks for the invitation. I've accepted it now. We can reproduce your issue and we're looking into a solution. Will keep you updated on this issue.
BretJohnson commentedon Jan 3, 2023
@MathiasVP - I hope you all had a good holiday break. Please holler when you have any updates here. We'd like to complete our CodeQL compliance work and this is a blocker for us. Thx again for your help.
adityasharad commentedon Jan 11, 2023
Quick update: We're still figuring out the solution here, but suspect the underlying problem is that the CodeQL build tracer (which instruments your build to obtain information from the compilers while they run) does not correctly handle binaries built to target the
ios-simplatform, and is incorrectly attempting to handle them as standardmach-obinaries.We have two possible strategies in mind, but need to experiment with each before we can offer you a solution to test:
ios-sim, and update our build tracer configuration to ignore this binary.mariaghiondea commentedon Jan 25, 2023
Any updates on this? It's still blocking our teams from enabling CodeQL (on 2-3 repos)
adityasharad commentedon Jan 25, 2023
Thanks for your patience and the reminder. We have implemented the long-term fix I outlined above and it will be included in CodeQL 2.12.2, which will be rolled out from mid-February.
BretJohnson commentedon Feb 20, 2023
@adityasharad Can you say if CodeQL 2.12.2 is available yet or, if not, about when it will be available. Thanks much.
MathiasVP commentedon Feb 20, 2023
2.12.2 has been released. See https://github.com/github/codeql-cli-binaries/releases/tag/v2.12.2 🙂.
BretJohnson commentedon Feb 26, 2023
@MathiasVP 2.12.2 was released (per the link above) 3 weeks ago but it looks like the CodeQL task we're using is still on 2.12.1 by default. I can force use of the newer version with the variables below if I can get the hash for the 2.12.2 release. Do you know where to get that, the release hash? Thanks.
Example of forcing explicit codeql version:
CodeQL.CLIVersion: 2.11.4
CodeQL.CLIHash: d2af01639c3823249b111696f79dc611e08a7b1799b034b3cb304fa21f09bed9
BretJohnson commentedon Mar 7, 2023
Update: I found the steps and force of 2.12.2 now. Unfortunately, I still see the codeql related build error on it: " LaunchScreen.storyboard : error : dyld: could not load inserted library '/Users/runner/work/_temp/codeql3000/github/codeql/tools/osx64/libtrace.dylib' because no suitable image found. Did find: [/Users/runner/work/1/s/MonoTouch.Hosting.Tests.iOS/MonoTouch.Hosting.Tests.iOS.csproj]".
The build is here: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7432542&view=logs&j=2531f56b-95d7-58fc-e11b-e55dd667c1ed&t=c0ac43a8-fd5c-5003-10b7-fe1098fdc19d
Can you please take a look. Thanks.
BretJohnson commentedon Mar 20, 2023
@MathiasVP / others - Ping on this. The problem is still happening, even with CodeQL 2.12.2. See above. Can you please take a look. Thanks.
aibaars commentedon Mar 21, 2023
Thanks for following up on this. This part of the error message seems relevant
mach-o, but not built for platform iOS-sim. I'll ask a colleague to have a look at this.Guessing from the project name, it appears the failure happens in test code. You could try skipping the test execution or excluding the test project from the build.