Fl4m3Ph03n1x

Fl4m3Ph03n1x

How to set 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.

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:

In my Github Action, that is exactly what I do (I think):

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).

Problem

However my GitHub Actions code comes back with this error:

==> 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.

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?

Marked As Solved

Fl4m3Ph03n1x

Fl4m3Ph03n1x

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:

 (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:

Popular Backend topics Top

Jsdr3398
Are there any databases that require no setup (can be shipped in a small zip together with the project)?
New
mrmurphy
I’ve run into a situation where I’ve got a list of posts inside of a container that uses phx-update=“prepend”, and the posts on the socke...
New
JimmyCarterSon
I am confused about the Schema setup, I am setting up a new application and I want to seed files in it as well. I tried to mix to create...
New
GermaVinsmoke
Does anyone know beginner friendly Elixir/Phoenix Open source projects? For learning purpose :slightly_smiling_face:
New
sona11
In Java, if I try to do.equals() on a null string, a null pointer error is issued. I’m wondering whether I can perform the following if I...
New
sona11
I’m having a difficulty. I want to modify an attribute’s data type from String to Array. { “id”: “trn:tarb:tradingpartner:uuid:00000...
New
Fl4m3Ph03n1x
Background I have to queries that return a colossal amount of data on their own. I cannot use Repo.all as doing so would materialize thes...
New
harwind
I received this error for a binary search programme in C, despite the fact that it requested for inputs and produced the right output. Th...
/c
New
Fl4m3Ph03n1x
Background When trying to execute mix release on a Windows 11 machine for a Phoenix project I get the following error: * assembling mark...
New
harwind
I have a large SQL database with millions of records, and I’ve identified duplicate entries. What’s the most efficient way to find and re...
New

Other popular topics Top

New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New

Latest in Questions

View all threads ❯