Conversation
docker/Dockerfile
Outdated
|
|
||
| # RUN apk add build-base | ||
| # TODO: Why is g++ required?! Why does cmake "Check for working CXX compiler"? | ||
| RUN apk --no-cache add gcc g++ make musl-dev |
There was a problem hiding this comment.
Google found https://cmake.org/pipermail/cmake/2010-August/039245.html, but we already call project with just C as the languages in awesomeConfig.cmake...?
Some quick testing suggests that CMakeLists.txt must contain the call to project(). Even if I move it after include(awesomeConfig.cmake) does CMake stop checking for a C++ compiler. Magic?
There was a problem hiding this comment.
Yup, CMake scans CMakeLists.txt for cmake_minimum_required and project early on. If no project is found, it synthesises a PROJECT(Project) command and adds it before the first line.
https://gitlab.kitware.com/cmake/cmake/blob/43c3afa74538fd7b78bcf534bfb3fa93c3c1f191/Source/cmMakefile.cxx#L1442-1458
CMake "fakes" a call to "project(Project C CXX)" if it does not see a project() call in CMakeLists.txt. Since we had this call in a different file, this default applied. This meant that CMake unnecessarily required a C++ compiler. Fix/work-around this by moving the call to project() into CMakeLists.txt Reference: awesomeWM#1907 (comment) Signed-off-by: Uli Schlachter <psychon@znc.in>
CMake "fakes" a call to "project(Project C CXX)" if it does not see a project() call in CMakeLists.txt. Since we had this call in a different file, this default applied. This meant that CMake unnecessarily required a C++ compiler. Fix/work-around this by moving the call to project() into CMakeLists.txt Reference: #1907 (comment) Signed-off-by: Uli Schlachter <psychon@znc.in>
53103d0 to
225ffc4
Compare
Codecov Report
@@ Coverage Diff @@
## master #1907 +/- ##
==========================================
+ Coverage 79.55% 79.72% +0.17%
==========================================
Files 404 404
Lines 27652 27857 +205
Branches 991 999 +8
==========================================
+ Hits 21998 22209 +211
+ Misses 5218 5206 -12
- Partials 436 442 +6
Continue to review full report at Codecov.
|
|
Yay, first (partly) coverage upload succeeded. |
73e98f5 to
fb36f60
Compare
| @@ -0,0 +1,81 @@ | |||
| # Dockerfile for awesomeWM. | |||
There was a problem hiding this comment.
Could you move the Dockerfile into a subdirectory? At some point we might/should have many Dockerfiles for jobs like a PPA upload and older distribution support (executed on a timely base instead of each PR changes).
There was a problem hiding this comment.
It is already in a subdir?!
Inititally I had multiple, e.g. .dep for the base dependencies - might come back to this..
There was a problem hiding this comment.
Yes, but wouldn't another level welcome? I usually see Dockerfile being built with a directory path instead of the Dockerfile absolute path. This allows for image specific assets to be "encapsulated" into the sub directory. Something like:
$BASE_DIR/docker/docker-awesome_coverage/Dockerfile # The current Alpine base
$BASE_DIR/docker/docker-awesome_ppa/Dockerfile # Ubuntu LTS with PPA upload (no build)
$BASE_DIR/docker/docker-awesome_dotdeb/Dockerfile # "make package" for Debian stable and testing
$BASE_DIR/docker/docker-awesome_coverity/Dockerfile # Static analysis
$BASE_DIR/docker/docker-awesome_scanbuild/Dockerfile # Static and dynamic analysis
$BASE_DIR/docker/docker-awesome_bleeding_edge/Dockerfile # Use all the AUR -git / luarocks dependencies to get early breakage warnings.Note that those Dockerfiles can be written over time. I already have a base for the Coverity one (still need to ask for freebies from them. It is usually very expensive, but they it away as long as the code is Free).
There was a problem hiding this comment.
Yes, makes sense, although I'd prefer shorter names.. ;)
I think for now we can have it at the top level though for our main one.
|
What is the best way to pass arguments to |
|
As for caching: we could use the Docker Hub for this in general, i.e. having tagged base images maybe, that could be used by others then, too? |
e8fabb9 to
d427de4
Compare
|
Still at 10mins with the cached Docker image (not optimized for size though): https://travis-ci.org/awesomeWM/awesome/builds/254663200 |
147e7b8 to
1dc6cac
Compare
|
Might be relevant for gcov: https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html (currently running it in Is there a reason why we run two builds with coverage? |
|
btw: I've edited the coveralls settings (https://coveralls.io/github/awesomeWM/awesome/settings) to post comments again (which is only possible globally?!), and also to include branch coverage (what codecov is doing with this PR already). |
Codecov supports tags ("this code was executed by functional tests"). For this to work, we have to delete the coverage files after uploading. However, for coveralls we need an "all in one" coverage file. |
|
@psychon |
|
Okay, good to know. So, should some parts of this be done in separate PRs? For example, moving "all the mess in |
Uhm... why? I like that codecov edits its existing comment instead of posting new ones (well, mostly). |
For debugging/feedback. IIRC I've seen that you could configure it through yml/branch eventually, so I might change that.
Yes, and a lot of the recent build changes originated from here already.
Might be hard, since it is refactored / based on the Docker build already.
Still WIP and also not trivial to "backport" probably.
👍 |
|
The coverage changes (especially for the C code) are coming from covering luajit (Lua 5.1) now only, while we covered Lua 5.2 and 5.3 before. Regarding coveralls: the coverage of C code is new there, so this decreased overall. |
CMake "fakes" a call to "project(Project C CXX)" if it does not see a project() call in CMakeLists.txt. Since we had this call in a different file, this default applied. This meant that CMake unnecessarily required a C++ compiler. Fix/work-around this by moving the call to project() into CMakeLists.txt Reference: awesomeWM#1907 (comment) Signed-off-by: Uli Schlachter <psychon@znc.in>
Conflicts: .travis.yml Makefile
TODO:
Docker Image Caching:
Saves ~6 minutes (13 min 16 sec instead of 19 min 14 sec) for all 4 builds.
Cache can be deleted manually on Travis, or should use e.g. the md5 of the Dockerfile in the image file name.