-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSY2/MINGW example workflow #95
Comments
This is the workflow: https://github.com/1138-4EB/ghdl-packaging/blob/master/.github/workflows/mingw.yml and this is the main script: https://github.com/1138-4EB/ghdl-packaging/blob/master/msys2-mingw/run.sh. As you see, I'm not using any
|
Should anyone be considering to propose a PR, please note that action https://github.com/1138-4EB/setup-msys2/tree/master exists. Unlike the example above, the action caches MSYS2, instead of installing it through chocolatey. This reduces startup time from 5min to 30s. Maybe setup-msys2 can be adopted in |
@krcroft, I'm afraid that either you are confused or I am confused, but I don't understand what you mean with @andymckay's approach. AFAIK, I am the only one that proposed multiple approaches in this issue. The only thing @andymckay did was to add a label yesterday. |
I completely agree. I don't understand why do they provide such a limited bash (Git for Windows, I assume), given that MSYS2 and WSL are available. Furthermore, I found the tests to run at least two times slower than AppVeyor; which is nonsense to me, since GitHub is using Azure under the hood, isn't it?
I do not agree here. Commands in setup-msys2 are as clear and easy to find as it could be. It is a 50 line script, with three specially relevant commands only: The fact that it is written in JS doesn't make it more obfuscated than writing in bash or YAML.
The proposed CI workflows, be it with or without setup-msys2, are as transparent and transportable as they can be. This is because in this issue we are only covering how to install a full-featured MSYS2 environment in the windows VMs provided by GitHub. Either the YAML file or the action are specific to this environment, because I do not consider the installation procedure of MSYS2 to be transportable; neither to be worth transporting it if it was. Nevertheless, all the relevant logic is defined in a helper bash script written by the user (see
This is to assume too much. I don't have chocolatey installed on any of my windows workstations. With a standard MSYS2 and Docker I have everything I need. Plus, I wouldn't suggest anyone to copy and paste the following on a cmd on their desktop: export HOME=whatever
export MINGW_INSTALLS=whatever
C:\tools\msys64\usr\bin\bash -lc "./msys2-mingw/run.sh -b"
C:\tools\msys64\usr\bin\bash -lc "source /usr/bin/shell $MINGW_INSTALLS; ./msys2-mingw/run.sh -t" Instead, I'd suggest to open a MINGW64 shell and do: ./msys2-mingw/run.sh -b
./msys2-mingw/run.sh -t
Of course the action is locked to the vendor, but just the same as the YAML file. That's why the action is supposed to be used in the YAML file and nowhere else. By the same token, the YAML is expected to be used in GitHub Actions, and nowhere else.
Note that, as commented above, none of this would be required if Actions supported
I feel that you are overlooking the fact that the
This is mostly because setup-msys2 downloads a tarball and saves it in the cache. Then, it is just extracted with tar: Hence, it is possible to replace the chocolatey command with: curl -fsSL http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz | tar -x -J --force-local -C <DEST_DIR> However, I don't think it is possible to use the cache without EDIT Clarification regarding "Of course the action is locked to the vendor": setup-msys2 can be executed locally by running |
Gotcha, and agree. When I said that obfuscation was the same, I was thinking on steps such as
I think we should focus on making this message be heard loud. You might want to comment in https://github.saobby.my.eu.orgmunity/t5/GitHub-Actions/Windows-MSYS2-Ruby/m-p/33946#M1727
Oh, not at all. I am a regular user trying to migrate existing workflows from Travis CI and AppVeyor to GitHub Actions. I opened a few other issues (https://github.com/actions/starter-workflows/issues?utf8=%E2%9C%93&q=author%3A1138-4EB+, https://github.com/actions/toolkit/issues?utf8=%E2%9C%93&q=author%3A1138-4EB+), but that's all.
Unfortunately, employees are not being as responsive as in other projects. I feel they are overwhelmed. Let's hope GitHub managers can put more resources to bring GitHub Actions to the hype they built.
I found this behaviour too. Some steps consistenly lock for up to 5-10 mins, and all the output is shown after the step or job is finished.
The default terminal on
I will focus on setup-msys2, because it better suits my needs. Nevertheless, should you wish to, I'm ok with replacing the code block in the first commit of this issue with a link/reference to gist of yours. That would allow you to add this and hopefully other variants, along with comments about that workflow syntax. This also because, should I contribute a workflow to this repo, it would probably be based on setup-msys2 since it is more idiomatic in this context. |
Features from 1138-4EB/setup-msys2 are now merged upstream (numworks/setup-msys2). |
|
Good work. |
|
I use a more direct approach at here: https://github.com/randy3k/winpty/blob/b3be9209ae7fc8597a34a256583dc3c01ff08391/.github/workflows/build.yml#L37 It involves downloading msys2 and invoking bash directly. - name: Pacman
run: |
$env:MSYSTEM = "MINGW${{ matrix.arch }}"
$env:MSYS2_PATH_TYPE = "strict"
$script = @'
pacman --noconfirm -S msys/gcc
if [ "$MSYSTEM" = "MINGW32" ]; then
pacman --noconfirm -S mingw32/mingw-w64-i686-gcc
else
pacman --noconfirm -S mingw64/mingw-w64-x86_64-gcc
fi
pacman --noconfirm -S make
'@
& "$env:GITHUB_WORKSPACE\msys${{ matrix.arch }}\usr\bin\bash" -c -l $script |
@randy3k, you might want to use https://github.com/numworks/setup-msys2 instead. |
I tried, but the implementation is kind of weird. I prefer a more direct approach and have more control how the shell is called. |
IMHO, the implementation is exactly the same as yours. The only difference is that setup-msys2 is coded in JavaScript/cmd and you coded in YAML/bash. Should you want finer control, it is up to you to replace script I think that both implementations (setup-msys2 and yours) are weird because of actions/toolkit#232. |
It's fair enough. The only relevant lines are So in total, there are only 10-ish lines needed. One plus thing for my setup is that it also handles i686/x86_64 sys2 and it's more transparent how I could cache the msys2 setup because I have the control of the download position of msys2. Of course, one could argue that it is also possible for |
Random chat |
This issue has become stale and will be closed automatically within a period of time. Sorry about that. |
See msys2/setup-msys2 for an up-to-date and actively maintained solution. |
See msys2/setup-msys2 for an up-to-date and actively maintained solution.
Please, provide an example workflow to build MSYS2/MINGW packages with
makepkg-mingw
. I am currently using the following steps:However, this is not ideal, because:
The text was updated successfully, but these errors were encountered: