Skip to content

Conversation

@eerhardt
Copy link
Member

@eerhardt eerhardt commented May 12, 2020

Fixes build errors like the following:

src\libraries\pkg\test\testPackages.proj(217,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) Validation Failed: Microsoft.Extensions.DependencyModel is harvesting assets from package version 3.1.3 which is not the latest for that package release. Latest package version from that release is 3.1.4. In order to fix this, run `dotnet msbuild Microsoft.Extensions.DependencyModel.pkgproj /t:UpdateHarvestVersionOnPackageIndex /p:UpdateStablePackageInfo=true`

See https://dev.azure.com/dnceng/public/_build/results?buildId=641411&view=logs&j=423ae147-26a3-5a4d-a4d3-4b3fc1dd598e&t=98a4dd5a-baea-5dc4-484b-ccbd315f07c8 for an example.

@ghost
Copy link

ghost commented May 12, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

"InboxOn": {},
"AssemblyVersionInPackageVersion": {
"3.1.3.0": "5.0.0",
"3.1.4.0": "5.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure about this one but I understand you didn’t do this manually so I’m ok with it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did do this manually. 😄

The assembly version in DependencyModel got updated to 3.1.4.0, so I updated this as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I do it automatically?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not update this. This is meant to indicate the first package version an assembly version appeared in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that the break in the build error should tell you the command you have to run in order to fix this automatically

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually do use it to determine which package dependency version other packages will get if they depend on DependencyModel. For example: say you have a library B which depends on DependencyModel, and more specifically they depend on assembly version 3.1.4.0. Our package infrastructure will then come to this table, and check which package version is the one where that assembly version first appeared, (the table above actually looks incorrect as I would assume that it should have something like "3.1.4.0": "3.1.4") and then determine that package B should depend on at least DependencyModel package version 3.1.4. Assuming there is no BaselineVersion for DependencyModel (which in this case we do have one, but let's pretend we don't) then B would depend on 3.1.4 DependencyModel. In this case we do have a BaselineVersion, so even if our package infrastructure chooses package version 3.1.4 for the dependency, it will then baseline up to 5.0.0 because BaselineVersion > InitialChoosenPackageVersion.

Does that sort of make sense?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I believe that the right contents of that dictionary for DependencyModel should look something like:

      "AssemblyVersionInPackageVersion": {
        "3.1.3.0": "3.1.3",
        "3.1.4.0": "3.1.4",
        "5.0.0.0": "5.0.0"
      }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are so far in the CI now, I want to wait for it to finish and merge this to unblock the build. I can put up another change for the above.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that as long as we take care of it 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safern
safern approved these changes May 12, 2020
@safern
Copy link
Member

safern commented May 12, 2020

All configurations is green so I'll go ahead and merge to unblock other PR/CI builds.

@trylek
Copy link
Member

trylek commented May 24, 2020

I'm seeing a very similar looking issue in my latest PR run:

https://dev.azure.com/dnceng/public/_build/results?buildId=657927&view=logs&jobId=5373b9aa-3658-546d-0a78-c247de617f40&j=5373b9aa-3658-546d-0a78-c247de617f40&t=d7b36ffb-0896-506c-9920-38786e77292f

F:\workspace\_work\1\s\src\libraries\pkg\test\testPackages.proj(217,5): error : Validation Failed: Microsoft.Extensions.DependencyModel is harvesting assets from package version 3.1.3 which is not the latest for that package release. Latest package version from that release is 3.1.4. In order to fix this, run `dotnet msbuild Microsoft.Extensions.DependencyModel.pkgproj /t:UpdateHarvestVersionOnPackageIndex /p:UpdateStablePackageInfo=true`
##[error]src\libraries\pkg\test\testPackages.proj(217,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) Validation Failed: Microsoft.Extensions.DependencyModel is harvesting assets from package version 3.1.3 which is not the latest for that package release. Latest package version from that release is 3.1.4. In order to fix this, run `dotnet msbuild Microsoft.Extensions.DependencyModel.pkgproj /t:UpdateHarvestVersionOnPackageIndex /p:UpdateStablePackageInfo=true`

Build FAILED.

Has it somehow regressed again or am I hitting an unrelated issue that just has similar manifestations?

Thanks

Tomas

@joperezr
Copy link
Member

This symptom can only really be caused by one thing which is your local packageIndex.json is not up to date, but that shouldn’t happen unless you reverted the changes @eerhardt made or you are building an old branch that doesn’t have his change.

@joperezr
Copy link
Member

From looking at the link you attached, looks like your PR was against a different branch, dev/infrastructure, so it is very possible that his change isn’t present on that branch. In order to fix this, just port his change over there which should fox the issue

@trylek
Copy link
Member

trylek commented May 24, 2020

Ahh, of course you're right, thanks @joperezr for reminding me, it's been a while since I last worked in a feature branch and I completely forgot that. I guess I should follow up with @jashook though as I was under the impression that the dev/infrastructure branch should be on a weekly sync-up plan with master and this fix seems almost two weeks old.

@ManickaP
Copy link
Member

ManickaP commented Jun 9, 2020

Seeing something similar in #34948, as well as on one of the newest PR #37662 in repo as of now :

src\libraries\pkg\test\testPackages.proj(217,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) Validation Failed: Microsoft.Extensions.DependencyModel is harvesting assets from package version 3.1.4 which is not the latest for that package release. Latest package version from that release is 3.1.5. In order to fix this, run `dotnet msbuild Microsoft.Extensions.DependencyModel.pkgproj /t:UpdateHarvestVersionOnPackageIndex /p:UpdateStablePackageInfo=true`

@eerhardt
Copy link
Member Author

eerhardt commented Jun 9, 2020

@ManickaP - the same thing happened again with 3.1.5. #37663 is fixing it. #37661 is tracking fixing the underlying issue

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants