Changes between Version 9 and Version 10 of Ticket #170


Ignore:
Timestamp:
09/03/2014 01:19:50 PM (5 years ago)
Author:
trev
Comment:

Modified the description as per discussion in review: the script should be called ensure_dependencies.py and the corresponding file dependencies (was: ensureDeps.py and .sub).

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #170 – Description

    v9 v10  
    1818Here is what I think can work: 
    1919 
    20  * Each repository contains a .sub file formatted like this: 
     20 * Each repository contains a `dependencies` file formatted like this: 
    2121{{{  
    2222_root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/ 
    23 _self = buildtools/ensureDeps.py 
     23_self = buildtools/ensure_dependencies.py 
    2424buildtools = buildtools 1.0.5 
    2525third_party/googletest = googletest hg:bd26b148913a git:0476e154db5f 
    2626}}} 
    27 * There is an `ensureDeps.py` script in these repositories that does the following when executed: 
    28   * Parse `.sub` file to extract the list of subrepositories. 
     27* There is an `ensure_dependencies.py` script in these repositories that does the following when executed: 
     28  * Parse `dependencies` file to extract the list of subrepositories. 
    2929  * For each subrepository check whether the corresponding directory already exists. 
    30   * If the directory doesn't exist then clone the subrepository there. To determine the repository path, first get the repository path for the current directory (either Mercurial or Git) and assume that the subrepository is available under the same address. If finding repository path fails or cloning from that URL doesn't work, use the fallback root URL specified in .sub file. 
     30  * If the directory doesn't exist then clone the subrepository there. To determine the repository path, first get the repository path for the current directory (either Mercurial or Git) and assume that the subrepository is available under the same address. If finding repository path fails or cloning from that URL doesn't work, use the fallback root URL specified in `dependencies` file. 
    3131  * If the directory exists and is neither a Mercurial nor a Git repository - assume that it is the correct revision. Otherwise try to update it to the specified tag/revision. 
    3232  * If the update fails (no such tag/revision) - pull the repository and try again. If it still fails - report failure. 
    33   * Recurse into all subrepositories to process the `.sub` file there as well. 
    34   * If the `_self` setting is present: verify that `ensureDeps.py` version running is identical to the one references. If not, replace and re-run it. 
    35  * Make `build.py` call `ensureDeps.py` as the very first thing and fail if `ensureDeps.py` fails. We can also integrate this call into the other build systems or at least document in `README.md` that it needs to be performed. 
     33  * Recurse into all subrepositories to process the `dependencies` file there as well. 
     34  * If the `_self` setting is present: verify that `ensure_dependencies.py` version running is identical to the one references. If not, replace and re-run it. 
     35 * Make `build.py` call `ensure_dependencies.py` as the very first thing and fail if `ensure_dependencies.py` fails. We can also integrate this call into the other build systems or at least document in `README.md` that it needs to be performed. 
    3636 
    3737Downsides of this approach: 
    3838 
    39  * We will have a non-trivial script that needs to be copied into all repositories - this is exactly what I meant to avoid when I created the buildtools repository and made build.py in the actual repositories a trivial dummy. Let's hope that we won't need to change ensureDeps.py often. 
    40  * Changing versions in .sub file needs to happen manually, Mercurial will no longer take care of that if you simply update the subrepository. Also, it will make testing your changes a bit more complicated - once you commit your changes to a subrepository you need to update the .sub file (using tip as subrepo revision is probably the best approach during development). 
     39 * We will have a non-trivial script that needs to be copied into all repositories - this is exactly what I meant to avoid when I created the buildtools repository and made build.py in the actual repositories a trivial dummy. Let's hope that we won't need to change `ensure_dependencies.py` often. 
     40 * Changing versions in `dependencies` file needs to happen manually, Mercurial will no longer take care of that if you simply update the subrepository. Also, it will make testing your changes a bit more complicated - once you commit your changes to a subrepository you need to update the `dependencies` file (using tip as subrepo revision is probably the best approach during development). 
    4141 * Everybody has to remember to push changes to a subrepository before changing the dependency - this will no longer happen automatically. Failing to do so will mean that builds will no longer work for everybody else (should hopefully be a rare case that is easily repaired). 
    4242 * We either have to tag all relevant revisions in our subrepositories so that we can refer to them or use two different revisions: one for Mercurial and one for Git.