-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Make install scripts more consistent over different operating systems #9071
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
Conversation
I used |
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.
@iSazonov thanks for the great suggestions! I was not entirely sure about the correct casing for Visual Studio Code, as I could find it as |
It appears the connection to windowsitpro.com has timed out, which is why the static analysis has failed. The next connection to it however does finish successfully. Should the CI be restarted or is this not an issue? |
Restart CI-static-analysis. |
@DarwinJS Would you mind giving this a first pass? |
478a6d6
to
9b9b36b
Compare
Okay... I tried to add support to the CI for a representative portion of the distros. AmazonLinux image failed because it was missing OpenSUSE failed because it Azure DevOps could not find |
So CentOS testing was the only distro added. cc @adityapatwardhan |
Travis - Amazon optimizes every purpose specific use of Amazon Linux and of course specifically the one for containers. Since the size of the Amazon built Amazon Linux containers affects their server density globally across all customers, it will likely be necessary to add back what you need to get CI running. PS For my local testing of Amazon Linux 2 - I have actually created some antipattern containers that have the entire EC2 build version: https://cloudywindows.io/post/three-amazon-linux-2-containers-for-testing/ |
@Geweldig - did you test your changes on the major distros? |
@DarwinJS I have verified it to be working for the following operating systems:
Which should cover the major distros. I have tried the installer on openSUSE Leap 15 (as 42.3 is reaching EOL in July) where I have not been able to get it to work. However, when trying to run the script which is currently on master I couldn't get it to work either. This problem is twofold, as the OS is not recognized by the main script and the openSUSE installer which is currently provided contains invalid bash. Unfortunately I am not familiar with openSUSE and would need some time to figure out why it currently is not recognized by the script on master and find a robust solution to recognize the operating system. |
|
||
|
||
|
||
if [[ "'$*'" =~ appimage ]] ; then | ||
if [ -f $SCRIPTFOLDER/appimage.sh ]; then | ||
if [ -f "$SCRIPTFOLDER/appimage.sh" ]; then |
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.
We have not produced an appimage in a long time. This in not blocking, but I think this code can either go, or be replaced with a check for snapd and then use snapd
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.
Adding a check for snapd sounds like a good replacement, but might not be very robust as snapd is not yet standard in a lot of distributions (I believe it's currently only shipped with Ubuntu). Because of this I would argue that deleting the code for appimage would make more sense, and implementing a snap install when Snappy is more mature/widely used.
@DarwinJS The CI YML for testing these scripts is here: PowerShell/.vsts-ci/install-ps.yml Lines 45 to 64 in 7031954
NOTE: where a container is listed, it overrides the pool. Like on line 54, to switch to CentOS. Currently Ubuntu 16.04, CentOS 7, and macOS Mojave are in the list. |
Is it ok if I reverse these changes? |
Why revert? Do you know the issue root cause? Is it possible to fix? |
I don't know the root cause, but I let this slip through without realizing the distro fingerprinting had been altered to DEPEND on the parent script being called for each distro specific script. I had specifically designed it to not depend - the parent script was a convenience when wanting to target distros homogenously. But then I wanted to get off using my original merge branch for linuxmint support which still works for Amazon Linux - and this one does not. (I use it here to create Amazon LInux 2 containers that have PowerShell: https://gitlab.com/DarwinJS/amazon-linux-2-container-with-powershell/blob/master/Dockerfile#L4) So this all points to the changes not being comprehensively tested - something I was doing whenever I made broad-based changes. Since these changes seemed to be mainly making the code prettier - not more functional - I'd rather revert to a known working state that I had tested across all distros - than try to fix and retest on all distros. I really don't have the time for the latter. |
@Geweldig @TravisEz13 Thoughts? |
OK, then maybe the solution is to consider Amazon Linux 2 a major distro and test and debug for it. Not only is Amazon treating it this way, but it was the first distro to have prebuilt cloud image template (AMIs) from the cloud provider with .NET Core and PowerShell Core preinstalled. That is a full Ec2 image, I want to use amazon linux 2 w/ PowerShell Core under Gitlab CI on Linux containers - so still need installation support. |
@DarwinJS I indeed didn't test the install script on Amazon Linux 2, as I did not have access to a build environment for it. However, I believe the changes made to the install script shouldn't have broken anything as they only cleaned up unused and broken variables, but I'm obviously wrong. All changes which I believe could break the build on Linux, should also break all other scripts which we have tested to be working. Do you have a specific error so we can pinpoint where the script goes wrong? |
I have concerns about the rollback since the PR has been merged for a long time (we have a release after that).
Maybe you could cooperate with @DarwinJS directly? |
The following Docker commands will let you easily test:
|
Ah I see what the problem is, I rewrote the OS checks in a single script and copied them over all other scripts. However, the script I originally based it on seems to not have included the check for amazonlinux. Not sure how I missed that, but it shouldn't be difficult to fix. |
@iSazonov @DarwinJS @Geweldig We have started to move the packaging/installation tools into separate repos that are maintained by the people that care about that tool. Honestly, long term I think we should do the same thing here. We could keep the main script with a warning to migrate. cc @SteveL-MSFT |
@TravisEz13 Could you please reference the new repo? |
@iSazonov This is a concept. There is no current. But Docker and Snap have been separated, if that is what you are talking about. |
PR Summary
I noticed a couple of inconsistencies when reading through the install bash scripts.
sed
implementations oflowercase
with a more maintainabletr
implementation.OS
variable in every install script, making it so previously unused checks are actually used.PR Context
A lot of people, including myself, read the install scripts before executing them. While doing so I noticed they contained inconsistencies. For example, certain flags you can pass to the install script were either undocumented or had an incorrect description. This PR fixes some of these inconsistencies, which should make them easier to maintain and easier to read.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.[feature]
to your commit messages if the change is significant or affects feature tests