Skip to content

Use a single symlinked Modules directory for app and contained modules #17

@johnclayton

Description

@johnclayton

When you have a directory of frameworks that you are actively working on that use modulo in module mode, initializing & updating a module project that uses any of its siblings will move the git head of those siblings to the version specified in whatever module you just ran this operation on. Not really what you want when these are under active development:

Projects/ 
  - ModuleA <-- Checked out to 1.0 instead of the working branch, maybe you didn't even realized this happened 🚫
  - ModuleB  (uses ../Module A version 1.0)

This can be worked around manually by just creating another layer of directories in the file system:

Projects/ 
  - ModuleA <-- Checked out to 1.0 instead of a branch
  - ModuleB  
    - ModuleA <-- version 1.0
    - ModuleB (uses ../Module A version 1.0)

Using app mode partially solves the issue by coalescing dependencies into the Modules subdir, but then I think you can end up with multiple copies of modules in an app project—the ones the app is using in its Module dir and then under that each module having another Module dir:

MyApp/
  - Modules/
    - ModuleB <-- version 2.0
    - ModuleA
      - Modules
        - ModuleB <-- version 1.0

I think we could take a cue from Carthage to solve this. It keeps one Carthage dir at the top of the working copy for checkouts (and eventually builds, which we can ignore in this discussion) and symlinks the Carthage dirs for included dependencies to that single directory so that there is only ever one copy of a dependency:

MyApp/
  - Modules/
    - ModuleB <-- version 2.0
    - ModuleA
      - Modules --> (../../Modules)
        - ModuleB <-- version 2.0 (if it wants version 1.0 we have a version conflict)

You can end up with version conflicts this way, if different modules want different versions of a sibling. But if I recall what @bsneed said correctly, version conflict detection is currently supported. And in the end, you can only link one version of a module anyway so this would have to be resolved by the operator either way.

P.S.

I guess this also makes --module mode something uncommon, maybe just for special situations, so doing this might also include removing the --app mode and just making it the default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions