conan-io / cmake-conan

CMake wrapper for conan C and C++ package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[develop2] how to skip conan install check

pwqbot opened this issue · comments

commented

At present, any action that triggers a CMake configure, such as modifying a CMake file or adding/deleting source files, prompts Conan to run an install check. How can I skip this Conan install step if all packages are already installed?

commented

Hi @pwqbot

This is because if something changes in CMake, it is possible that it is necessary to install the dependencies, new binaries or whatever. It is impossible to know, so a conan install is executed. If nothing changed, it should be almost instantaneous, so it shouldn't be an issue at all. Are you experiencing any problem with it?

commented

Hi @pwqbot

This is because if something changes in CMake, it is possible that it is necessary to install the dependencies, new binaries or whatever. It is impossible to know, so a conan install is executed. If nothing changed, it should be almost instantaneous, so it shouldn't be an issue at all. Are you experiencing any problem with it?

@memsharded
When leveraging local cache, the execution time of 'conan install' usually falls between 3 to 4 seconds, provided optimal conditions. However, on certain machines, this process may extend to approximately 15 seconds, potentially influenced by network conditions. The most time-consuming stage is the process of 'Computing necessary packages', where compatible packages are calculated each time, yielding a lengthy output as shown below:

fmt/10.0.0: Checking 9 compatible configurations:
fmt/10.0.0: 'b7cba253d7163c0988e6f8000e44cbbbe1259b33': compiler.cppstd=11
fmt/10.0.0: '74ca830e369587995d28504d4ad82dca59a0c175': compiler.cppstd=gnu11
fmt/10.0.0: '9f7246e0309b40ab5a4fc18bd54802509e8d9105': compiler.cppstd=14
fmt/10.0.0: '705ece7e7951fad7b8099d9a9d3286ac2caa6ac5': compiler.cppstd=gnu14
fmt/10.0.0: 'fff32c57cbcbb70f4d546c33904c9828d99a16d2': compiler.cppstd=17
fmt/10.0.0: '1a29cf55628ab2767389ea6d1e9baf336451fecb': compiler.cppstd=gnu17
fmt/10.0.0: '63af6ee69fad875bba443c3d8aa889e390887860': compiler.cppstd=20
fmt/10.0.0: 'bb6204c6f743b763a034d8fd584d51e92147a7b8': compiler.cppstd=gnu20
fmt/10.0.0: '6fa3dba106c4c1f7dd0fbb9ace94f3f048eafc77': compiler.cppstd=gnu23
fmt/10.0.0: Main binary package '88c1f250047d89498f19f82c4fb864987eedaa82' missing. Using compatible package '6fa3dba106c4c1f7dd0fbb9ace94f3f048eafc77'
gtest/1.13.0: Checking 7 compatible configurations:
gtest/1.13.0: '32eaedba99be7402ebb309e988e994a1121dc284': compiler.cppstd=14
gtest/1.13.0: 'd1db51e8299af9981a3c59a38d1894fc5d152614': compiler.cppstd=gnu14
gtest/1.13.0: 'e0ff83304c3169a3575d1f63415f560d240ab45a': compiler.cppstd=17
gtest/1.13.0: '489166b3d817ed6c57220b57907623311e099d8a': compiler.cppstd=gnu17
gtest/1.13.0: '7d82c9cdac3ca49c4152338e8a7dc201fc5fd1b8': compiler.cppstd=20
gtest/1.13.0: '4364c35eab95e66b531e8b3722bd6498cd460e39': compiler.cppstd=gnu20
gtest/1.13.0: 'd5a0a2daae8151fad6a5dfc5a2dc2f7b42620697': compiler.cppstd=gnu23
gtest/1.13.0: Main binary package '2d8ad73e11d9fdd52609588cdb0990d56778c96a' missing. Using compatible package 'd5a0a2daae8151fad6a5dfc5a2dc2f7b42620697'
......

Moreover, if I disable the remote server and subsequently reconfigure CMake, the ensuing 'conan install' execution will prompt for certain build requirements to be built rather than fetched from cache.

