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

Fix versioned dependencies being removed during clone #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 29, 2020

  1. Fix versioned dependencies being removed during clone

    If both a "versioned" and "non-versioned" version of a dependency
    exists in vendor.conf, the "longest" path should be cloned last,
    otherwise the versioned dependency may be deleted when cloning its
    non-versioned variant.
    
    For example, with the following vendor.conf:
    
        github.com/coreos/go-systemd/v22 v22.0.0
        github.com/coreos/go-systemd     v17
    
    Running vndr would;
    
    1. recursively delete "vendor/src/github.com/coreos/go-systemd/v22:
    2. start cloning "github.com/coreos/go-systemd/v22"
    3. recursively delete "vendor/src/github.com/coreos/go-systemd"
    4. start cloning "github.com/coreos/go-systemd"
    
    This would lead to a conflicting situation; step 3. will remove
    the dependency that was previously cloned (or in the process
    of being cloned).
    
    This patch sorts the dependencies by import-path, cloning the
    shortest import paths first, which should prevent the race condition.
    
    Signed-off-by: Sebastiaan van Stijn <[email protected]>
    thaJeztah committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    fa6289f View commit details
    Browse the repository at this point in the history