Opened on 10/07/2016 at 10:45:49 AM
Closed on 08/30/2019 at 04:36:25 PM
#4503 closed defect (rejected)
ensure_dependencies.py fails for git submodule
| Reported by: | asmirnov | Assignee: | asmirnov | 
|---|---|---|---|
| Priority: | P4 | Milestone: | |
| Module: | Automation | Keywords: | |
| Cc: | fhd, sebastian, kvas | Blocked By: | |
| Blocking: | Platform: | Unknown / Cross platform | |
| Ready: | yes | Confidential: | no | 
| Tester: | Unknown | Verified working: | no | 
| Review URL(s): | 
https://codereview.adblockplus.org/29356341/ | ||
Description (last modified by trev)
Background
ensure_dependencies.py script is used to extract required dependencies from git/mercurial repositories. However, it currently fails when running within a git submodule. This is a problem for 3rd-party projects integrating libadblockplus-android as a submodule of their git repository.
How to reproduce
Run the following commands:
- git submodule add https://github.com/4ntoine/libadblockplus-android.git
- cd ./libadblockplus-android
- ./ensure_dependencies.py
Observed behaviour
An error is thrown:
INFO: Cloning repository https://github.com/adblockplus/libadblockplus-binaries into ./libadblockplus-android/jni/libadblockplus-binaries
Traceback (most recent call last):
  File "./ensure_dependencies.py", line 299, in <module>
    resolve_deps(repo)
  File "./ensure_dependencies.py", line 245, in resolve_deps
    ensure_repo(repodir, target, config.get("_root", {}), revisions["_source"])
  File "./ensure_dependencies.py", line 200, in ensure_repo
    repo.ignore(target, parentrepo)
  File "./ensure_dependencies.py", line 105, in ignore
    _ensure_line_exists(exclude_file, module)
  File "./ensure_dependencies.py", line 275, in _ensure_line_exists
    with open(path, 'a+') as f:
IOError: [Errno 20] Not a directory: './.git/info/exclude'
Expected behaviour
Dependencies for libadblockplus-android are fetched correctly.
What to change
Git submodules don't have their own .git/info/exclude file, ensure_dependencies.py should modify the file for the parent directory instead.
Attachments (0)
Change History (9)
comment:1 Changed on 10/07/2016 at 11:55:18 AM by asmirnov
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:2 Changed on 10/11/2016 at 10:30:52 AM by fhd
- Cc sebastian added
comment:3 Changed on 10/11/2016 at 10:47:27 AM by sebastian
- Cc trev kvas added
- Priority changed from Unknown to P4
comment:4 Changed on 10/11/2016 at 02:12:00 PM by trev
- Component changed from Libadblockplus-Android to Build-and-Release-Tools
- Description modified (diff)
- Ready unset
comment:5 Changed on 10/11/2016 at 02:23:24 PM by sebastian
- Ready set
comment:7 Changed on 12/21/2017 at 11:29:03 AM by fhd
- Cc trev removed
comment:8 Changed on 08/29/2019 at 05:12:26 PM by sebastian
Is this still relevant? We plan to discontinue buildtools and ensure_dependencies.py. With the move towards GitLab, we will eventually switch to Git Submodules.
comment:9 Changed on 08/30/2019 at 04:36:25 PM by sebastian
- Resolution set to rejected
- Status changed from reviewing to closed


ensure_dependencies.py is part of our buildtools repository, so the correct component is Build-and-Release-Tools. I've also modified the description to make it more clear - initially I misunderstood what is being proposed here.