ad-freiburg / qlever

Very fast SPARQL Engine, which can handle very large knowledge graphs like the complete Wikidata, offers context-sensitive autocompletion for SPARQL queries, and allows combination with text search. It's faster than engines like Blazegraph or Virtuoso, especially for queries involving large result sets.
Apache License 2.0
417 stars 52 forks source link

Link `CompilationInfo` only to `ServerMain` and `IndexBuilderMain` #1497

Closed joka921 closed 2 months ago

joka921 commented 2 months ago

Since #734, QLever uses cmake magic to generate a file CompilationInfo.cpp with information about the commit hash of the current code and the compilation date. This information was then linked to each binary that uses the Index class, which includes ServerMain and IndexBuilderMain as well as most of the test binaries. As a result, re-compilation took rather long even for minor code changes, which is annoying during development.

This is now fixed by only linking this information only to ServerMain and IndexBuilderMain. All other binaries get some default values, which is fine because they don't need this information anyway.

RobinTF commented 2 months ago

What's the benefit of this vs using the cmake flag DONT_UPDATE_COMPILATION_INFO?

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.14%. Comparing base (691439c) to head (b3e3f3c). Report is 3 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1497 +/- ## ========================================== - Coverage 94.15% 94.14% -0.02% ========================================== Files 347 347 Lines 25631 25633 +2 Branches 3446 3446 ========================================== - Hits 24134 24132 -2 - Misses 1455 1459 +4 Partials 42 42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
2 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

joka921 commented 2 months ago

@RobinTF The DDONT_UPDATE_COMPILATION_INFO flag has several disadvantages:

  1. You have to manually set it for every new configuration, and I have a lot of them (several compilers, Debug/Release/RelWithDebInfo, Sanitizers, whatever QLeverspecific configuration we might have).
  2. For each configuration you have to first run CMake once without the flag (so you actually have the .cpp file) and only then set the flag. This is annoying.
  3. You have to tell every new developer about this mechanism. This in particular holds with students who don't have that much experience with lowlevel CMake stuff.

In summary I think that my approach makes everyone happy using the default configuration.