Skip to content

[vcpkg baseline][libbson] Fix race condition during CMake configure#35586

Merged
vicroms merged 4 commits intomicrosoft:masterfrom
Thomas1664:libbson
Dec 12, 2023
Merged

[vcpkg baseline][libbson] Fix race condition during CMake configure#35586
vicroms merged 4 commits intomicrosoft:masterfrom
Thomas1664:libbson

Conversation

@Thomas1664
Copy link
Contributor

@Thomas1664 Thomas1664 commented Dec 10, 2023

The race condition is about creating the file ${SOURCE_PATH}/VERSION_CURRENT: https://github.com/mongodb/mongo-c-driver/blob/e9c77e4753a80535d027734823e6c144fcb25cf4/CMakeLists.txt#L19

Related: #35276, #35521

I also deleted unused patches.

  • Changes comply with the maintainer guide
  • SHA512s are updated for each updated download
  • The "supports" clause reflects platforms that may be fixed by this new version
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

Configure log from https://dev.azure.com/vcpkg/public/_build/results?buildId=97518&view=results :

[1/2] "/mnt/vcpkg-ci/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake" -E chdir ".." "/mnt/vcpkg-ci/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake" "/mnt/vcpkg-ci/buildtrees/libbson/src/1.25.1-e7f956b60e.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=/mnt/vcpkg-ci/packages/libbson_x64-linux" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DBUILD_VERSION=1.25.1" "-DENABLE_BSON=ON" "-DENABLE_EXAMPLES=OFF" "-DENABLE_ICU=OFF" "-DENABLE_MONGOC=OFF" "-DENABLE_SASL=OFF" "-DENABLE_SNAPPY=OFF" "-DENABLE_SRV=OFF" "-DENABLE_SSL=OFF" "-DENABLE_STATIC=ON" "-DENABLE_SHARED=OFF" "-DENABLE_TESTS=OFF" "-DENABLE_UNINSTALL=OFF" "-DENABLE_ZLIB=SYSTEM" "-DENABLE_ZSTD=OFF" "-DCMAKE_MAKE_PROGRAM=/mnt/vcpkg-ci/downloads/tools/ninja/1.10.2-linux/ninja" "-DCMAKE_SYSTEM_NAME=Linux" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/mnt/vss/_work/1/s/scripts/toolchains/linux.cmake" "-DVCPKG_TARGET_TRIPLET=x64-linux" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/mnt/vss/_work/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/mnt/vss/_work/1/s" "-D_VCPKG_INSTALLED_DIR=/mnt/vcpkg-ci/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
FAILED: ../CMakeCache.txt 
"/mnt/vcpkg-ci/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake" -E chdir ".." "/mnt/vcpkg-ci/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake" "/mnt/vcpkg-ci/buildtrees/libbson/src/1.25.1-e7f956b60e.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=/mnt/vcpkg-ci/packages/libbson_x64-linux" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DBUILD_VERSION=1.25.1" "-DENABLE_BSON=ON" "-DENABLE_EXAMPLES=OFF" "-DENABLE_ICU=OFF" "-DENABLE_MONGOC=OFF" "-DENABLE_SASL=OFF" "-DENABLE_SNAPPY=OFF" "-DENABLE_SRV=OFF" "-DENABLE_SSL=OFF" "-DENABLE_STATIC=ON" "-DENABLE_SHARED=OFF" "-DENABLE_TESTS=OFF" "-DENABLE_UNINSTALL=OFF" "-DENABLE_ZLIB=SYSTEM" "-DENABLE_ZSTD=OFF" "-DCMAKE_MAKE_PROGRAM=/mnt/vcpkg-ci/downloads/tools/ninja/1.10.2-linux/ninja" "-DCMAKE_SYSTEM_NAME=Linux" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/mnt/vss/_work/1/s/scripts/toolchains/linux.cmake" "-DVCPKG_TARGET_TRIPLET=x64-linux" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/mnt/vss/_work/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/mnt/vss/_work/1/s" "-D_VCPKG_INSTALLED_DIR=/mnt/vcpkg-ci/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
-- Found Python: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at build/cmake/LoadVersion.cmake:9 (string):
  string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  CMakeLists.txt:20 (LoadVersion)


CMake Deprecation Warning at /mnt/vcpkg-ci/buildtrees/libbson/x64-linux-rel/_eval.tmp.cmake:5 (message):
  Enabling ENABLE_AUTOMATIC_INIT_AND_CLEANUP is deprecated and may be removed
  in a future release
Call Stack (most recent call first):
  build/cmake/MongoSettings.cmake:295 (include)
  build/cmake/MongoSettings.cmake:183 (_mongo_eval_cmake)
  build/cmake/MongoSettings.cmake:269 (mongo_setting)
  CMakeLists.txt:186 (mongo_bool_setting)


