简体   繁体   English

如何在 Windows 版本的 GitHub 操作上设置 Bakeware env vars?

[英]How to set Bakeware env vars on GitHub Actions for a Windows release?

Background背景

I am trying to get a Github Action working with Windows and Bakeware because I am trying to create a release using it.我正在尝试获得与 Windows 和Bakeware一起使用的 Github 操作,因为我正在尝试使用它创建一个版本。

However, I am having issues with the environment variables.但是,我遇到了环境变量的问题。

Code代码

In Bakeware's setup page it is mentioned that we have to set the MAKE and CC environment variables:在 Bakeware 的设置页面中提到我们必须设置MAKECC环境变量:

In my Github Action, that is exactly what I do (I think):在我的 Github 操作中,这正是我所做的(我认为):

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

I am even using powershell to do it (even though I am not really sure if this is needed).我什至正在使用 powershell 来做到这一点(即使我不确定是否需要这样做)。

Problem问题

However my GitHub Actions code comes back with this error:但是我的 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).

It says it cannot compile with make .它说它不能用make编译。

Question问题

I have tried copy/pasting the section:我尝试复制/粘贴该部分:

env: 
  CC: gcc
  MAKE: make

To every section in that file I could think of, but I always end up with the same issue.对于我能想到的该文件中的每个部分,但我总是遇到同样的问题。

What am I doing wrong?我究竟做错了什么?

Answer回答

The environment vars, in this case, were being correctly created and set.在这种情况下,环境变量已正确创建和设置。 The problem was more deep, it was related to the library itself not being able to create needed folders.问题更深,它与库本身无法创建所需的文件夹有关。

Because the make tool used by the library needed these folders, the tool crashed itself and reported as such, thus making me believe there was an issue with my environmental setup since I was getting the error:因为库使用的make工具需要这些文件夹,所以该工具会自行崩溃并报告,因此让我相信我的环境设置存在问题,因为我收到了错误:

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

In reality however, this issue was a bug in the library, an issue that is already fixed in master:然而实际上,这个问题是库中的一个错误,这个问题已经在 master 中修复:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Windows 上的 Python 中获取和设置环境变量 - Get and Set env vars in Python on Windows 如何在 Windows 最新 VM 中为 Xamarin 应用程序设置 Github 操作? - How to set-up Github Actions for Xamarin apps in windows-latest VM? 使用 github 操作在 Windows 上测试 Perl - Testing Perl on Windows with github actions 如何在 Windows 中使用 shell 脚本永久设置环境变量 - How to set environment vars permanently with a shell script in Windows Python 使用 Github 测试 Windows 上的操作 - Python testing with Github Actions on Windows 如何在 Github 操作上执行 MSI 文件(Windows 最新运行程序) - How to execute MSI file on Github Actions (windows-latest runner) Windows 10 - python pip 不工作(添加了环境变量) - Windows 10 - python pip not working (with env vars added) 通过azure-pipelines.yml +脚本设置Windows环境变量 - Setting Windows env vars via azure-pipelines.yml + script 通过 powershell 将环境变量设置为依赖于 windows 上的其他环境变量 - Setting environment variables as dependent on other env vars on windows via powershell 如何将命令输出设置为env。 在Windows的CMD变量? - How to set command output as env. variable in windows cmd?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM