-
Notifications
You must be signed in to change notification settings - Fork 525
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
paket pack and developmentDependency: Fail on Linux (works on Windows) #3723
Comments
can you please upload a small zip which I can use as test case? |
@forki please find the attached zip. You may need to The actual |
there is not lock file in the zip |
True. I ripped it off because it contained URL of internal feeds. I thought it would be easier/safer to recreate it with a |
We now see the issue also on some windows machines building .NET Framework projects. Using the very same paket.exe (an older v5.181.1) and the very same source code, some windows-10 machines show this issue while others give reproducible good results. Maybe Paket relies on some undefined behaviour of some system/framework libs... I'll investigate the differences of the win10 installations. |
Root cause of the defect (explanation considers the project provided by @jbaehr and the code references are w.r.t commit a891adc on Paket master): Upon firing paket pack, Paket does the following:
Potential Fix:
I would be happy to take up suggestions on other potential solutions that are not listed here, but for now I am happy to contribute a PR with solution 3. |
Thanks to the work of @ruhullahshah this issue was not observed on Windows any more. On Linux however, when building in a fresh docker container (debian with SDK 3.1.301 from here https://hub.docker.com/_/microsoft-dotnet-core-sdk) it is still reproducible with Paket-5.247.4. |
Unfortunately, the issue still exists on Linux, lastly tried with Paket-5.257.0 |
Description
tl;dr;
paket pack
handles development depencencies correctly (aka not placing it in the resulting dependency list) on Windows, but fails so on Linux (i.e. does add dependencies on development dependencies).I have a library targeting netstandard20, developed using .NET Core SDK 2.2.
I'm using a
paket.template
, type project, to create the nupkg viapaket pack
. Using paket v5.219.0, installed as a local dotnet tool.The library depends on some other nugets, two of them being "development dependencies" (marked with
<developmentDependency>true</developmentDependency>
in their nuspec).Running
paket pack
on a Windows 10 workstation results in a nupkg that does not have those development dependency nugets listed in its nuspec, as expected.Running the very same command, using the very same version of paket, on a Linux CI server, running Microsoft's official SDK-2.2 docker image, paket generates a nuspec that does have those dependencies listed.
Repro steps
(paket bootstrapping as in #3623 (comment))
paket-issue-3723.zip
On Windows:
results in a correct nuget.
On Linux
results in a nuget falsely depending on the development dependencies, too.
(And having only
\n
as line separator, opposed to the\r\n
in the windows-created nuget, but that's the only difference when diffing the two packages and doesn't matter at all)Expected behavior
Running
paket pack
on Linux should honor the development dependencies correctly, just like it's doing already on Windows.Actual behavior
On Linux,
paket pack
adds wrongly dependencies to development-only dependencies.Known workarounds
Use
excludeddependencies
in the templates and list all development dependencies explicitly. -- This defeats the whole purpose of havingdevelopmentDependency
, though.I haven't checked
dotnet pack
on Linux, as on Windows it does not handle development dependencies (see #2370). In addition,dotnet pack
reads the package version from thePackageVersion
msbuild property whilepaket pack
(with type project) infers it from theAssemblyInformationalVersion
attribute, which fits better for us.The text was updated successfully, but these errors were encountered: