[cmake] check for internet connection. Fixes #8292#8520
[cmake] check for internet connection. Fixes #8292#8520bellenot merged 10 commits intoroot-project:masterfrom
Conversation
This should fix an issue with external packages requiring an internet connection when working offline. If there is no internet connection, they are either automatically disabled or raise a `FATAL_ERROR` if the `fail-on-missing` flag is `ON`
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests:
|
| message(FATAL_ERROR "No internet connection. Please check your connection, or either disable the 'builtin_gsl' option or the 'fail-on-missing' to automatically disable options requiring internet access") | ||
| else() | ||
| message(STATUS "No internet connection, disabling 'builtin_gsl' option") | ||
| set(builtin_gsl OFF CACHE BOOL "Disabled because there no internet connection" FORCE) |
There was a problem hiding this comment.
I think "is" is missing; one should read "Disabled because there is no internet connection"
The same for all the other messages.
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests:
|
|
@oshadura Well, then I would have to really download a file (that's the only way to get |
|
|
||
| #---Check for GSL library--------------------------------------------------------------- | ||
| if(mathmore OR builtin_gsl) | ||
| if(builtin_gsl AND NO_CONNECTION) |
There was a problem hiding this comment.
humm ... we might be missing support for the following scenario:
- download and configure (and possibly build once) on a node that has network access
- re-configure on the same build directory but from a node that had no network access.
This scenario should be supported as it is a means to download and build on a non-network accessible node.
I.e. we might also need to check whether the buitin has already been download before failing.
There was a problem hiding this comment.
Thanks @pcanal for the nice suggestion. i also thought that our CMake system was not complex enough... I'll try to come with something. I already spent several days with the dependencies hell, I can spend several more to try all possible combinations 😉
There was a problem hiding this comment.
@pcanal is there documentation somewhere that would explain how to do what you talk about? I may be interested by such option in some cases.
PS: I can start a message on the ROOT forum not to pollute Github with this discussion.
There was a problem hiding this comment.
@pcanal I think it's fine to not support this until there is demand, and keep the build system simpler. If people need to build without network we can always ask them to not use builtins. We also have way more important things to work on than a hypothetical corner case of a rare build context...
There was a problem hiding this comment.
is there documentation somewhere that would explain how to do what you talk about? I
Not really. It is just: 'on machine that has access to the internet on the disk you need to build on, do a git clone and then a configuration. In some cases that is sufficient and you can continue the build on a machine that has no access to the internet, sometimes you need to do a first (successully) build on the machine with internet access.
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/default. Failing tests: |
CMakeLists.txt
Outdated
|
|
||
| #---Try to download a dummy (non-existing) file to check internet connection-------------------- | ||
| file(DOWNLOAD https://root.cern/files/dummy.txt ${CMAKE_CURRENT_BINARY_DIR}/dummy.txt | ||
| TIMEOUT 100 STATUS DOWNLOAD_STATUS |
There was a problem hiding this comment.
Is that 100 seconds? I think 10 is enough :-) People might get seriously worried if their CMake just sits there for two minutes. It might also be nice to show
message(STATUS "Checking internet connectivity...")
...
if(...)
message(STATUS "Yes")
else()
message(STATUS "No: will not automatically download external dependencies")
endif()
There was a problem hiding this comment.
@Axel-Naumann :wow: you're right, sorry, I would say that even 3 seconds would be enough... And I will add the messages, thanks for the suggestion
|
Starting build on |
|
Starting build on |
|
Starting build on |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Errors:
Failing tests: |
…project#8520) * [cmake] check for internet connection. Fixes root-project#8292 This should fix an issue with external packages requiring an internet connection when working offline. If there is no internet connection, they are either automatically disabled or raise a `FATAL_ERROR` if the `fail-on-missing` flag is `ON` * Add forgotten "is" (thanks @pamputt) * Add internet check for the forgotten 'davix' and 'ssl' options * Change the timeout value and add information messages (thanks Axel) * Let's download an existing file to test internet access * Disable also clad if there is no internet connection * Do not add the clad directory in case of no internet access * Change the logic for clad with no internet connection * disable clad early enough if there is no internet connection * Disable also xrootd when disabling builtin_xrootd
This should fix an issue with external packages requiring an internet connection when working offline.
If there is no internet connection, they are either automatically disabled or raise a
FATAL_ERRORif thefail-on-missingflag isON