Requirements
    concurrentqueue/1.0.4#957c470e9abc81ff3850bbe39fc11135:da39a3ee5e6b4b0d3255bfef95601890afd80709#d76553f653b5b8bdf7b424d83820fea4 - Cache
    fmt/10.0.0#6315a972585c98a8373c2412c4ae85b3:03b4273f14bc5045ab76e0baaa3e5dcd3aad2883#12bedbb67d5c13bc991ee594c4ad0902 - Cache
    glaze/1.3.2#35c5410aafd87adebe75b3a1511a0cfd:da39a3ee5e6b4b0d3255bfef95601890afd80709#5efd705f12a7270ca4bb60b089fcb847 - Cache
    gmp/6.2.1#7101d47541082a1788a31e0b99e7247c:311e04110e37a60454cbef95eecb0067c3c7b0c2#5a2e3f77515f8baeaeeecfed1e896ec3 - Cache
    gtest/1.13.0#02a1bd0db3c2d4dbd6c9398d3e1e2533:119f3255ecb79f0e058f50f3eeb675872fc30595#ffd245ef6036d8368a60709f69ddfb03 - Cache
    hdf5/1.14.0#466c792e3636063441fc8fb2e38bcda1:552aa1b805f1ccc1e6fdf0eaf85a78edde31950b#a7cedcc0a6e223ab03e189430aa3532a - Cache
    highfive/2.7.1#4fa3f1e92a482553fed4568e122084be:da39a3ee5e6b4b0d3255bfef95601890afd80709#14d1dcd3361ddce75d6395c02290e0f0 - Cache
    libcurl/8.1.2#7bfe34d08051d63f2fe6fe24fbab96d1:e5ca6d1b22e6070318630b23ed428d174cebd9f1#cc14a8218ec28da1ea3fa3581d178f93 - Cache
    magic_enum/0.9.3#4e83997cc627fc6e260374bdbbb6f5bc:da39a3ee5e6b4b0d3255bfef95601890afd80709#78bd9152e3c1d22c9ffa51e2a37f9ff2 - Cache
    openssl/3.1.1#19bf86f77c35e7c3937c0c40e352c603:304924fcf37a59a75d4ed16a02d5967d959ed232#5b1d7586a7a6d8b98e3209579b6b41d5 - Cache
    parallel-hashmap/1.3.11#08b0dfed82b90ff06f3fa945ce95c3fe:da39a3ee5e6b4b0d3255bfef95601890afd80709#51a47096fb0132203bb5419b58651174 - Cache
    range-v3/0.12.0#c40ffa5a82269b873053f008d8511138:da39a3ee5e6b4b0d3255bfef95601890afd80709#ecc6172c3cd6694c36d1cd98a702deb0 - Cache
    spdlog/1.12.0#15d495fc34387ffd97ff9dad2beaab80:9915c88bda8d794d8d36477a891e5a51ccbedfa3#7223bba8fb431f1f123a5adc14f9dd4f - Cache
    tracy/0.9.1#cb60ff4cde1c4b7558f3a02bd7491d8c:5b91057e3fa033178cb9ca5bde1957a2ef2b0bd4#84b3c00657ba761f956492f8a78e7979 - Cache
    yaml-cpp/0.7.0#fc09e84222e179e24f5f59e945d4f454:35cb83beadb8b16663af2f47cf1e0d4d45834fa6#548009ed0707c0387850dafed69f9670 - Cache
    zlib/1.2.13#12b491771aa8105bca32bea4d34a392a:5bc851010eb7b707e5cb2e24cb8ccf0f27989fa9#7d40fc2b6297d11b68b2ae7713b4f7bf - Cache
Build requirements
    autoconf/2.71#10c14740b7cd91d929220ce228c9fb33:da39a3ee5e6b4b0d3255bfef95601890afd80709 - Build
    automake/1.16.5#f716d9c672e9c0657608b397fe9c0fcb:9a4eb3c8701508aa9458b1a73d0633783ecc2270 - Build
    gnu-config/cci.20210814#1e05eeb4222461c1438295c21dd38dce:da39a3ee5e6b4b0d3255bfef95601890afd80709 - Build
    m4/1.4.19#20f7472376a99051e1db0a14d7977eba:3593751651824fb813502c69c971267624ced41a - Build
    meson/1.0.0#b564c0f55f3bd306593e3ea1d240342f:da39a3ee5e6b4b0d3255bfef95601890afd80709 - Build
    ninja/1.11.1#de85db1490cc53d3353a536dadf1db50:3593751651824fb813502c69c971267624ced41a - Build
commented

I see, thanks for the feedback.

The optimization of the compatible package is something that we are aware and we will try to do it when possible (it might take some time). In the meantime, it is very recommended that you also build binaries for the cppstd. The default compatibility in 2.0 is intended for ConanCenter, but for production it will be safer to to use binaries built with the exact cppstd.

We also need to think and discuss how the CMake provider will be parameterized/customized by users, that is something planned to do soon.

commented

I see, thanks for the feedback.

The optimization of the compatible package is something that we are aware and we will try to do it when possible (it might take some time). In the meantime, it is very recommended that you also build binaries for the cppstd. The default compatibility in 2.0 is intended for ConanCenter, but for production it will be safer to to use binaries built with the exact cppstd.

We also need to think and discuss how the CMake provider will be parameterized/customized by users, that is something planned to do soon.

Thanks for the reply! I've found that I had set my cppstd to 23 and gnu23 on different machines, which led to the slow calculation of the compatible package. Now I have set them all to 23.

I see, thanks for the feedback.

The optimization of the compatible package is something that we are aware and we will try to do it when possible (it might take some time). In the meantime, it is very recommended that you also build binaries for the cppstd. The default compatibility in 2.0 is intended for ConanCenter, but for production it will be safer to to use binaries built with the exact cppstd.

We also need to think and discuss how the CMake provider will be parameterized/customized by users, that is something planned to do soon.

Hello @memsharded, I've noticed that when I include --build=missing in Conan install commands(which is the conan_provider.cmake's default), and then disable the remote server, the compatible packages are subsequently rebuilt. Although utilizing --build=never can prevent this, I'm wondering if there's an alternative approach that would allow me to avoid the rebuilding of compatible packages, even while using --build=missing?

I've noticed that when I include --build=missing in Conan install commands(which is the conan_provider.cmake's default), and then disable the remote server, the compatible packages are subsequently rebuilt.

But this shouldn't happen. The --build=missing only builds from source exclusively when there are no available binaries. That is, it only has effect if otherwise the conan install will fail because it cannot find binaries. It never rebuilds if there are existing binaries. It seems there could be other things changing, or other things not considered, but shouldn't be an effect of the --build=missing. If you have some way to reproduce this behavior, please report it, with the detailed instructions and commands.