-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for a CXX compiler
-- Looking for a CXX compiler - /usr/bin/c++
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_LLD_LINKER_SUPPORT
-- Performing Test HAVE_LLD_LINKER_SUPPORT - Failed
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- Using bundled libbson
-- Looking for snprintf
-- Looking for snprintf - found
-- Performing Test BSON_HAVE_TIMESPEC
-- Performing Test BSON_HAVE_TIMESPEC - Success
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for rand_r
-- Looking for rand_r - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for strlcpy
-- Looking for strlcpy - not found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Build files generated for:
-- 	build system: Ninja
-- 
-- Configuring incomplete, errors occurred!
[2/2] "/mnt/vcpkg-ci/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake" -E chdir "../../x64-linux-dbg" "/mnt/vcpkg-ci/downloads/tools/cmake-3.27.1-linux/cmake-3.27.1-linux-x86_64/bin/cmake" "/mnt/vcpkg-ci/buildtrees/libbson/src/1.25.1-e7f956b60e.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=/mnt/vcpkg-ci/packages/libbson_x64-linux/debug" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DBUILD_VERSION=1.25.1" "-DENABLE_BSON=ON" "-DENABLE_EXAMPLES=OFF" "-DENABLE_ICU=OFF" "-DENABLE_MONGOC=OFF" "-DENABLE_SASL=OFF" "-DENABLE_SNAPPY=OFF" "-DENABLE_SRV=OFF" "-DENABLE_SSL=OFF" "-DENABLE_STATIC=ON" "-DENABLE_SHARED=OFF" "-DENABLE_TESTS=OFF" "-DENABLE_UNINSTALL=OFF" "-DENABLE_ZLIB=SYSTEM" "-DENABLE_ZSTD=OFF" "-DCMAKE_MAKE_PROGRAM=/mnt/vcpkg-ci/downloads/tools/ninja/1.10.2-linux/ninja" "-DCMAKE_SYSTEM_NAME=Linux" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/mnt/vss/_work/1/s/scripts/toolchains/linux.cmake" "-DVCPKG_TARGET_TRIPLET=x64-linux" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/mnt/vss/_work/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/mnt/vss/_work/1/s" "-D_VCPKG_INSTALLED_DIR=/mnt/vcpkg-ci/installed" "-DVCPKG_MANIFEST_INSTALL=OFF"
-- Found Python: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Deprecation Warning at /mnt/vcpkg-ci/buildtrees/libbson/x64-linux-dbg/_eval.tmp.cmake:5 (message):
  Enabling ENABLE_AUTOMATIC_INIT_AND_CLEANUP is deprecated and may be removed
  in a future release
Call Stack (most recent call first):
  build/cmake/MongoSettings.cmake:295 (include)
  build/cmake/MongoSettings.cmake:183 (_mongo_eval_cmake)
  build/cmake/MongoSettings.cmake:269 (mongo_setting)
  CMakeLists.txt:186 (mongo_bool_setting)


-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Looking for a CXX compiler
-- Looking for a CXX compiler - /usr/bin/c++
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_LLD_LINKER_SUPPORT
-- Performing Test HAVE_LLD_LINKER_SUPPORT - Failed
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- Using bundled libbson
-- Looking for snprintf
-- Looking for snprintf - found
-- Performing Test BSON_HAVE_TIMESPEC
-- Performing Test BSON_HAVE_TIMESPEC - Success
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for rand_r
-- Looking for rand_r - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for strlcpy
-- Looking for strlcpy - not found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for strnlen
-- Looking for strnlen - found
-- Build files generated for:
-- 	build system: Ninja
-- 
-- Configuring done (2.0s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    ENABLE_ICU
    FETCHCONTENT_FULLY_DISCONNECTED
    VCPKG_PLATFORM_TOOLSET
    VCPKG_SET_CHARSET_FLAG
    _VCPKG_ROOT_DIR


-- Build files have been written to: /mnt/vcpkg-ci/buildtrees/libbson/x64-linux-dbg
ninja: build stopped: subcommand failed.

@Thomas1664 Thomas1664 changed the title [libbson] Fix race condition during CMake configure [vcpkg baseline][libbson] Fix race condition during CMake configure Dec 10, 2023
@Cheney-W Cheney-W added the category:port-bug The issue is with a library, which is something the port should already support label Dec 11, 2023
@Cheney-W Cheney-W added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Dec 11, 2023
@vicroms vicroms merged commit 9ca8099 into microsoft:master Dec 12, 2023
@Thomas1664 Thomas1664 deleted the libbson branch December 12, 2023 14:37
autoantwort pushed a commit to autoantwort/vcpkg that referenced this pull request Dec 13, 2023
…icrosoft#35586)

* Delete unused patches

* disable finding Python

* Fix race during CMake configure

* version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants