header-only / inglued

#inglued <> : simplified c++ dependencies. Superseeded by nxxm : https://nxxm.github.io
Boost Software License 1.0
8 stars 3 forks source link

Provide a way to filter which sources interests us in deps/inglued. #4

Open daminetreg opened 7 years ago

daminetreg commented 7 years ago

Adding non-inglued non-boost dependency-free library lead to adding dependencies of test folders and more as well.

Taking exactly this commit : https://github.com/cpp-pre/type_traits/commit/99ac36769fb0ee4fc48f76ff6557de3ee325a6c4 of cpp-pre::type_traits which is dependency free.

And therefore shouldn't require a deps/inglued file, lead to a crash of inglued, as it tries to discover the dependencies in the test/ folder.

If you add :

{
  "boostorg/preprocessor" : { "@" : "boost-1.62.0", "-I" : "include/" }
  , "cpp-pre/type_traits" : { "@" : "v2.0.0" }
}

The result of inglued seal is disappointing :

inglued seal
Fetching and glueing in your git repository direct dependencies:
         fetching boostorg/preprocessor... ok.
         fetching cpp-pre/type_traits... ok.

Fetching and glueing in your git repository transitive dependencies:
...
scanning non-#inglued <> dependency : boostorg/preprocessor... ok.
...
scanning non-#inglued <> dependency : cpp-pre/type_traits... ok.
         fetching boostorg/test...terminate called after throwing an instance of 'std::runtime_error'
  what():  Cannot add the dependency, your working tree must not have changes to already commited files. Output is : 
 git fetch https://github.com/boostorg/test.git v2.0.0
fatal: Couldn't find remote ref v2.0.0

Aborted (core dumped)

The error is actually in the boostorg adapter which is triggered, while it shouldn't and tries to find a version of boost test that doesn't exists, as the boostorg adapter was meant to be triggered to look for boost libraries.

Because it scans not only the library sources but also the units tests test/ folder.

Workaround

Add a deps/inglued file to the cpp-pre/type_traits library to declare the dependency-free'ness :

{}

Which allows everything to work, up to a disturbing point : the resulting cmake installs the test/ folder in the include/ of the sysroot. So we definitely need a way to filter out non-deps-sources.