Skip to content
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

Better hash checks in bootstrapper #2368

Merged
merged 6 commits into from
May 26, 2017
Merged

Conversation

vbfox
Copy link
Contributor

@vbfox vbfox commented May 26, 2017

Quite a few changes related to hash file handling in the bootstrapper

  • Correctly cache the hash file (It was never cashed before even if the cache strategy expected it to be)
  • Make hash downloading a top-level operation only done when we know that the local version isn't the one we want
    • Avoid downloading it only to check the remote version
    • Also avoid downloading twice when TemporarilyIgnoreUpdatesDownloadStrategy is used
  • Check hash after every download from GitHub
    • It was only used to check if our cache is valid before, it's now being used to check if the download is valid directly after doing it
    • We re-try once if the hash is invalid and only warn if still invalid after a second download (Can be changed later, maybe we should let the fallback happen and download from nuget ?)

Fixes #2365

I tested manually and don't see any weird behavior anymore with useless downloads. I'll add some unit tests to confirm and the PR will be good to go

@vbfox vbfox changed the title [WIP] Better hash checks in bootstrapper Better hash checks in bootstrapper May 26, 2017
@matthid
Copy link
Member

matthid commented May 26, 2017

Wonderful, thanks again for taking care of this!

@matthid matthid merged commit 5bea97b into fsprojects:master May 26, 2017
@matthid
Copy link
Member

matthid commented May 27, 2017

@vbfox I tried to add the bootstrapper again but I got:

C:\projects\fake\.paket\Paket.Restore.targets(17,5): error MSB3073: The command ""C:\projects\fake\.paket\paket.exe" restore --project "C:\projects\fake\src\app\Fake.Core.Targets\Fake.Core.Targets.fsproj" --target-framework netstandard1.6" exited with code 1. [C:\projects\fake\src\app\Fake.Core.Targets\Fake.Core.Targets.fsproj]
  Could not find a part of the path 'C:\Users\appveyor\AppData\Local\NuGet\Cache\Paket\5.0.0-beta006\paket-sha256.txt'. (Github - cached)

on Appveyor

and Travis

/home/travis/build/fsharp/FAKE/.paket/Paket.Restore.targets(17,5): error MSB3073: The command "mono --runtime=v4.0.30319 "/home/travis/build/fsharp/FAKE/.paket/paket.exe" restore --project "/home/travis/build/fsharp/FAKE/src/app/Fake.Core.BuildServer/Fake.Core.BuildServer.fsproj" --target-framework netstandard1.6" exited with code 1. [/home/travis/build/fsharp/FAKE/src/app/Fake.Core.BuildServer/Fake.Core.BuildServer.fsproj]

  Destination directory not found: /home/travis/.local/share/NuGet/Cache/Paket/5.0.0-beta006 (Github - cached)

Maybe I did something wrong?

@vbfox
Copy link
Contributor Author

vbfox commented May 28, 2017

I suspect I just fucked up by not testing the case where the cache folder doesn't exists at all. I'll fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants