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

Duality nuget packages have the wrong folder structure under lib #696

Closed
Barsonax opened this issue Oct 20, 2018 · 7 comments
Closed

Duality nuget packages have the wrong folder structure under lib #696

Barsonax opened this issue Oct 20, 2018 · 7 comments
Assignees
Labels
Editor Area: Duality editor or support libraries PackageManager Area: Editor package management or its UI Task ToDo that's neither a Bug, nor a Feature
Milestone

Comments

@Barsonax
Copy link
Member

Barsonax commented Oct 20, 2018

Summary

Currently the dll's in the duality nuget packages are directly in the lib folder. This is wrong and can cause annoying problems. One of these problems is that you cannot reference duality in .Netstandard1.1 project (version 2.0 and higher do work).

The lib folder should contain a folder for each target framework (even if its only 1). So in the case of a pcl with profile111 the lib folder should contain a portable45-net45%2Bwin8%2Bwpa81 folder with the dll

Why is this important? Nuget uses these folder names to figure out the target framework and uses this to resolve compatiblity issues. If you put the dll directly under lib then nuget will identify it as a .NETFramework, Version=v0.0. Obviously this is prone to cause problems when it needs this version to resolve something.

How to reproduce

Try to reference a Adamslair.Duality from a netstandard1.1 project through nuget. It should work but it doesnt. Putting <PackageTargetFallback>$(PackageTargetFallback);portable45-net45+win8+wpa81</PackageTargetFallback> wont fix this as it cannot identify the library.

Workaround

2 options:

  • Add the dll manually without nuget.
  • Add <PackageTargetFallback>$(PackageTargetFallback);net00</PackageTargetFallback> to your csproj. This will fix adding the nuget package.

Analysis

  • nuget pack SomeDuality.csproj seems to generate a correct nuget package. Not sure what the ci server is using for duality but its doing something different for sure.
@ilexp ilexp added this to the General milestone Oct 20, 2018
@ilexp ilexp added Task ToDo that's neither a Bug, nor a Feature Editor Area: Duality editor or support libraries Help Wanted Contributions especially appreciated Plugin Area: Misc. core / editor plugins labels Oct 20, 2018
@ilexp
Copy link
Member

ilexp commented Oct 20, 2018

Duality internal NuGet packages currently do not specify a target framework and do not use framework folders. This hasn't been a problem in old NuGet via VS, but it is becoming one when working in the more modern netstandard / netcore area. It's not an issue of binaries or building, but how things are packaged and labeled in the end.

It will need to be addressed before switching Duality to .Net Standard, see also this comment and also this one, but fixing this would be a great idea in any case. As a first step, the Duality package manager needs to properly support / consume multi-framework packages and, when this is done, Duality binaries can be packed specifying a proper target framework as well.

@ilexp
Copy link
Member

ilexp commented Apr 27, 2019

Note that the Duality package manager should now be smart enough to handle multi-framework packages, both regarding their payload and dependencies - meaning this issue is no longer blocked by preconditions.

@Barsonax
Copy link
Member Author

Solution seems to be to simply use 'nuget pack' right? Since we are planning to move away from the older nightly build tool this could be solved at the same time.

@ilexp
Copy link
Member

ilexp commented Apr 27, 2019

Solution seems to be to simply use 'nuget pack' right? Since we are planning to move away from the older nightly build tool this could be solved at the same time.

We'll still need .nuspec files to explicitly specify package contents for samples, and to keep the automated semantic version updater tooling operational, so there will be some manual work involved to update their package lib folder targets.
We'll also need to update non-Duality AdamsLair dependencies, such as our OpenTK fork, or AdamsLair.WinForms. Some of those might actually be fine without nuspecs, will have to investigate on a per-library basis. The others will need updated nuspecs as well, but those will be minor changes as well.

So for the sake of simplicity, I'd keep the two issues separate. Better two small, self-contained steps with a small gain each, than one bigger, riskier one.

Rough outline of the steps to investigate:

  • Update nuspecs in Duality main repo to use proper lib folders.
  • Update nuspecs in Duality dependency repos to use proper lib folders.
  • Bump all dependency versions and publish them.
  • Update all dependencies in the Duality main solution (and nuspecs!)
  • Bump all Duality package versions.
  • Do a full offline / local repo test run to ensure we didn't screw up the dependency graph after all those version bumps.
  • Merge and trigger a binary release.

@ilexp
Copy link
Member

ilexp commented Apr 28, 2019

Progress

  • Updated and published dependency packages to use framework lib folders:
    • AdamsLair.WinForms.PopupControl
    • AdamsLair.WinForms
  • Found that some of the packages contain both framework-dependent and lib-root files, which are a combined version of explicitly specified contents and csproj-derived contents. Aligning explicit with implicit content for now.

ToDo

  • Update nuspecs in Duality dependency repos to use framework lib folders, bump their version numbers and publish them:
    • AdamsLair.OpenTK
    • AdamsLair.OpenTK.GLControl
    • AdamsLair.NVorbis
    • AdamsLair.TreeViewAdv
    • AdamsLair.DockPanelSuite
  • Update all dependencies in the Duality main solution (and nuspecs!)
  • Update nuspecs in Duality main repo to use framework lib folders.
  • Bump all Duality package versions.
  • Do a full offline / local repo test run to ensure we didn't screw up the dependency graph after all those version bumps.
  • Merge and trigger a binary release.

@ilexp ilexp self-assigned this Apr 28, 2019
@ilexp ilexp removed the Help Wanted Contributions especially appreciated label Apr 28, 2019
@ilexp
Copy link
Member

ilexp commented May 1, 2019

Progress

  • Updated all dependency nuspecs and released patch versions for all dependency packages.
  • Moved to branch feature/package-frameworks-696.
  • Updated all dependencies in the Duality main solution.
  • Updated all Duality nuspecs to use framework folders.
  • Bumped all Duality package versions.

ToDo

  • Do a full offline / local repo test run to ensure we didn't screw up the dependency graph after all those version bumps.
  • Merge and trigger a binary release.

@ilexp
Copy link
Member

ilexp commented May 4, 2019

Duality and all of its dependencies now use framework folders in their packages. Closing this.

@ilexp ilexp closed this as completed May 4, 2019
@ilexp ilexp added PackageManager Area: Editor package management or its UI and removed Plugin Area: Misc. core / editor plugins labels Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Editor Area: Duality editor or support libraries PackageManager Area: Editor package management or its UI Task ToDo that's neither a Bug, nor a Feature
Development

No branches or pull requests

2 participants