Repository navigation
Improve the Travis build matrix, add Docker - #245
afbjorklund wants to merge 10 commits into
Conversation
|
The startup time isn't the main issue (1 second vs. 25 seconds), but the added complexity. Will improve the docker target, so that one can run a quick travis-compatible test for gcc/clang. |
804fecc to
4b39ecf
Compare
|
Now it should be possible to test locally, also fixed the w64-mingw32 and clang-3.4 targets
The default test will run
|
|
@jrosdahl : what do you think ? (3 bugs, 3 features - but all connected/dependent) |
|
Probably should upgrade clang to version 5.0.0, from http://apt.llvm.org/ ? |
|
The docker image uses dumb-init, so that Ctrl-C still works... The other packages are either from Ubuntu or from LLVM. You can find a pre-built image at: afbjorklund/travis-build You can use this image, if you don't want to build it yourself. $ docker pull afbjorklund/travis-build
$ docker tag afbjorklund/travis-build travis-build |
bdb5683 to
239b102
Compare
jrosdahl
left a comment
There was a problem hiding this comment.
Awesome, thanks!
Just two minor things:
| FROM ubuntu:trusty | ||
|
|
||
| # https://github.com/Yelp/dumb-init | ||
| COPY dumb-init_*.deb . |
There was a problem hiding this comment.
I'm allergic to binaries in source control (and furry animals and pollen). How about using docker run --init ... instead? Do you see any downside with that other than that it requires Docker 1.13.0 or newer?
There was a problem hiding this comment.
We can copy it from the URL, no worries. Just that I didn't have any wget/curl inside of it...
There was a problem hiding this comment.
Sure, that would be fine as well. (But why when run --init exists? 🙂)
|
|
||
| // Clean the cache. | ||
| #ifdef _WIN32 | ||
| cc_log("Before cleanup: %lu KiB, %I64u files", |
There was a problem hiding this comment.
I would prefer casting to unsigned long instead of introducing ifdefs.
There was a problem hiding this comment.
Will it fit ? I suppose we could cast it to float (without decimals) or something, for simplicity
There was a problem hiding this comment.
Doesn't really matter since it's just a debug log message, I'd say. Also, it's extremely unlikely that somebody has a cache with more than 232 files.
There was a problem hiding this comment.
Casting to float means that it will be incorrect after 224 + 1 = 16,777,217 files, which a large cache might contain.
|
@jrosdahl : also, should this be rebased against |
Sounds like a good idea. |
|
Ah, looks like the PR contains the branch - not sure how to change that |
|
Ah, that sounds easy enough! :-) |
Seems like MinGW doesn't have the %z (size_t) printf format So add some %f casting variant, so that it works everywhere.
Run in containers where possible, save the installations for the targets that actually need to do them (currently: mingw and cuda)
Seems like old clang-3.4 didn't have this feature, while the newer MinGW might. So remove the hardcoding, and do the check.
This is not the actual Travis docker container, but it should be similar enough for doing local verification: make travis make travis CC=clang make travis CC=clang CFLAGS="-fsanitize=address -g" ASAN_OPTIONS="detect_leaks=0" make travis CC=i686-w64-mingw32-gcc HOST="--host=i686-w64-mingw32" TEST="unittest/run.exe"
The idea behind this script is to run the same checks as .travis.yml but locally instead. It is not identical, but should be close enough. Note: this does not include any tests for the osx or cuda platforms, only the linux targets - although that does include the mingw build.
We were getting different results when converting "float" to integers, on 32-bit versus 64-bit platforms. So use "roundf". Also exposed a typo in another testsuite, where we only cleaned files as a result of roundoff... Make cleaning explicit again.
Use gcc-multilib rather than doing a full cross-compile. But set the --host, just in case something is listening.
|
Ah, too good to be true... Rebased manually instead. |
|
71b1204's message says
but as far as I can tell it's not converting anything to double. Was that something you intended to do? I'm happy with all changes now except that I think that it would be better to stay in integer land in the above mentioned patch. (Not sure if you saw my previous review comments since you didn't comment on them?) Or at least use doubles instead of floats. |
|
I used "double" (64) at first, but then discovered that ccache was using "float" (32) for everything |
|
Going over to floating point, escaped all the various casts and missing types and sprintfs |
Right, the calculations in question are coerced to float, which is more unintentional than not. I'll make something up. Applied now, thanks! |
Run in containers where possible, save the installations for the
targets that actually need to do them (currently: mingw and cuda)