通过 Scoop 在 AppVeyor CI 上安装某些工具时出现构建错误
Build error when installing certain tools on AppVeyor CI via Scoop
我创建了以下 appveyor.yml
file:
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- ps: scoop install ruby
旨在安装 Ruby,但 build fails 具有:
scoop install ruby
Installing 'ruby' (2.5.1-2) [64bit]
Downloading https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-2.5.1-2-x64.7z (8.8 MB)...
Checking hash of rubyinstaller-2.5.1-2-x64.7z... ok.
Extracting... done.
Linking ~\scoop\apps\ruby\current => ~\scoop\apps\ruby.5.1-2
Persisting gems
Running post-install script...
Successfully installed rake-12.3.1
Parsing documentation for rake-12.3.1
Installing ri documentation for rake-12.3.1
Done installing documentation for rake after 0 seconds
1 gem installed
'ruby' (2.5.1-2) was installed successfully!
Notes
-----
Install MSYS2 via 'scoop install msys2' and then run 'ridk install' to install the toolchain!
'ruby' suggests installing 'msys2'.
The build phase is set to "MSBuild" mode (default), but no Visual Studio project or solution files were found in the root directory. If you are not building Visual Studio project switch build mode to "Script" and provide your custom build command.
同样的问题发生在 shellcheck
,例如
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- ps: scoop install shellcheck
test_script:
- shellcheck -V
请注意,我可以轻松安装其他工具,例如:
scoop install curl grep sed less touch python perl
没有任何问题(参见此 build),但在 Ruby 和 ShellCheck 上失败。
我错过了什么?
您描述的错误 (The build phase is set to "MSBuild" mode (default)...
) 与 Scoop 或 install
阶段发生的任何事情无关。默认情况下,AppVeyor 会尝试检测 Visual Studio 解决方案或项目。要禁用该行为,您可以设置 build: off
或将 test_script:
重命名为 build_script:
.
这是工作 appveyor.yml
:
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- ps: scoop install ruby shellcheck
build: off
test_script:
- shellcheck -V
我创建了以下 appveyor.yml
file:
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- ps: scoop install ruby
旨在安装 Ruby,但 build fails 具有:
scoop install ruby
Installing 'ruby' (2.5.1-2) [64bit]
Downloading https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-2.5.1-2-x64.7z (8.8 MB)...
Checking hash of rubyinstaller-2.5.1-2-x64.7z... ok.
Extracting... done.
Linking ~\scoop\apps\ruby\current => ~\scoop\apps\ruby.5.1-2
Persisting gems
Running post-install script...
Successfully installed rake-12.3.1
Parsing documentation for rake-12.3.1
Installing ri documentation for rake-12.3.1
Done installing documentation for rake after 0 seconds
1 gem installed
'ruby' (2.5.1-2) was installed successfully!
Notes
-----
Install MSYS2 via 'scoop install msys2' and then run 'ridk install' to install the toolchain!
'ruby' suggests installing 'msys2'.
The build phase is set to "MSBuild" mode (default), but no Visual Studio project or solution files were found in the root directory. If you are not building Visual Studio project switch build mode to "Script" and provide your custom build command.
同样的问题发生在 shellcheck
,例如
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- ps: scoop install shellcheck
test_script:
- shellcheck -V
请注意,我可以轻松安装其他工具,例如:
scoop install curl grep sed less touch python perl
没有任何问题(参见此 build),但在 Ruby 和 ShellCheck 上失败。
我错过了什么?
您描述的错误 (The build phase is set to "MSBuild" mode (default)...
) 与 Scoop 或 install
阶段发生的任何事情无关。默认情况下,AppVeyor 会尝试检测 Visual Studio 解决方案或项目。要禁用该行为,您可以设置 build: off
或将 test_script:
重命名为 build_script:
.
这是工作 appveyor.yml
:
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- ps: scoop install ruby shellcheck
build: off
test_script:
- shellcheck -V