Post not yet marked as solved
Trying to generate dynamic library (framework), in Debug build I can see the local path to my source code inside the framework or Unix Executable File.
This is not the case with Release build. How can I prevent the path getting exposed in the framework file?
I tried perl command to replace the occurrences of the path inside file. But when I do that and try to use framework within my iOS application, I got
ld: malformed universal file: slice extends beyond end of file file '/path/to/my/Sample.framework/Sample'
Framework file got corrupted, is there any proper way from XCode or xcodebuild command to achieve this?
Post not yet marked as solved
I want to generate two frameworks: one for iOS and one for Simulator.
Are there any differences between them?
Hello,
I've been trying for a few days to import a local XCFramework into my Swift code, with no success.
Xcode keeps erroring with: "No such module". I've made a minimal reproducible example on GitHub.
Interestingly, it does work with an Obj-C project with no issue.
Both projects were created with pod lib create.
I've tried adding a random module.modulemap to my XCFramework, no success.
After browsing forums / documentation for a few days, I yield and post here.
Hope someone can help :pray:
Post not yet marked as solved
Hi,
My question is not how to use a dylib but I am wondering whether if they are allowed to use in an app released in AppStore or not.
My company develops c/c++ cross platform libraries to be used in different environments and now we are trying to use dylibs in iOS, so far we can embed them and call the functions from the libraries successfully, how ever when we submit the app including the dylib to the AppStore, the Apptore validation fails because of the dylib,
We tried below ways,
wrapping dylib into framework (dylib is inside the Frameworks folder of framework)
(Result: Framework contains disallowed file 'Frameworks')
wrapping dylib into framework (dylib is in root folder of framework)
(Result: your app can't contain standalone executables or libs other than a valid CFBundleExecutable)
converting dylib into a fake framework
(Result: invalid bundle, framework doesn't support the minimum OS version specified in the info.plist file.)
So, if the dylibs are allowed to use in iOS, we need a documentation about where to put them correctly that will make our app pass the AppStore validation, thanks
Post not yet marked as solved
I'm getting this error trying to compile my framework, which I newly added some Swift code to:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "LibcOverlayShims.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/lib/swift/shims/LibcOverlayShims.h:80:15: error: declaration of 'sem_t' must be imported from module 'Darwin.sys.semaphore' before it is required
static inline sem_t *_stdlib_sem_open2(const char *name, int oflag) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/usr/include/sys/semaphore.h:43:13: note: declaration here is not visible
typedef int sem_t;
^
<unknown>:0: error: could not build Objective-C module 'SwiftOverlayShims'
Post not yet marked as solved
Hello
I have a very simple feature that tries to remove the background from a web camera video stream using VNGeneratePersonSegmentationRequest and VNImageRequestHandler.
let personSegmentationRequest = VNGeneratePersonSegmentationRequest()
personSegmentationRequest.qualityLevel = .balanced
let imageRequestHandler = VNImageRequestHandler(ciImage: ciImage) // a frame from the camera
try? imageRequestHandler.perform([personSegmentationRequest])
guard let result = personSegmentationRequest.results?.first else {
return nil
}
On Mac computers with M1 processors works great (60 fps without any issue).
The same code/app on MacBook Pro Intel i7 2.7GHz and AMD Radeon the performance is only 10 fps, much lower.
Any thoughts?
Thank you
Post not yet marked as solved
I am trying to add a framework to my project but I am facing 'Could not find module 'StandardCheckoutKit' for target 'arm64-apple-ios'; found: x86_64-apple-ios-simulator' Error
This framework works perfectly in Simulator but didn't work on real devices (iPhone XS Max)
Added framework using drag and drop (downloaded from the browser)
I am not installing the framework via pods (not available)
Post not yet marked as solved
We are creating a framework to distribute to other application, our framework contains multiple third party library with pods. We are able to successfully generate the framework.
But we are getting error when that framework is used and generating Ad hoc build.
Below is the pod file for the framework project
pod 'Alamofire', '> 4.9.0'
pod 'RealmSwift', '> 3.19.0'
pod 'ObjectMapper', '> 3.5.1'
pod 'ObjectMapper+Realm', '> 0.6'
pod 'ZIPFoundation', '> 0.9.9' #(0.9.9)
pod 'NMSSH', '> 2.3.1'
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['ObjectMapper','ObjectMapper+Realm','Alamofire'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
target.build_configurations.each do |config|
# set valid architecture
# config.build_settings['VALID_ARCHS'] = 'arm64 armv7 armv7s i386 x86_64'
# build active architecture only (Debug build all)
# config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings['ENABLE_BITCODE'] = 'YES'
if config.name == 'Release' || config.name == 'Pro'
config.build_settings['BITCODE_GENERATION_MODE'] = 'bitcode'
else # Debug
config.build_settings['BITCODE_GENERATION_MODE'] = 'marker'
end
cflags = config.build_settings['OTHER_CFLAGS'] || ['$(inherited)']
if config.name == 'Release' || config.name == 'Pro'
cflags << '-fembed-bitcode'
else # Debug
cflags << '-fembed-bitcode-marker'
end
config.build_settings['OTHER_CFLAGS'] = cflags
end
end
end
Post not yet marked as solved
We’ve been attempting to reliably update contacts in iCloud and Gmail containers. Having tried several approaches (bulk writes, batched writes, one-by-one writes with sleeps in between, etc.), we’ve found flakiness in all approaches that is never exposed to the app.
Diving a little deeper, we’ve found that this appears to be due to internal server-client failures between iOS and the relevant CardDAV servers.
From our analysis, we seem to be seeing 2 key types of failure:
When the client-server interaction is interrupted, contact update requests appear to be discarded and not resumed for whichever container was currently in progress.
After a variable period of time, the server wipes the newer client state and reverts to an older, stale state.
We’re trying to understand if there is something we are doing wrong with our writes or if this is an iOS level bug.
This is easily reproducible for any device connected to an iCloud or Gmail account with circa. 100+ contacts:
for each container
for each contact in container
create CNSaveRequest
update any field in contact and add to save request
execute save request
Post not yet marked as solved
Hello,
I'm trying to port my framework CI to xCode Cloud and i have to create the release build that contains iOS ios-arm64 and ios-arm64_x86_64-simulator architectures for being able to build the XCFramework on iOS devices and Simulators.
I looked in the Archive Action in the Xcode Cloud options but the Platform selector has iOS but not not Simulator.
Currently i achieved the results that i needed by adding a ci_scripts/ ci_pre_xcodebuild and working with old fashion xcodebuild archive command and works fine .
Can i achieve what i want without the sh script by using predefined actions from Xcode Cloud ?
Thanks,
Florin
Post not yet marked as solved
We imported pure Swift XCFramework into Swift application. On setting the breaking point and trying the po command the following error is seen
error: virtual filesystem overlay file '/Users/rakshitha/Library/Developer/Xcode/DerivedData/ABC-agkiherlqdmvaeakrqtfvsowceuq/Build/Intermediates.noindex/ArchiveIntermediates/ABCDE/IntermediateBuildFilesPath/ABC.build/Release-iphonesimulator/ABCDE.build/all-product-headers.yaml' not found
error: virtual filesystem overlay file '/Users/rakshitha/Library/Developer/Xcode/DerivedData/ABC-agkiherlqdmvaeakrqtfvsowceuq/Build/Intermediates.noindex/ArchiveIntermediates/ABCDE/IntermediateBuildFilesPath/MoEngage.build/Release-iphonesimulator/ABCDE.build/all-product-headers.yaml' not found
error: couldn't IRGen expression. Please check the above error messages for possible root causes.
Solutions Tried:
XCFramework was created with dsym and BCSymbolMaps
XCFramework created without dsym and BCSymbolMaps
Set the Other Swift Flags to -Xfrontend -no-serialize-debugging-options
None of the above solutions worked
Note:
The XCFramework was generated in Xcode 13.4.
The Swift version for generated XCFramework is Swift 5.
XCFramework contains support for iOS and tvOS.
The Sample application was tested in the same Xcode and swift version.
Below is the script used to generate XCFramework
XCFramework.sh
Post not yet marked as solved
We have a binary framework built with Xcode 13.0 with module stability (BUILD_LIBRARY_FOR_DISTRIBUTION) enabled.
As such, the framework can be used on all versions of Xcode 13.x.
When using the same binary framework in Xcode 14.0 beta (14A5228q), we get the following error and the app doesn't compile:
Failed to build module 'OurFramework'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)', while this compiler is 'Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2)'). Please select a toolchain which matches the SDK.
Is there a change to how module stability works in Xcode 14, or is this a temporary limitation (or bug) in Xcode 14.0 beta that will be addressed in future updates?
Post not yet marked as solved
Xcode 13.2.1 build is working fine on the device and simulator both but installing from TestFlight crashing on every launch. Please help out.
Here is the crash logs:
TestFlight app on start crash logs
Post not yet marked as solved
I am trying to use UICollectionViewCompositionalLayout and would like to add a sticky global header to the whole collection view.
As far as I understand the documentation, this can be done via the UICollectionViewCompositionalLayoutConfiguration by adding a boundarySupplementaryItem and by setting pinToVisibleBounds to true.
I tried this and used the following layout:
let layout = UICollectionViewCompositionalLayout.list(
using: .init(appearance: .plain)
)
let supplementary = NSCollectionLayoutBoundarySupplementaryItem(
layoutSize: .init(
widthDimension: .fractionalWidth(1),
heightDimension: .absolute(50)
),
elementKind: UICollectionView.elementKindSectionHeader,
alignment: .top
)
let configuration = UICollectionViewCompositionalLayoutConfiguration()
supplementary.pinToVisibleBounds = true
configuration.boundarySupplementaryItems = [supplementary]
layout.configuration = configuration
This works just fine, but if there are no items in the collection view and I scroll the content (and especially the global header) out of the viewport, I encounter a weird crash which I am not sure how to fix or if I can fix it.
The crash is:
2022-06-13 14:20:57.001033+0200 CompositonalLayoutGlobalHeaderCrash[79529:2256455] *** Assertion failure in CGRect _UIPinnedFrameForFrameWithContainerFrameVisibleFrame(CGRect, CGRect, CGRect, NSRectAlignment)(), _UICollectionLayoutHelpers.m:733
2022-06-13 14:20:57.012169+0200 CompositonalLayoutGlobalHeaderCrash[79529:2256455] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Frame {{0, 50}, {375, 0}} does not intersect {{0, 50}, {375, 0}}'
For me it seems like there is a assertion in the layout which checks that the global header does not leave the frame of the collection views content.
Is this a bug of UICompositionalLayout or is there someone who can help fixing this?
Post not yet marked as solved
I have an iOS project that was created a couple Xcode versions ago bundling some XCFrameworks.
As of recently (still with Xcode 13.4.1 (13F100)) the app won't launch anymore on actual devices with the dreaded Unable to install "XYZ" error.
I have several other projects using one or other of the XCFrameworks, all using the same team and code signing options, and in any of the other apps still work fine on my test device.
I've compared settings between the apps that launch and the one that doesn't but I can't spot any difference that could cause an issue..
Is there any way to track down the specific problem with this app?
This is the detailed output when launching on device fails:
Unable to install "XYZ"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
DVTErrorCreationDateKey = "2022-06-10 12:22:19 +0000";
IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}
--
The code signature version is no longer supported.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620375
User Info: {
DVTRadarComponentKey = 261622;
MobileDeviceErrorCode = "(0xE8008029)";
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x000000011e5a1614 DTDKCreateNSErrorFromAMDErrorCode + 272
1 DTDeviceKitBase 0x000000011e5dadd8 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 160
2 DVTFoundation 0x0000000103c39bd0 DVTInvokeWithStrongOwnership + 76
3 DTDeviceKitBase 0x000000011e5dab30 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1336
4 IDEiOSSupportCore 0x000000011e4b9590 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.301 + 2916
5 DVTFoundation 0x0000000103d60f50 __DVT_CALLING_CLIENT_BLOCK__ + 16
6 DVTFoundation 0x0000000103d62068 __DVTDispatchAsync_block_invoke + 364
7 libdispatch.dylib 0x00000001891d65f0 _dispatch_call_block_and_release + 32
8 libdispatch.dylib 0x00000001891d81b4 _dispatch_client_callout + 20
9 libdispatch.dylib 0x00000001891df8a8 _dispatch_lane_serial_drain + 668
10 libdispatch.dylib 0x00000001891e0404 _dispatch_lane_invoke + 392
11 libdispatch.dylib 0x00000001891eac98 _dispatch_workloop_worker_thread + 648
12 libsystem_pthread.dylib 0x0000000189398360 _pthread_wqthread + 288
13 libsystem_pthread.dylib 0x0000000189397080 start_wqthread + 8
);
}
Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPad12,1";
"device_osBuild" = "15.5 (19F77)";
"device_platform" = "com.apple.platform.iphoneos";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 1993;
"operation_errorCode" = "-402620375";
"operation_errorDomain" = "com.apple.dt.MobileDeviceErrorDomain";
"operation_errorWorker" = IDEInstalliPhoneLauncher;
"operation_name" = IDEiPhoneRunOperationWorkerGroup;
"param_consoleMode" = 0;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 5;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphoneos";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 0;
"param_launcher_substyle" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_runnable_swiftVersion" = "5.6.1";
"param_runnable_type" = 2;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphoneos15.5";
"sdk_osVersion" = "15.5";
"sdk_variant" = iphoneos;
}
--
System Information
macOS Version 12.4 (Build 21F79)
Xcode 13.4.1 (20504) (Build 13F100)
And this is the output of codesign on the app:
Executable=/Users/***/Library/Developer/Xcode/DerivedData/XYZ-bdjavnfzlagnjzdlfbdbfimpdxdp/Build/Products/Debug-iphoneos/XYZ.app/XYZ
Identifier=com.***
Format=app bundle with Mach-O thin (arm64)
CodeDirectory v=20400 size=163181 flags=0x0(none) hashes=5088+7 location=embedded
Signature size=4787
Signed Time=10. Jun 2022 at 14:17:36
Info.plist entries=36
TeamIdentifier=L***T
Sealed Resources version=2 rules=10 files=76
Internal requirements count=1 size=208
The page size indicates the app has DER entitlements (as per https://developer.apple.com/documentation/xcode/using-the-latest-code-signature-format):
Page size=4096
-7=a2b7cb9fa9a8e60cacfd73d1830ea5bbab35c8213e0abd86c14233ac1aaf9b90
-6=0000000000000000000000000000000000000000000000000000000000000000
-5=8680ba1b7e8bf98de928906c8d4e1a88e836b7d1aa33a40ee0e079513fc9ee04
-4=0000000000000000000000000000000000000000000000000000000000000000
-3=1a6c79ee253b6b0720c630f094054b9dbf8e4adbcf4d169b3f8b291bb5c377c5
-2=b6a4ad6c366acfe77bc7cb3aeeec40016d45baf36431d07e130d429bebffd891
Any hints appreciated.
Cheers,
Jay
Post not yet marked as solved
Hi,
when i used IOServiceOpen(service,mach_task_t,0, &connect) to creat a connection to an IOService, a return code 0xe00002c2 is generated in macos Montery(12.4). but the same program returned Success in macos 11.x. did anyone encounted these issue?
Post not yet marked as solved
Hey there, many thanks for your time!
Goal:
Using lib_InternalSyntaxParser.dylib in an app-store compatible build for iOS.
Some quick context:
swift-syntax Library repo - https://github.com/apple/swift-syntax
My reference project - https://github.com/tikimcfee/LookAtThat
Updated / standard instructions on manually building dylib - https://github.com/pol-piella/polpiella.dev/blob/4a7b5f6e6b3511d5010da887435f870f84c53d2a/src/pages/embedding-a-dylib-in-a-swift-package.md
Issues:
x86_64, arm64, iossim all require different architecture builds of lib_InternalSyntaxParser.
I cannot embed the dylib generated by the build tool into a app-store capable build (not supported by iOS). macOS dylib with an exported .app is fine so far.
Attempting to wrap this with a framework causes signing errors after installation on device.
Question:
I am looking for guidance on the proper, expected practice for bundling the multiple versions of this dylib (listed above). I was fortunate enough to meet one @Rintaro (hello and thank you again!) at this year's WWDC developer event, and they suggested I pop up my issue here. I am happy to answer questions to help narrow down a solution!
I would greatly appreciate an as-detailed-as-is-reasonable explanation of what the expected process of embedding this dylib looks like, and what the specific requirements are for code signature and verification for this use case.
A third and final time: many thanks for your time, patience, and assistance.
Post not yet marked as solved
I'm trying to build an augmented reality app on my iphone. I made it in unity, and it builds and plays on an android, but crashes immediately on any iphone. I get this in my console in xcode.
2022-06-05 19:23:13.222039-0500 PieceoftheSkyWIP[12433:706015] Error loading /var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/UnityFramework: dlopen(/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/AlgoSdk.framework/AlgoSdk
Referenced from: /private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/UnityFramework
Reason: tried: ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/System/Library/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file)
2022-06-05 19:23:13.222996-0500 PieceoftheSkyWIP[12433:706015] Error loading /var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/UnityFramework: dlopen(/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/AlgoSdk.framework/AlgoSdk
Referenced from: /private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/UnityFramework
Reason: tried: ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/UnityFramework.framework/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/private/var/containers/Bundle/Application/4E214C36-6812-4936-951A-153FB4DA4454/PieceoftheSkyWIP.app/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file), ‘/System/Library/Frameworks/AlgoSdk.framework/AlgoSdk’ (no such file)
my coworker also tried to build the project on his mac M1 and got an actual error that says something like this -
building for ios but the linked and embedded framework was built for ios + ios simulator unity
I'm using Unity 2019.4.0
ARFoundation 4.1.1
ARCore 4.1.1
ARKit 4.1.1
Xcode 13.4.1
Post not yet marked as solved
The Rust programming language is currently trying to replace its synchronization primitives with more efficient, statically initializable ones (see tracking issue). This turned out to be difficult on macOS, as it does neither have these primitives by default like Windows (SRWLock is really efficient and works with condition variables) or have a ready-to-use futex operation like Linux, FreeBSD, etc. A suitable alternative would be to use a parking lot like WebKit did, but that would make it impossible to implement priority-inheriting mutexes, which are somewhat important on an interactive system like macOS with its QoS feature.
It turns out however, that macOS actually has a futex-like syscall called ulock_wait/ulock_wake. This syscall, while exposed through libSystem, is unfortunately private and its use has resulted in Apps being rejected from the App Store, which is unacceptable for a standard library like std. Since it is implemented since macOS 10.12, retroactively stabilizing the API would make it possible for all Apps, including WebKit, to use custom, more efficient (pthread_mutex_t needs a heap-allocation of 64 bytes) synchronization primitives.
Another option would be to use os_unfair_lock for the mutex implementation and use userspace alternatives for CondVar and RwLock. However, the documentation of os_unfair_lock does not guarantee that the lock is movable while not locked, even though it works in practice. Could that guarantee be added to its API?
Do you see any other alternatives? Lazily allocating the pthread_mutex_t is the strategy currently chosen, but that does not mitigate certain unsoundness problems, which is something Rust likes to avoid.