如何配置我的`travis.yaml``jobs.include`和`before_install`安装macOS堆栈? [英] How do configure my `travis.yaml` `jobs.include` and `before_install` to install stack for macOS?

查看:68
本文介绍了如何配置我的`travis.yaml``jobs.include`和`before_install`安装macOS堆栈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管我已经执行了中所述的步骤说明

before_install:
# Download and unpack the stack executable
- mkdir -p ~/.local/bin
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'

我的 travis.yaml 这些失败使用

jobs:
  include:
  ...
  - name: "LTS 9.6 (Haskell for macOS)"
    os: osx
    osx_image: xcode10
    env: ...
    ...

使用

tar: Option --wildcards is not supported
Usage:
  List:    tar -tf <archive-filename>
  Extract: tar -xf <archive-filename>
  Create:  tar -cf <archive-filename> [filenames...]
  Help:    tar --help
curl: (23) Failed writing body (0 != 597)
The command "curl -L https://www.stackage.org/stack/linux-x86_64" failed. Retrying, 2 of 3.
curl: (23) Failed writing body (0 != 597)
The command "curl -L https://www.stackage.org/stack/linux-x86_64" failed. Retrying, 3 of 3.
curl: (23) Failed writing body (0 != 597)
The command "curl -L https://www.stackage.org/stack/linux-x86_64" failed 3 times.

如何修改我的 travis.yaml jobs.include before_install 以便为macOS安装堆栈?

How do I modify my travis.yaml jobs.include and before_install to install stack for macOS?

推荐答案

几件事.

  1. 我不会在这里使用 travis_retry ,因为 curl 具有
  1. I wouldn't use travis_retry here, since curl has the --retry flag that works better.
  2. macOS uses BSD tar, not GNU tar. You can either:
  1. 找到可同时在两者上使用的通用标志
  2. 安装 gnu-tar 并使用反而.(如果要以 tar 的身份执行此公式,则不仅需要 brew install gnu-tar ,还请务必正确设置.)
  1. Find a common flag that works on both
  2. Install gnu-tar, and use that instead. (This formula requires more than just brew install gnu-tar, if you want to execute it as tar, so be sure to set it up correctly.)

这篇关于如何配置我的`travis.yaml``jobs.include`和`before_install`安装macOS堆栈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