Repository navigation
Leave the load scripts to the restore after paket update --no-install - #4486
Merged
Merged
Conversation
…stall With generate_load_scripts: true, paket update --no-install generated the load scripts from the packages folder, which --no-install doesn't download. It failed with "Folder ... doesn't exist. Did you restore group Main?" when a package of the new paket.lock wasn't there, as on a fresh checkout or for a package that the update adds, and wrote the scripts from the packages of the old lock when versions changed. As --no-install doesn't write the restore cache, the next restore sees the new lock, downloads the packages and generates the scripts. Fixes #2785
…he load scripts The hint is printed when update --no-install changes paket.lock, the case where the next restore downloads the packages and generates the scripts. It names paket restore rather than the --no-install flag, which API callers don't pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2785
With
generate_load_scripts: true,paket update --no-installfailed withFolder .../packages/<package> doesn't exist. Did you restore group Main?when a package of the newpaket.lockwasn't restored, as on a fresh checkout or for a package that the update adds. This branch leaves the load scripts to the next restore.Cause
SmartInstall(UpdateProcess.fs) only downloads the packages inInstallProcess.InstallIntoProjects, which--no-installskips, but it generated the load scripts afterwards anyway.DependencyCachereads them from thepackagesfolder and fails on the first package that isn't there. When all the folders were there, the scripts were written from the packages of the old lock file.Fix
--no-install,updatewritespaket.lockand skips the load scripts. It doesn't writepaket-files/paket.restore.cachedeither, as onlyInstallIntoProjectsdoes, so the nextpaket restorefinds a lock file that doesn't match the cache: it downloads the packages and generates the scripts, as after any other change of the lock file.updateprints that the nextpaket restorewill generate the load scripts.update --no-installdoesn't download the packages to generate the scripts itself, and keeps writing only the lock file.Tests
LoadingScriptGenerationTests: on theissue-2939scenario (generate_load_scripts: true, nothing restored),update --no-installwritespaket.lockand prints the hint, without downloading the packages or creating.paket/load. The restore that follows generatesNewtonsoft.Json.fsx. Without the fix, the test fails with the error of the issue.paket, a secondupdate --no-installthat leaves the lock file unchanged prints no hint.