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

Allow to use only modules from direct dependencies #464

Open
awvwgk opened this issue Apr 26, 2021 · 2 comments
Open

Allow to use only modules from direct dependencies #464

awvwgk opened this issue Apr 26, 2021 · 2 comments

Comments

@awvwgk
Copy link
Member

awvwgk commented Apr 26, 2021

Currently all modules of all dependencies are visible to all projects in the dependency tree. Depending by accident on a module of a transient dependency is not an error but could break the build if the dependency tree changes and the module or the transient dependency is removed upstream. Selectively hiding/including modules would also provide a mechanism to cope with name clashes for unrelated modules with the same name.

Requires #355

@LKedward
Copy link
Member

Selectively hiding/including modules would also provide a mechanism to cope with name clashes for unrelated modules with the same name.

How would this work? Surely you could still end up with symbol clashes?

@awvwgk
Copy link
Member Author

awvwgk commented Apr 26, 2021

Unless the two modules don't specify the same function names there won't be a symbol clash.

One mechanism could be to have separate module directories for each subproject like in this tree:

build
└── gfortran_2A42023B310FA28D
    ├── dep-1
    │   └── lib
    │       └── wrapper.mod
    ├── dep-1-dep
    │   └── lib
    │       └── utils.mod
    ├── dep-2
    │   └── lib
    │       └── m_dep.mod
    └── main-proj
        ├── app
        │   ├── main-exe
        │   │   └── utils.mod
        │   └── helper-exe
        │       └── utils.mod
        └── lib
            └── main.mod

I think this is mainly useful for executable, test or example targets where multiple targets might define modules with the same name. But could also be used to hide dependencies with problematic module names behind a simple reexport wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants