【问题标题】:How to set Bakeware env vars on GitHub Actions for a Windows release?如何在 GitHub Actions 上为 Windows 版本设置 Bakeware env vars?
【发布时间】:2022-02-04 17:18:54
【问题描述】:

背景

我正在尝试让 Github Action 与 Windows 和 Bakeware 一起使用,因为我正在尝试使用它创建一个版本。

但是,我遇到了环境变量问题。

代码

在 Bakeware 的设置页面中提到我们必须设置 MAKECC 环境变量:

在我的 Github Action 中,这正是我所做的(我认为):

name: build

env:
  MIX_ENV: test
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build on Windows
    runs-on: windows-2019
    env: 
        CC: gcc
        MAKE: make

    steps:
    - uses: actions/checkout@v2
    - uses: erlef/setup-beam@v1
      with:
        elixir-version: '1.13.x' # Define the elixir version [required]
        otp-version: '24.2.x' # Define the OTP version [required]
    
    - name: Install choco
      shell: powershell
      run: |
        Set-ExecutionPolicy -ExecutionPolicy Bypass
        Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

    - name: Install bakeware dependencies
      shell: powershell
      run: choco install -y zstandard make mingw

    - name: Install Dependencies
      shell: powershell
      run: mix deps.get
 
    - name: Run credo code analyser
      shell: powershell
      run: mix credo --strict

我什至正在使用 powershell 来执行此操作(尽管我不确定是否需要这样做)。

问题

但是我的 GitHub Actions 代码返回此错误:

==> bakeware

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj"

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/launcher"

mkdir "d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress"

mkdir: cannot create directory 'd:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress': No such file or directory

make: *** [Makefile:70: d:/a/market_manager/market_manager/_build/test/lib/bakeware/obj/zstd/lib/decompress] Error 1

could not compile dependency :bakeware, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile bakeware", update it with "mix deps.update bakeware" or clean it with "mix deps.clean bakeware"

** (Mix) Could not compile with "make" (exit status: 2).

它说它不能用make编译。

问题

我已尝试复制/粘贴该部分:

env: 
  CC: gcc
  MAKE: make

对于我能想到的那个文件中的每个部分,但我总是遇到同样的问题。

我做错了什么?

【问题讨论】:

    标签: windows deployment elixir github-actions


    【解决方案1】:

    回答

    在这种情况下,环境变量已正确创建和设置。问题更深,它与库本身无法创建所需的文件夹有关。

    由于库使用的make 工具需要这些文件夹,因此该工具自行崩溃并报告了此类问题,因此让我相信我的环境设置存在问题,因为我收到了错误:

     (Mix) Could not compile with "make" (exit status: 2).
    

    然而,实际上,这个问题是库中的一个错误,这个问题已经在 master 中修复:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-27
      • 1970-01-01
      • 2021-05-09
      • 2020-01-01
      • 1970-01-01
      • 2020-12-22
      • 2020-04-01
      • 1970-01-01
      相关资源
      最近更新 更多