You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/04/19 23:43:04 UTC

[GitHub] [mynewt-newt] ccollins476ad opened a new pull request #291: newt upgrade: Repo dep reqs not always honored

ccollins476ad opened a new pull request #291:  newt upgrade: Repo dep reqs not always honored 
URL: https://github.com/apache/mynewt-newt/pull/291
 
 
   This is a bug fix for the `newt upgrade` command.  The problem is difficult to describe.  Here is a concrete example (`project.yml`):
   
   ```
   repository.apache-mynewt-core:
       type: git
       vers: 0.0.0
       url: 'git@github.com:apache/mynewt-core.git'
   repository.apache-mynewt-nimble:
       type: git
       vers: 1.0.0
       url: 'git@github.com:apache/mynewt-nimble.git'
   ```
   
   Attempting to upgrade this project should fail, because `apache-mynewt-core`,0.0.0 depends on `apache-mynewt-nimble`,1.1.0.  This dependency conflicts with the `apache-mynewt-nimble`,1.0.0 entry in `project.yml`.  But here is the output I get:
   
   ```
   [ccollins@ccollins:~/proj/myproj]$ newt upgrade
   Skipping "apache-mynewt-core": already upgraded (0.0.0)
   ```
   
   The conflict is not reported, and `apache-mynewt-nimble` isn't even included in the output.
   
   newt uses the following procedure to detect repo dependency conflicts:
   
   1. Generate a "matrix" of all repos on one axis, and all version numbers on the other axis.
   2. Prune entries from the matrix that fail to satisfy at least one dependency requirement.
   3. For each repo in the matrix, check if at least one of its version numbers satisfies *every* dependency requirement.
   
   If step three fails for a particular repo, a conflict is reported for that repo.
   
   The problem arises when a repo is partially or entirely pruned from the matrix.  When newt checks if version V of repo R is allowed, it is problematic if that version has been pruned.  Due to Go's default initialization semantics, newt infers that version 0.0.0 of R is allowed, even if it is not!  

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services