URLResourceKey.quarantinePropertiesKey 仅在 OS X 10.10 或更高版本上可用(安装 chromedriver 时)

URLResourceKey.quarantinePropertiesKey is only available on OS X 10.10 or newer when installing chromedriver

我正在通过 brew cask install 下载 chromedriver(参见 related issue ),当我尝试下载它时出现以下错误(粘贴命令条目的完整输出):

(env) MacBook:project_dir owner$ brew cask install chromedriver
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
dnstwist            grpc                pdns                uftp
firebase-cli        lf                  pdnsrec             wildfly-as
glslviewer          libxlsxwriter       tile38              zabbix

==> Satisfying dependencies
==> Downloading https://chromedriver.storage.googleapis.com/2.41/chromedriver_ma
######################################################################## 100.0%
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: note: add 'if #available' version check
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^
Error: Failed to quarantine /Users/user/Library/Caches/Homebrew/downloads/42621d77ecaa889fa8ca73ac4b2a2228e3c1d11f20d84c6898e7645397d00f1d--chromedriver_mac64.zip. Here's the reason:
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey
                             ^
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: note: add 'if #available' version check
      forKey: URLResourceKey.quarantinePropertiesKey

我目前的 macbook 规格如下:

有没有人运行以前处理过这个问题?任何帮助,将不胜感激。我正在尝试设置无头 chrome 驱动程序但失败了。

UPDATE_EDIT:我已经从 Chrome 转而使用 Firefox headless 时运气更好,但这仍然无法解决上述问题。

https://github.com/Homebrew/homebrew-cask/issues/51554#issuecomment-418215466

试试下面。

$ brew cask install --no-quarantine chromedriver

这是由于 Homebrew 中的当前错误,并且已合并修复

每期 #4809

Hi, PR #4656 appears to break brew cask install on 10.11. I get an error on 10.11, but not on 10.12. As a workaround, re-running with the --no-quarantine flag is successful. I'm not sure why this swift feature isn't available, my OS is up to date.

(snip)

/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/utils/quarantine.swift:29:30: error: 'quarantinePropertiesKey' is only available on OS X 10.10 or newer
      forKey: URLResourceKey.quarantinePropertiesKey

(etc)

(截图等我的)

这与您面临的问题相同。

有一个 PR (#4796) 解决了这个问题,它已于一天前 (2018-09-06) 合并到 master 中:

The Gatekeeper API I've written relies on an up-to-date CLT (or Xcode) install, and xattr's -r flag for native recursion. There are cases where Swift is too old or is set to a deployment target earlier than MacOS 10.10, and thus cannot use the URLResourceKey.quarantinePropertiesKey constant. And in the current Mojave beta, xattr does not have Apple's -r extension for doing native filesystem traversal.

This pull request inserts an additional check in the Swift script, the Quarantine.available? function and brew cask doctor, and changes propagate to use xargs for recursion.

我只是 运行 一个 brew update 它告诉我我是 运行 1.7.3 运行 在提交 5d894 时提交的今天 (2018-09-07),是撰写本文时 homebrew-core 的最新版本。