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

Unable to remove dangling dependency #1596

Closed
theimowski opened this issue Apr 12, 2016 · 5 comments
Closed

Unable to remove dangling dependency #1596

theimowski opened this issue Apr 12, 2016 · 5 comments
Labels

Comments

@theimowski
Copy link
Member

Description

Unable to remove dangling dependency - NuGet.CommandLine is defined in paket.dependencies, but not used by any paket.references

Repro steps

  1. checkout theimowski/suave@8dd7d74
  2. run paket.exe -v remove nuget NuGet.CommandLine group Build

Expected behavior

NuGet.CommandLine should be removed from paket.dependencies

Actual behavior

C:\github\suave (merge_nupkgs)
λ tools\paket.exe -v remove nuget NuGet.CommandLine group Build
Paket version 2.58.14.0
found: C:\github\suave\paket.dependencies
Paket failed with:
        The given key was not present in the dictionary.
StackTrace:
     at Microsoft.FSharp.Collections.MapTreeModule.find[TValue,a](IComparer`1 comparer, TValue k, MapTree`2 m)
   at Paket.ProjectFileModule.hasPackageInstalled(GroupName groupName, PackageName package, ProjectFile project)
   at Paket.RemoveProcess.removeFromProjects@73(PackageName packageName, Boolean interactive, GroupName groupName, IEnumerable`1 projects)
   at [email protected](ProjectFile[] arg00)
   at Paket.RemoveProcess.remove(FSharpFunc`2 removeFromProjects, String dependenciesFileName, GroupName groupName, PackageName package, Boolean force, Boolean hard, Boolean installAfter)
   at <StartupCode$Paket-Core>[email protected](Unit unitVar0)
   at Paket.Utils.RunInLockedAccessMode[a](String rootFolder, FSharpFunc`2 action)
   at [email protected](ParseResults`1 results)
   at Paket.Program.processWithValidation[T](FSharpFunc`2 validateF, FSharpFunc`2 commandF, Command command, String[] args)
   at [email protected](Command command, String[] args)
   at Paket.Program.main()

Known workarounds

One can remove the dependency from paket.dependencies manually - however I'm not sure, what command should I invoke afterwards to update paket.lock, so that other dependencies are not modified?

theimowski added a commit to theimowski/suave that referenced this issue Apr 12, 2016
@forki forki closed this as completed in 34c9217 Apr 12, 2016
@forki forki added the bug label Apr 12, 2016
@forki
Copy link
Member

forki commented Apr 12, 2016

Bug is fixed.

One can remove the dependency from paket.dependencies manually - however I'm not sure, what command should I invoke afterwards to update paket.lock, so that other dependencies are not modified?

"paket install"

@theimowski
Copy link
Member Author

Thanks. With Paket 2.59.0 this is result of running paket remove nuget NuGet.CommandLine group Build: theimowski/suave@6cadb6d - is this desired behavior that dependencies have been updated?

@forki
Copy link
Member

forki commented Apr 12, 2016

yes it's running install and is detecting a change. maybe we should restrict install to the touched group

@theimowski
Copy link
Member Author

ok my fault - I've missed the --no-install switch. Re restricting install to the group only - probably a minor "nice to have". However there's one thing, which could deserve its own issue: the dependency was the only one in this group - after running the command, group got orphaned (see here)

@forki
Copy link
Member

forki commented Apr 12, 2016

yes please create 2 new issues ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants