-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
WIndows - update Install-Msys2.ps1 #906
Conversation
@@ -11,21 +11,25 @@ $origPath = $env:PATH | |||
$gitPath = "$env:ProgramFiles\Git" | |||
|
|||
# get info from https://sourceforge.net/projects/msys2/files/Base/x86_64/ | |||
$msys2Uri = "http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20190524.tar.xz" | |||
$msys2Uri = "https://github.com/msys2/msys2-installer/releases/download/2020-05-17/msys2-base-x86_64-20200517.tar.xz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MSP-Greg , what do you think about reworking it to consume the latest release always?
$latestRelease = Invoke-RestMethod "https://api.github.com/repos/msys2/msys2-installer/releases/latest"
$downloadAsset = $latestRelease.assets | Where-Object { $_.name -match "x86_64" -and $_.name -match "tar.xz" }
$msys2Uri = $downloadAsset.browser_download_url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Used REST from a lot of languages, but never PS... Collapsed a bit, hate needing to horizontally scroll code windows...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative is using the one explicitly named as the latest, these should be the same
https://github.com/msys2/msys2-installer/releases/tag/nightly-x86_64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we should install nightly build to image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two tarballs are the same exact files.
sha256sum msys2-base-x86_64-20200517.tar.xz msys2-base-x86_64-latest.tar.xz
c4443113497acb2d2e285d40b929fc55f33f8f669902595ecdf66a655b63dc60 msys2-base-x86_64-20200517.tar.xz
c4443113497acb2d2e285d40b929fc55f33f8f669902595ecdf66a655b63dc60 msys2-base-x86_64-latest.tar.xz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two tarballs are the same exact files.
In a month that may not be the case. Although not common, there have been reversions in some packages. Whether that has happened with any 'base' packages, I don't recall. With the update code, both will yield the same set of packages?
@lazka sorry for the ping. For the starting msys2 package for Actions Windows images, would you suggest using
msys2-base-x86_64-20200517.tar.xz
or
msys2-base-x86_64-latest.tar.xz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1480c1,
I don't see msys2-base-x86_64-latest.tar.xz
file in latest
release: https://api.github.com/repos/msys2/msys2-installer/releases/latest
Is there any reason to use nightly-x86_64
tag instead of latest
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msys2-base-x86_64-latest.tar.xz
is in the nightly-x86_64
release
One reason to use nightly-x86_64
is to reduce the number of packages that would need to be updated, depending on how behind the latest
release is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with MSYS2 release scheme but usually stable releases of tool are distributed as a separate GitHub releases, like this one: https://github.com/msys2/msys2-installer/releases/tag/2020-05-17
As I can see, Nightly builds are built based on master branch and just update the single release: https://github.com/msys2/msys2-installer/releases/tag/nightly-x86_64 (it means no changelog, no updates history)
And as it is mentioned in repository, those builds are not tested.
As author mentioned, they publish stable releases as separate tags after "manual testing".
It means that any bug introduced by new changes, will be picked up by nightly build and then will be consumed during image generation.
1. Use Invoke-RestMethod to retrieve most recent msys2 base 2. Git tar - change paths to full nix style 3. Git tar - requires exe's from Git/mingw64/bin, set ENV 2 & 3 may not be needed, but if anything changes...
$msys2FileU = "/$msys2File".replace(':', '') | ||
# nix style path for tar | ||
$msys2FileU = "/$msys2File".replace(':', '').replace('\', '/') | ||
|
||
# Git tar needs exe's from mingw64\bin | ||
$env:PATH = "$gitPath\usr\bin;$gitPath\mingw64\bin;$origPath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 7z available by this time? You can use 7z x
to extract the tarball (although not at once like tar
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if one pipes to STDOUT, 7z will extract easily.
But, given that the tar was created by MSYS2 tar, and Git tar is MSYS2, might was well extract with GIT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's up to you since both should result in the same output and the only reason why I mentioned 7z is that it supports windows style paths naturally without using msys2 style paths
@MSP-Greg, According to msys2/MSYS2-packages#1965 (comment), we must installing the latest version of msys2 to resolve the current issue. I have checked your script on local machine and it works ax expected. |
I will merge PR as @al-cheb mentioned, feel free to raise separate issue and discussion about switching to nightly tag |
@maxim-lobanov, according to msys2/MSYS2-packages#1965 (comment) (referenced by @al-cheb above), the following procedure should be updated: See also msys2/MSYS2-packages#1965 (comment) and msys2/MSYS2-packages#1962 (comment). /cc @MSP-Greg |
From msys2/MSYS2-packages#1965 (comment), it would imply that lines 48-50 could be removed. Note that the current code in master is using 20200517... |
@MSP-Greg, the suggested procedure is two comments below: msys2/MSYS2-packages#1965 (comment) and it involves:
Also, 53 should be modified according to msys2/MSYS2-packages#1962 (comment), because "situation with leftover processes can change in the future". |
Ref #355 |
Description
2 & 3 may not be needed, but if anything changes...
Script will run locally assuming one has Git for Windows installed. Since the base install is much newer, it requires fewer updates to be installed.
Check list