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

"Cannot find 'OSAllocatedUnfairLock' in scope" when archiving #173

Closed
jordibruin opened this issue Apr 30, 2024 · 3 comments
Closed

"Cannot find 'OSAllocatedUnfairLock' in scope" when archiving #173

jordibruin opened this issue Apr 30, 2024 · 3 comments

Comments

@jordibruin
Copy link
Contributor

Getting this error in the last week when trying to archive macOS, iOS or visionOS builds. This is on the latest version of main.

@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, visionOS 1.0, *)
final class AllocatedUnfairLock: Lock {
private let _lock = OSAllocatedUnfairLock()

	override init() {
		super.init()
	}

	override func lock() {
		_lock.lock()
	}

	override func unlock() {
		_lock.unlock()
	}
}
@jordibruin
Copy link
Contributor Author

Manually adding

import os

to the top of the utilities file fixes this.

@jordibruin
Copy link
Contributor Author

Made a PR, but I think there must be something we're missing because I would assume you run into this as well.

#174

@sindresorhus
Copy link
Owner

https://github.com/sindresorhus/Defaults/releases/tag/v9.0.0-beta.2

In debug, we import import OSLog, which implicitly imports os. This does not happen in production, hence the error. Implicit imports are the worst...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants