Diagnosing NuGet Dependency Conflicts
摘要
Developers usually suffer from dependency conflict (DC) issues, i.e., package dependency constraints are violated when a project’s platform or dependencies are changed. This problem is especially serious in .NET ecosystem due to its fragmented platforms (e.g., .NET Framework, .NET Core, and .NET Standard). Fixing DC issues is challenging due to the complexity of dependency constraints: Multiple DC issues often occur in one project, solving one DC issue usually causes another DC issue cropping up, and the exponential search space of possible dependency combinations is also a barrier. In this chapter, we aim to help .NET developers tackle the DC issues. First, we empirically studied a set of real DC issues, learning their common fixing strategies and developers’ preferences in adopting these strategies. Based on these findings, we propose NuFix, an automated technique to repair DC issues. NuFix formulates the repair task as a binary integer linear optimization problem to effectively derive an optimal fix in line with the learnt developers’ preferences. The experiment results and expert validation show that NuFix can generate high-quality fixes for all the DC issues with 262 popular .NET projects. Encouragingly, 20 projects (including affected projects such as Dropbox) have approved and merged our generated fixes and shown great interests in our technique.