-
Notifications
You must be signed in to change notification settings - Fork 69
Conversation
Before this change, KoreBuild would not pick the correct version when it had to upgrade. The variables used to point to the latest version (in case an upgrade is needed) hadn't been updated before download commences. This fixes that situation and allows the machine to have the latest CLI from the beta channel installed.
Hi @DavidObando, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
@@ -189,6 +189,9 @@ install_dotnet() | |||
say "Local Version: $localVersion" | |||
|
|||
[ "$remoteHash" = "$localHash" ] && say "${green}You already have the latest version.${normal}" && return 0 | |||
|
|||
dotnet_url="https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/Binaries/$remoteVersion" |
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.
Doesn't the url crafted on line 172 work? If you set it to Latest it should grab https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-osx-x64.latest.tar.gz which works?
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.
In this case it's because KoreBuild.sh sends the -version argument to dotnet-install.sh with value 1.0.0.001244. That is, we're not moving to "Latest" every time you build.
The changes I'm proposing are simply doing what the script was supposed to do on a version change. Assume your computer has dotnet version 1.0.0.001244 but we change KoreBuild.sh to point to version 1.0.0.1333. The script in its current form will always download the wrong file and fail to upgrade you to the newly specified version.
Same as the previous change, but for the PowerShell script.
The change looks okay but what I don't like is making changes in this file since this it's a copy of https://github.com/dotnet/cli/tree/rel/1.0.0/scripts/obtain and they files will diverge (even more). If the CLI decides to update the way they install, we're going to have to merge all our changes... We should fix this instead: https://github.com/dotnet/cli/issues/1091 @DavidObando, want to give it a try? :) |
They used to differ in logic, this just aligns them
@victorhurdugaci I can backport these changes to dotnet/cli. The changes are just around consistency, and it helps us not have to re-download the cli every time we build in Linux (which is happening today). This change helps ensure that #384 can be properly fixed. |
@@ -59,6 +59,8 @@ if (Test-Path $LocalFile) | |||
say "You already have the latest version" | |||
exit 0 | |||
} | |||
$DotNetFileName="dotnet-win-x64.$RemoteVersion.zip" |
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.
Why does, dotnet-win-x64.latest.zip
not work? We shouldn't need to specify the Latest version: #383 (comment)
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 same bug was present in the powershell script, as in the bash script. This just brings both scripts to functional parity.
⌚ |
@Sridhar-MS @piotrpMSFT how do you feel about these changes? Should be port them back to your install scripts and fix https://github.com/dotnet/cli/issues/1091 |
If the change is needed we should make it in the CLI repo as well. I'm not sure I understand the need for this change, however. Why do we need explicit version numbers in filename/URL when we're asking for 'latest'? Is the intent to avoid issues if a newer build gets dropped between the time that version is retrieved and the time that the zip is retrieved? |
@piotrpMSFT If simply asking for 'latest' is what's intended, then I can revert those changes and also remove the code that hits |
We shouldn't remove that code. The purpose of the request for latest.$os.version is to compare to what is already available locally. We need to know if what was downloaded before as Makes sense? |
It does make sense, except that's not what I'm observing in my Ubuntu VM. KoreBuild.sh is hardwired to send Before these changes I'm proposing, dotnet-install.sh will always say: hey, I see your local version is 1.0.0.001244 and latest is 1.0.0.1370, downloading version 1.0.0.001244. It then proceeds to download that version and install it again, regardless of what I have installed. We're essentially re-installing the same version of dotnet every time we build. |
Looking at the code:
So it looks like the script will only download the version file IF |
That's true for PowerShell but not for Bash. |
ahh, ok, I get it. Can this PR be moved over to the CLI repo and simply update .sh to match .ps1? |
You mean without the override to dotnet_url and dotnet_filename? I can do that. I still think the override is necessary, but I'll do as you say. |
well, what's the intent there? why do we want to calculate these? |
Currently we have this:
The code is checking what the latest version of
I'd argue that these could go out of sync and cause the same behavior of re-installing on every build even if you already have the latest. If you think this is okay, I'll go for it. Otherwise we have two alternatives.
By the way, thanks for giving this some of your time. |
That |
Yeah, the current code will work as long as |
Hey @sajayantony, this fix also improves build time by a few seconds in Linux and OSX as it avoids re-downloading and installing the CLI if you already have it. Today the CLI gets downloaded again every time you build, even though the version of the CLI we use is fixed. @piotrpMSFT @victorhurdugaci how do you want to proceed with this? |
@krwq and @blackdwarf are in the process of productizing the script files. At this point, I think we should just wait. |
@piotrpMSFT sounds good, thanks! |
If you get to merge this, please make the same change in github.com/aspnet/KoreBuild |
FYI, please take a look at @blackdwarf and @krwq's PR dotnet/cli#1482. It details how the updated install scripts will work. |
What's the latest on this PR? Needed still? |
@muratg I don't think so. I was waiting for changes to come into the build and I saw them yesterday. I'm closing as this is not necessary anymore. Thanks! |
Before this change, KoreBuild would not pick the correct version when it had to upgrade. The variables used to point to the latest version (in case an upgrade is needed) hadn't been updated before download commences. This fixes that situation and allows the machine to have the latest CLI from the beta channel installed.
@sajayantony @muratg @CesarBS @pranavkm @victorhurdugaci