Skip to content

"type": "platform" Dependencies represented as "type":"package" in lock file #2695

Closed

Description

@brthor

Repro

  1. dotnet new
  2. dotnet restore

In the lock file:

"Microsoft.NETCore.App/1.0.0-rc2-3002563": {
        "type": "package",
        "dependencies": {

I'd expect:

"Microsoft.NETCore.App/1.0.0-rc2-3002563": {
        "type": "platform",
        "dependencies": {

In the cli, this is a meaningful difference.
The real issue is that restoring without "type":"platform" produces a different lockfile, but no way to determine (from the lock file) whether "type":"platform" is used. If a win10-x64 is present in the project.json, the "type": "platform" restored lock file will not list coreclr.dll as a native export, but the non "type": "platform" restored lock file will.

Find more discussion on the cli issue; https://github.com/dotnet/cli/issues/2760

Activity

  1. added this to the 3.5 RC milestone on May 2, 2016
  2. added
    Type:DCR
    on May 2, 2016
  3. rrelyea commented on May 2, 2016

    @rrelyea
    Contributor

    likely need...an api so that CLI can detect if the lock file is out of date.

  4. clairernovotny commented on Jun 7, 2016

    @clairernovotny

    Also, in addition to platform, we need to know build type dependencies that might appear in a transitive lock file.

    In my scenario, I'm reading the lock file to determine what the "true" dependencies are for the package that should be emitted to a nuspec file, and I nee d to tell if a package there is build or platform in a way that captures the transitive closure.

  5. eerhardt commented on Jul 25, 2016

    @eerhardt

    @rrelyea @emgarten - I just ran into this issue trying to write some MSBuild .targets files for the conversion from project.json to .csproj.

    Any chance this bug can get fixed? The new .net core MSBuild targets and tasks shouldn't be dependent on project.json, so we are trying to read all necessary info from the project.lock.json file to use in our MSBuild logic.

  6. emgarten commented on Jul 25, 2016

    @emgarten
    Member

    type in project.lock.json corresponds to the target property from project.json currently.

    Adding a new property to carry along some of the original project.json flags could make sense, but it sounds like build and platform would work very differently.

    Build would need to be applied only to libraries which are not referenced by non-build dependencies.

    Platform on the other hand would either need to be just on the top level package, or NuGet would have to attempt to figure out what that package was expecting for dependencies and then apply the flag only to those, and not to packages which were bumped to differing versions. It would also need to understand that if another package brought in a dependency already included in the platform set that it should still be marked as platform.

  7. brthor commented on Aug 1, 2016

    @brthor
    Author

    @emgarten Perhaps both properties could be applied to the top level node only and the logic to determine which parts of the subgraph rooted at that top level node (for either type build or platform) falls under that top level label can still be captured outside of the lock file.

    For example in CLI today we do a graph walk to determine the type build exclusion list. I think the graph walk would still be okay for generating the exclusion list but we want to get the info of which packages declared type build from inside the lock file instead of inside the project.json

  8. modified the milestones: , on Aug 4, 2016
  9. modified the milestones: , on Sep 22, 2016
  10. self-assigned this
    on Sep 23, 2016
  11. rrelyea commented on Oct 19, 2016

    @rrelyea
    Contributor

    this was handled by dotnet/sdk#17
    closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type:DCR

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions