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

时间:2018-09-03 03:11:51

标签: selenium-chromedriver homebrew homebrew-cask

我正在通过chromedriver下载brew cask install(请参阅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规格如下:enter image description here

以前有人遇到过这个问题吗?任何帮助,将不胜感激。我试图建立一个无头的chrome驱动程序,但失败了。

UPDATE_EDIT:此后,我从Chrome转移到了无头的Firefox上,但运气还不错,但这仍然不能解决上述问题。

2 个答案:

答案 0 :(得分:4)

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

尝试以下。

$ brew cask install --no-quarantine chromedriver

答案 1 :(得分:3)

这是由于Homebrew中的当前错误,并且已合并了一个修补程序

每期#4809

  

嗨,PR#4656似乎破坏了10.11上的酿造桶安装。我在10.11上收到错误,但在10.12上却没有。解决方法是,成功使用--no-quarantine标志重新运行。我不确定为什么无法使用此快速功能,我的操作系统是最新的。

     

(剪裁)

/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
     

(等)

(剪断等)

这是您面临的同样问题。

有一个PR(#4796)可以解决此问题,它已在一天前(2018-09-06)合并到master中:

  

我编写的Gatekeeper API依赖于最新的CLT(或Xcode)安装,以及xattr的-r标志用于本机递归。在某些情况下,Swift太旧或被设置为早于MacOS 10.10的部署目标,因此无法使用URLResourceKey.quarantinePropertiesKey常量。并且在当前的Mojave Beta中,xattr没有苹果的-r扩展名,可以进行本机文件系统遍历。

     

此拉取请求在Swift脚本Quarantine.available?中插入了附加检查。功能和酿造桶医生,并传播更改以使用xargs进行递归。

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

相关问题