-
Notifications
You must be signed in to change notification settings - Fork 274
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
[Bug] tcpreplay 4.3.4 build failure on Apple M1 #668
Comments
I have no issues on M1.
|
The issue appears to happen due to problem in SDK detection logic when XCode Command Line Tools are used. For example, on M1 macOS Big Sur 11.4, I currently have: ❯ ls /Library/Developer/CommandLineTools/SDKs/
MacOSX.sdk MacOSX10.15.sdk MacOSX11.3.sdk MacOSX11.sdk The problem is that SDK is looked up from oldest to newest version: Lines 80 to 81 in 1affd0f
This means 10.15 is picked on ARM Big Sur, which isn't correct. I am currently using a workaround to just remove all 10.x from SDK lookup in Homebrew formula Homebrew/homebrew-core#81056 |
Thanks for working through that. Yes, we need to detect SDK 11 for that. Question. Are you using Xcode 12.4? Marking as a bug and targeting for version 4.4. |
XCode 12.5.1. In Homebrew, we would usually depend on the CLT SDKs.
❯ sudo xcode-select -s /Library/Developer/CommandLineTools
❯ xcrun --sdk macosx10.15 --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
❯ xcrun --sdk macosx11.3 --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
❯ xcrun --sdk macosx11 --show-sdk-path
xcrun: error: SDK "macosx11" cannot be located
xcrun: error: SDK "macosx11" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'macosx11' There is a command to get the version, but I don't know how consistent it is. ❯ xcrun --show-sdk-version
11.3
❯ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
❯ xcrun --show-sdk-version
11.3 |
I see. We don't use CLT. Maybe that has something to do with why we don't see any build issues on M1. We keep several versions on Xcode on our machines and let the directory names help us sort things out. We use
Custom libraries are stored in and selected with We set |
Whether issue occurs should be related to CLT vs XCode. I am also able to see no issue if I build source directly and leave default XCode (though it may misbehave if you install another SDK within XCode? Not familiar with this). However, in Homebrew, we want to avoid dependency on full XCode whenever possible. At least for Homebrew formula, one possible method to fix would be to allow user to directly specify the path. We do this for a couple formulae since we have this value available inside the framework, i.e. For example, allowing user to specify path and skipping detection logic if set. Either with
However, this would not help someone who compiles code with CLT and auto-detection logic (maybe like #676). In this case, I think there needs to be a better lookup solution. Another workaround I tried, which may be possible to use for detection, is
I think other projects will have ways to solve this issue too. |
The decision as to whether to use Xcode vs. CommandLine Tools on build machines comes down to whether you need multi-platform builds. If you are only building for macOS, CLT is fine. I plan to rework For example for CLT you may see these SDK's.
In this case the ... and if Xcode is selected you may see:
In this example there is only one SDK available, but in other installations you may see more version avaialble. At this point it should be noted that we install custom libraries in the SDK's directory tree, allowing us to quickly change build environments with simple call to
Back to These options would give lots of flexibility. If no |
* rename --macosx-sdk to --macos-sdk * fix --macos-sdk * if not specified, select latest SDK
Make it easier to get access to the newest SDK
fixed in PR #694 |
You are opening a bug report against the Tcpreplay project: we use
GitHub Issues for tracking bug reports and feature requests.
If you have a question about how to use Tcpreplay, you are at the wrong
site. You can ask a question on the tcpreplay-users mailing list
or on Stack Overflow with [tcpreplay] tag.
General help is available here.
If you have a build issue, consider downloading the latest release
Otherwise, to report a bug, please fill out the reproduction steps
(below) and delete these introductory paragraphs. Thanks!
Describe the bug
tcpreplay 4.3.4 failed to build on Apple M1
To Reproduce
Try to build on Apple M1
Expected behavior
Build success
Screenshots
full build log, https://github.com/Homebrew/homebrew-core/runs/2812291345
System (please complete the following information):
Additional context
relates to Homebrew/homebrew-core#77274
The text was updated successfully, but these errors were encountered: