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

Reevaluate the packages lock file + transitive project versions #7935

Open
nkolev92 opened this issue Mar 30, 2019 · 3 comments
Open

Reevaluate the packages lock file + transitive project versions #7935

nkolev92 opened this issue Mar 30, 2019 · 3 comments
Labels
Area:RestoreRepeatableBuild The lock file features Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Bug

Comments

@nkolev92
Copy link
Member

Currently if you have a transitive projects, the transitive project will have a requested version for the project.
This would mean every project version change will require a lock file regeneration.

//cc @anangaur
@joelverhagen @zivkan @dominoFire @rrelyea

@nkolev92 nkolev92 added the Area:RestoreRepeatableBuild The lock file features label Mar 30, 2019
@nkolev92 nkolev92 self-assigned this Mar 30, 2019
@rrelyea rrelyea added this to the 5.1 milestone Apr 5, 2019
@rrelyea rrelyea added Type:DCR Design Change Request Type:Bug and removed Type:DCR Design Change Request labels Apr 5, 2019
@nkolev92
Copy link
Member Author

A bit of background:

The packages.lock.json model has 3 types of dependencies.

  1. Project - project reference, both direct & transitive are written the same.
  2. Direct - packages directly referenced
  3. Transitive - packages pulled in transitively, either through project or package

Now a few things that cannot be understood from the lock file:

  1. In the lock file there is no distinction between a project pulled in transtiively and a direct project reference.
  2. For project dependencies, their dependencies are listed as well. However, you cannot figure out solely from that object (below) whether a dependency is a project or a package. You can look at the related changes however and figure it out because of the duality between project/packageids on NuGet side.

Relevant: https://github.com/NuGet/NuGet.Client/pull/2701/files#diff-4f61fe90f26719aa002d997eb1a92576

     "NuGet.Packaging": {
        "type": "Project",
        "dependencies": {
          "Newtonsoft.Json": "9.0.1",
          "NuGet.Configuration": "5.0.0-preview3",
          "NuGet.Versioning": "5.0.0-preview3"
        }
      },

Now after fixing a few bugs with the evaluation:

#7889
#7930
#8019

We now have the lock file up to date check verify that the project reference graph is the same.
However it does not verify the project versions.

The reason for this is because if we tried validating the versions, it would fail every CI build in locked mode.
We recommend that every build creates package with a different version, so even our CI would fail with this.

tl;dr;

The version for projects listed in the dependencies section is useless.
Furthermore it's very easy for it to get out of date. You could be building a

Removing it would require potentially changing the model of the lock file is written.
I can investigate if re-moving it is a no-op.
Unsure if this breaks any existing code if the file is not written with a project version.
I can investigate more if we think removing them is the right approach.

I don't expect any issues if we were to fix this in 5.2 though. If it breaks the model, we increment the file version. If it doesn't break the model, switching between versions could create noise, but eventually it should disappear.

@nkolev92
Copy link
Member Author

Safe to say, this won't make it in 5.1. :)

@nkolev92 nkolev92 modified the milestones: 5.2, Backlog Apr 25, 2019
@nkolev92
Copy link
Member Author

Related: #8465

@nkolev92 nkolev92 removed this from the Backlog milestone Aug 27, 2020
@nkolev92 nkolev92 removed their assignment Nov 7, 2020
@jeffkl jeffkl added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Pipeline:Icebox labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:RestoreRepeatableBuild The lock file features Functionality:Restore Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Bug
Projects
None yet
Development

No branches or pull requests

5 participants