-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Add MSYS2 to Windows #30
Comments
Ref actions/starter-workflows#95 (/cc @krcroft @andymckay) Ref numworks/setup-msys2 1138-4EB/setup-msys2 (/cc @Ecco) |
I suggest to download and extract the available MSYS2 tarball, instead of using chocolatey. This is because chocolatey requires ~5min but the tarball is extracted in 30s. Please, see |
@eine that time difference is probably because one is updating the base tarball binaries and the other is not. |
@rgl, although it might be the case, I don't think it is the only reason. Precisely, an option is available in setup-msys2 which allows to not only extract the tarball, but also execute Nevertheless, I think that installation time is not revelant in this specific request. Chocolatey package |
The base MSYS2 install is mostly just command line tools, which are very similar to the tools provided with Git for Windows. I think most users are looking for the main install along with the groups 'base' and 'base-devel', and probably mingw-w64-x86_64-gcc and mingw-w64-x86_64-cmake. Since the tarballs are not updated frequently, Beyond that, packages like OpenSSL, libyaml, etc, but they can installed in the workflows... |
There's no reason to presume that. We are using MSYS2 to test Windows compilation of our project using GCC and Clang (in parallel to MSVC) and depend on following packages: |
Many of the packages you mentioned are part of base-devel. CLang/LLVM could be added. We can't and shouldn't expect Actions to have every package. What I'm proposing is what I mentioned and any addition compiler toolsets (as you've mentioned CLang). |
|
That is the default on a lot of systems
Since this for windows, I would assume powershell |
I created an See the output in the 'Install MSYS2' step in https://github.com/MSP-Greg/msys2-action/runs/396221571. It took 6 minutes. The bottom of the output contains lists of MSYS2 & MinGW64 packages. The script only installs both 32-bit and 64-bit tools. Note that if this is added to Windows images, the toolcache Ruby installs will no longer require embedded MSYS2 installs, which reduces their size considerably, and also allows install from a signed As to whether to install any other packages, that's another issue. |
I would suggest adding clang; it can coexist with mingw. |
How do you install from pacman? As below? It installs llvm as a dependent package...
Running |
In dosbox-staging we use |
I updated the file mentioned above and the link to a workflow run. It now installs both 32 & 64 bit tools. |
Do you have any suggestions for what packages should be installed in the MSYS2 install? The script I provided installs base-devel and compression groups on MSYS2, and clang, cmake, gcc, and ragel on mingw64 / mingw32. There's a lot of packages, Appveyor currently has these installed. Any suggestions for the most popular packages that could be included to the above? |
@MSP-Greg Why install any package by default anyway? Just do the base install and let developers install whatever package they want. Otherwise you'll uselessly slow things down for a lot of people… |
Sorry you disagree. It depends on your reference. My reference is CI that also runs on Ubuntu & macOS, where the equivalent of MSYS2, compiler tools, and many packages are already installed. Between GitHub issues and GitHub Community, there seem ot be many people asking for MSYS2, and many people trying to do their own install and unhappy with time it takes.
I suspect having the packages installed on the 'virtual-environment' image is much faster than downloading them and installing. Again, I'm not suggesting adding a lot of packages, just what would be commonly used. What have you used MSYS2 for? |
@Ecco By not providing any default installs, the amount of time spend per person needing to install the whole entire gcc toolchain and clang+llvm etc would be huge and cost extra time for each VM needing to be on. Plus the trade off of initial time spend installing and size increase is worth the amount of time saved later on when you don't need to host the vm for a few more minutes and time spend downloading the packages again. Finally, if everyone who wanted to test mingw-w64 on windows needed to download every single package every time, I'm afraid that msys2.org will probably not be able to handle it. That would essentially be handing a person a clean arch install and expecting them to install everything needed to run a ci every single time they want to test their software |
@MSP-Greg, thanks for providing an example installation script! I hope that employees pick it ASAP. Regarding the discussion about which specific packages should or should not be installed, IMHO it is an interesting but absolutely irrelevant discussion in the current context. I don't mean to cut the discussion, but to bring the attention so that we can focus on the features that are necessary and useful for all of us. Precisely, I think that installing MSYS2 is not enough and it can break the environment, as it would conflict with mingw. We need GitHub employees to confirm that MSYS2 is going to replace MINGW, and that the default
I do think that all users that want MSYS2 are looking for
I think this is a different issue from installating default packages. This is about providing a "stable" environment or an "edge" set of packages. A first execution of the shell is recommended anyway. Hence, it's a matter of deciding which that first command should be. We had this discussion in setup-msys2 before: numworks/setup-msys2#7. Overall, as long as a base MSYS2 is provided, all other features (updating, installing (cached) packages, etc.) can be managed by an Action such as setup-msys2. That's why I think we should focus on the features that are not easily achievable with an action right now.
Personally, I want
This installation script is for the base image that GitHub has cached in their servers. Theoretically, when a workflow/job is started, all it needs to do is copy it to memory. That's the whole point of supporting a single Windows environment. Therefore, the penalty of having more packages installed by default should not be relevant at all. OTOH, not installing them is slow for sure, because they need to be retrieved each time. As a result, I think that GitHub is the one that should be worried about their HD/RAM footprint and network quote. That's something defined by their product strategy: do they want to take care of larger storage costs or do they want to charge paid users by forcing an slower environment?
I assume that GitHub has some internal caching that would prevent msys2.org from being hit too hard.
Well, this is the state of the art, since that's the essence of containers. Sure, you can have your own image built on top of a clean arch. However, pulling a large docker image in a GNU/Linux job is not very different from running a pre-install script in MSYS2. Most, if not all, practical use cases will need some kind of pre-install configuration, no matter how complete the default environment tries to be. |
Hi @eine, we are going to update docs with a proper note on a next image deployment, which is approximately next week. But we don't have plans to add MSYS2 to PATH in future. |
Qt can be installed with https://github.com/jurplel/install-qt-action. |
As msys2 was added under |
Yep, we have one more opened PR to improve installation stability: #928 . |
I see, it's probably best to link those prs and stuff to here so it's more visible without needing to go through the PR page, |
Install script in master Install-Msys2.ps1 |
I'm missing pacman in the MSYS2 install on windows-2019. Is that a deliberate omission or an oversight? |
Where are you looking for pacman? |
Git's bash shell has been the default on Win images, so MSYS2 is not included in Path. Pacman is located at |
In appveyor, I used $path = ([System.Environment]::GetEnvironmentVariable('PATH', 'Machine').Split(';') | Where-Object { $_ -notmatch 'Git' }) -join ';'
[System.Environment]::SetEnvironmentVariable('PATH', $path, 'Machine') to remove git from the path so I could use msys2's |
I'm using the following to run commands in MSYS/MinGW32 or MSYS/MinGW64 bash shell: name: Test Windows
on: [push, pull_request]
jobs:
msys:
runs-on: windows-2019
strategy:
matrix:
mingw: ["MINGW32", "MINGW64"]
include:
- mingw: "MINGW32"
package: "mingw-w64-i686"
- mingw: "MINGW64"
package: "mingw-w64-x86_64"
defaults:
run:
shell: bash.exe --login -eo pipefail "{0}"
env:
MSYSTEM: ${{ matrix.mingw }}
CHERE_INVOKING: 1
name: MSYS2 ${{ matrix.mingw }}
steps:
- name: Set up shell
run: echo ::add-path::C:\msys64\usr\bin\
shell: pwsh
- name: Print system version
run: |
uname
- name: Install package
run: |
# install python
pacman -S --noconfirm ${{ matrix.package }}-python3-setuptools
# build the project
python3 setup.py install The first step adds msys at the start of the path, and the Edit: added @1480c1's suggestion |
You might want to add |
@nulano, I updated the README in eine/setup-msys2 to show how to set a default shell, as you did. The main differences between your approach and setup-msys2 are the following:
You can find multiple workflow setups in https://github.com/eine/setup-msys2/blob/master/.github/workflows/action.yml. |
Msys2 was added to Windows images, this issue is closed. |
Tool information
Virtual environments affected
Can this tool be installed during the build?
Yes, via
choco install msys2
.Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: