Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS status-go builds failing with C compiler not found #13949

Closed
jakubgs opened this issue Sep 7, 2022 · 5 comments · Fixed by #13975
Closed

iOS status-go builds failing with C compiler not found #13949

jakubgs opened this issue Sep 7, 2022 · 5 comments · Fixed by #13975
Assignees
Labels

Comments

@jakubgs
Copy link
Member

jakubgs commented Sep 7, 2022

We've been seeing seemingly random failures of iOS status-go builds with error like this:

# runtime/cgo
cgo: C compiler "2022-09-07" not found: exec: "2022-09-07": executable file not found in $PATH

Except the date that cgo thinks is a C compiler is the current date. This issue is known:

Which is caused by xcrun printing weird and unexpected warnings to stdout on first use after reboot:

Last login: Wed Sep  7 09:14:57 2022 from 12.34.56.67
 % xcrun --find clang
2022-09-07 14:50:13.907 xcodebuild[69942:386823822] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-09-07 14:50:13.908 xcodebuild[69942:386823822] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-09-07 14:50:14.041 xcodebuild[69942:386823822] XType: com.apple.fonts is not accessible.
2022-09-07 14:50:14.041 xcodebuild[69942:386823822] XType: XTFontStaticRegistry is enabled.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

 % xcrun --find clang
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

 % xcrun --find clang
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

This issue has been present with Command Line Tools 13.3.1 and 13.4.

@jakubgs jakubgs added the ios label Sep 7, 2022
@jakubgs jakubgs self-assigned this Sep 7, 2022
@jakubgs
Copy link
Member Author

jakubgs commented Sep 7, 2022

I tried the MacOS upgrade, Command Line Tools upgrade and Xcode upgrade:

But the warnings persist. Did it only on maci7-03 for now.

@jakubgs
Copy link
Member Author

jakubgs commented Sep 8, 2022

One possible option is to implement some validation in envClang():

func envClang(sdkName string) (clang, cflags string, err error) {
	if buildN {
		return sdkName + "-clang", "-isysroot " + sdkName, nil
	}
	cmd := exec.Command("xcrun", "--sdk", sdkName, "--find", "clang")
	out, err := cmd.CombinedOutput()
	if err != nil {
		return "", "", fmt.Errorf("xcrun --find: %v\n%s", err, out)
	}
	clang = strings.TrimSpace(string(out))

https://github.com/golang/mobile/blob/8578da9835fd365e78a6e63048c103b27a53a82c/cmd/gomobile/env.go#L434-L443

@jakubgs
Copy link
Member Author

jakubgs commented Sep 8, 2022

I created a PR which sanitizes xcrun output:

But they expect me to sign Google Contributor License Agreement(CLA), so I asked Agata to look into before I accept it.

jakubgs added a commit that referenced this issue Sep 12, 2022
This resolves issues with weird `status-go` build errors like:
```
cgo: C compiler "2022-09-07" not found: exec: "2022-09-07": executable file not found in $PATH
```
Such errors are caused by `xcrun` spewing warnings to `stdout`. The PR
to fix this issue permanently has been created but it might take a while
before it's merged.

Fix PR: golang/mobile#84
Resolves: #13949

Signed-off-by: Jakub Sokołowski <[email protected]>
@jakubgs
Copy link
Member Author

jakubgs commented Sep 12, 2022

Decided to apply the patch using Nix since it's quite simple, and will fix those failure while we wait for the PR to get merged.

jakubgs added a commit that referenced this issue Sep 12, 2022
This resolves issues with weird `status-go` build errors like:
```
cgo: C compiler "2022-09-07" not found: exec: "2022-09-07": executable file not found in $PATH
```
Such errors are caused by `xcrun` spewing warnings to `stdout`. The PR
to fix this issue permanently has been created but it might take a while
before it's merged.

Fix PR: golang/mobile#84
Resolves: #13949

Signed-off-by: Jakub Sokołowski <[email protected]>
ibrkhalil pushed a commit that referenced this issue Sep 12, 2022
This resolves issues with weird `status-go` build errors like:
```
cgo: C compiler "2022-09-07" not found: exec: "2022-09-07": executable file not found in $PATH
```
Such errors are caused by `xcrun` spewing warnings to `stdout`. The PR
to fix this issue permanently has been created but it might take a while
before it's merged.

Fix PR: golang/mobile#84
Resolves: #13949

Signed-off-by: Jakub Sokołowski <[email protected]>
jakubgs added a commit that referenced this issue Sep 22, 2022
This resolves issues with weird `status-go` build errors like:
```
cgo: C compiler "2022-09-07" not found: exec: "2022-09-07": executable file not found in $PATH
```
Such errors are caused by `xcrun` spewing warnings to `stdout`. The PR
to fix this issue permanently has been created but it might take a while
before it's merged.

Fix PR: golang/mobile#84
Resolves: #13949

Signed-off-by: Jakub Sokołowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant