Skip to content

Unused configuration dependencies still evaluated #904

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

Closed
rjmcguire opened this issue Jul 26, 2016 · 3 comments
Closed

Unused configuration dependencies still evaluated #904

rjmcguire opened this issue Jul 26, 2016 · 3 comments

Comments

@rjmcguire
Copy link

rjmcguire commented Jul 26, 2016

When I try compile a project that depends on a project with the below configurations the "api-server" "onyx-config" dependency is still evaluated and is shown as missing. If I remove the configuration "api-server" then my project that depends on this library compiles fine. Would be great if dub could just avoid evaluating the unused configuration.

configuration "default" {
    targetType "library"
    excludedSourceFiles "source/main.d" "source/config.d"
}
configuration "api-server" {
    targetType "executable"
    dependency "onyx-config" path="onyx-config-2.0.3"
}
@ghost91-
Copy link

ghost91- commented May 3, 2018

In my opinion, this is a really big problem, because it also applies to dependencies. For example, if my project has requests as dependency (with the default configuration, which is called std and has no dependencies at all), it will still pull in all of vibe.d, because requests also has a configuration, which has vibe.d as a dependency. Granted, it will not be compiled in, but even downloading is not neccessary.

This is a big problem in memory constrained areas. And just today while talking to somebody at dcond, I found out that it also prevents wider adoption of D by businesses because it creates problems with compliance processes and so on (you have to check all downloaded dependencies, even if they are not used...).

#1148 Seems to be a bit related to this, but I think it is still a different issue. Does anybody have an idea how to tackle this?

@ghost91-
Copy link

ghost91- commented May 3, 2018

I just found another annoying problem with this: If a dependency of your package hard dependes (==) on a certain version of another package in one of its configurations and your package also depends on that same dependency, but in a version that is not compatible (e.g. a newer one), the dependencies can not be satisfied.

The concrete example is the following: My project depends on mysql-native which has the dependency
dependency "unit-threaded" version="==0.7.37"
in its unittest-vibe-ut configuration. My project also depends on unit-threaded and I would like to upgrade it to more recent versions (the most recent one is 0.7.45). However, this is not possible, because even though the unittest-vibe-ut configuration of mysql-native is never actually built, it still gets considered for dependency resolution.

@Geod24
Copy link
Member

Geod24 commented Jan 2, 2020

Duplicate of #1706

Well, really, #1706 is the duplicate, but it also has more discussions, so this issue instead.

@Geod24 Geod24 closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants