--dependencies unused argument in dnu pack
Yep it's been there for a while but we never did anything with it.
Are we going to do anything with this, or should we just remove the argument?
I’m confused on how dnu pack is supposed to work with dependencies and think the --dependencies option is going to be needed. As it stands now (unless I'm missing something), the lib folder pdb's and the source are not in sync, and the .symbol.nupkg for a project with a dependency cannot be published to symbolsource.
I’m using 1.0.0-beta5-12103 and have two projects in my src folder. Project A is a dependency of Project B. When I run dnu list on Project B, Project A shows up in the "Project References."
I'm seeing inconsistencies when I run dnu pack on Project B. When I open up the .nupkg, the nuspec file lists Project A as a dependency which seems right. However the dll for Project A is also appearing in the lib folder. My expectation there is that it either should not be there or that should configurable.
Aside from the extra size of the .nupkg, this is causing a bigger problem specifically with the .symbols.nupkg file. Inside there, the Project A dll and pdb are again being copied to the lib folder, but the source code from Project A is not. This causes an error when I attempt to publish Project B to symbolsource. I'm getting a "Pack submission failed" with a reason that it can't find a particular source file in Project A's pdb.
I would think the --dependencies option in dnu pack would control this, where if it is not there, there would be no dependency files added (smaller .nupkg) and that if the option is applied it should add the Project A assemblies as well as the source (in effect merging two projects into one .nupkg).
This flag isn't required, what you're describing sounds like a bug. --dependencies was initially going to be there just to support scenarios where other tools needed the full dependency closure in an output folder somewhere. The symbol source issue seems unrelated and we should fix it.
I think they are related. Without the --dependencies option being used, dnu pack is including project dependencies in the lib folder. If that is a bug and is fixed so that they aren't there, I assume symbol source would work as expected.
As I understand what you're saying about the --dependencies option (if it were to be implemented), when applied the lib folder should work as its currently working now (adding dependencies to lib). However in addition to that, source files need to be included as well. But that is work that would only need to be done if you decide not to remove the --dependencies option.
Without the --dependencies option being used, dnu pack is including project dependencies in the lib folder. If that is a bug and is fixed so that they aren't there, I assume symbol source would work as expected.
Are you saying that is the case for symbol packages? Because that doesn't happen in general. What you're describing sounds like a bug.
As I understand what you're saying about the --dependencies option (if it were to be implemented), when applied the lib folder should work as its currently working now (adding dependencies to lib). However in addition to that, source files need to be included as well. But that is work that would only need to be done if you decide not to remove the --dependencies option.
I'm really saying that this option should be removed completely and if it comes back it would likely be an option on dnu build not pack and the only scenario would be to get the bits all copied to some output folder. Nothing to do with packages that at point.
@muratg Lets remove the flag all up.
The issue I'm seeing applies to both regular and symbols .nupkg files.
I have an application that is made up of two class libraries in the src folder which I'll refer to as mainProj and addOnProj. addOnProj depends on mainProj
root
- artifacts
- global.json
- src
- mainProj
- addOnProj
After I pack both projects, mainProj works fine. If I look inside the lib, each framework contains mainProj.dll.
However, when I open either nupkg for addOnProj, each framework folder in the lib contains both mainProj.dll and addOnProj.dll. My understanding is that only addOnProj.dll should be there.
And if it helps, my steps to build the nupkg's are as follows. I'm running dnu restore on the root of those directories, then running dnu pack on each project individually. When I run the pack, I am building in release configuration, and am using --out so that the four .nupkg files (two regular and two symbol) all end up in a single artifacts directory off the root. At no point in the process am I running dnu build as I don't think its necessary (please correct me if I'm wrong).
@cbeall This is not a general issue, this is an problem with your build process. Specifically this statement:
When I run the pack, I am building in release configuration, and am using --out so that the four .nupkg files (two regular and two symbol) all end up in a single artifacts directory off the root.
Use different output folders and you won't run into this issue.
We use dnu pack to build all of ASP.NET 5 thats sorta why I am aware that this doesn't just happen by default. We would have published packages to NuGet.org with a bunch of crap in them :smile:
As I was writing that my last comment, I was sort of thinking "there is no way this could be happening and nobody has noticed."
That being the case, the symbol problem is probably not important as that likely only happens when you do what I was doing. I appreciate you taking the time to help me out. Thanks.
e577e41302b64777fe7ff88e64a0e6d1f3a7234e