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

If lock file is deleted, restore does not generate lock file on NoOp #7807

Closed
anangaur opened this issue Feb 15, 2019 · 5 comments · Fixed by NuGet/NuGet.Client#2799
Closed
Assignees
Milestone

Comments

@anangaur
Copy link
Member

anangaur commented Feb 15, 2019

Steps:

  1. Enable RestorePackagesWithLockFile for a project
  2. Run restore (Full restore) - Note it generates the lock file as expected.
  3. Delete the lock file
  4. Run restore (not --force)

Actual:

  1. Lock file is not generated and Restore completes.
  2. Even in step 2 above, it does not output any message regarding lock file being generated.

Expected:

  1. Lock file should be generated.
  2. Whenever lock file is generated, there should be an info message to the user about lock file being generated.
@rrelyea
Copy link
Contributor

rrelyea commented Feb 23, 2019

Please work with @nkolev92 to understand how to add the existance of this file to noop calculation.

@nkolev92
Copy link
Member

What we do with the rest of the files (nuget.g.targets/props) is we validate their existence.

No-Op should not validate the integrity of the lock file during the check for performance considerations.

Making it aware that the property being set requires the existence of a lock file is sufficient I think.

What I mean with this is:

  1. Delete the lock file. Manually edit the lock file

will not be caught, but I think that's ok.

@nkolev92 nkolev92 added the Area:RestoreRepeatableBuild The lock file features label Feb 23, 2019
@heng-liu
Copy link
Contributor

heng-liu commented Apr 12, 2019

We can solve the problem in the scenario mentioned above. That is, Enable RestorePackagesWithLockFile by setting the property to true, run first restore to generate the lock file, delete the lock file, run second restore will fail the No-op and regenerate the lockfile.

But we have another scenario: enable restore package with lock file by generating a lock file but not setting the property, then the first restore will fail the No-op and re-generate lock file. Then we delete the lockfile and run the second restrore. Since there is no property set and no lock file exists, no lockfile would be generated. And it would No-op successfully. Is this result correct? Thanks! @anangaur

@anangaur
Copy link
Member Author

Yes this is as expected

@heng-liu heng-liu changed the title Restore does not generate lock file on NoOp If lock file is deleted, restore does not generate lock file on NoOp Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants