[MONGOCRYPT-594] Failed to build release from source code Created: 18/Sep/23  Updated: 28/Oct/23  Resolved: 13/Oct/23

Status: Closed
Project: Libmongocrypt
Component/s: Build
Affects Version/s: 1.8.2
Fix Version/s: 1.9.0

Type: Bug Priority: Unknown
Reporter: Hua Zhang Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: archlinux, build-failure, cmake, intel-rdfp, third-party-libraries
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by MONGOCRYPT-483 Support decimal128 Closed
Binding Changes: Not Needed

 Description   

I am building libmongocrypt on Arch Linux with AUR package [libmongocrypt|https://aur.archlinux.org/packages/libmongocrypt.] When calling cmake to start build, cmake throws an error and fails:

{{-- The C compiler identification is GNU 13.2.1
– 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
– The CXX compiler identification is GNU 13.2.1
– 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_SYSTEM_LIBBSON
– Performing Test HAVE_SYSTEM_LIBBSON - Success
– Performing Test SYSTEM_LIBBSON_IS_EXTRA_ALIGNED
– Performing Test SYSTEM_LIBBSON_IS_EXTRA_ALIGNED - Success
– NOTE: Using system-wide libbson library. This is intended only for package maintainers.
CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1316 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  cmake/IntelDFP.cmake:36 (FetchContent_Declare)
  cmake/ImportDFP.cmake:46 (include)
  CMakeLists.txt:53 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

– Obtaining Intel Decimal FP library: /build/libmongocrypt/src/libmongocrypt-1.8.2/third-party/IntelRDFPMathLib20U2.tar.xz
[ 11%] Creating directories for 'intel_dfp-populate'
[ 22%] Performing download step (verify and extract) for 'intel_dfp-populate'
– verifying file...
     file='/build/libmongocrypt/src/libmongocrypt-1.8.2/third-party/IntelRDFPMathLib20U2.tar.xz'
– verifying file... done
– extracting...
     src='/build/libmongocrypt/src/libmongocrypt-1.8.2/third-party/IntelRDFPMathLib20U2.tar.xz'
     dst='/build/libmongocrypt/src/libmongocrypt-1.8.2/build/_deps/intel_dfp-src'
– extracting... [tar xfz]
– extracting... [analysis]
– extracting... [rename]
– extracting... [clean up]
– extracting... done
[ 33%] No update step for 'intel_dfp-populate'
[ 44%] Performing patch step for 'intel_dfp-populate'
/usr/bin/patch: /build/libmongocrypt/src/libmongocrypt-1.8.2/etc/mongo-inteldfp-libmongocrypt-pr-625.patch: extra operand
/usr/bin/patch: Try '/usr/bin/patch --help' for more information.
make[2]: *** [CMakeFiles/intel_dfp-populate.dir/build.make:116: intel_dfp-populate-prefix/src/intel_dfp-populate-stamp/intel_dfp-populate-patch] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/intel_dfp-populate.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1662 (message):
  Build step for intel_dfp failed: 2
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FetchContent.cmake:1802:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake/Modules/FetchContent.cmake:1802 (cmake_language)
  cmake/IntelDFP.cmake:52 (FetchContent_Populate)
  cmake/ImportDFP.cmake:46 (include)
  CMakeLists.txt:53 (include)

– Configuring incomplete, errors occurred!

}}
It seems that the way you call patch is not correct.



 Comments   
Comment by Githook User [ 13/Oct/23 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: MONGOCRYPT-594 patch requires -i option before patch file (#704)
Branch: master
https://github.com/mongodb/libmongocrypt/commit/b286cc09c43cf089893c6b2869e1b50384dcf6a8

Comment by Cloud GitHub Webhooks [ 13/Oct/23 ]

rcsanchez97 merged a pull request (MONGOCRYPT-594 patch requires -i option before patch file) into the following branch:
master: b286cc09c43cf089893c6b2869e1b50384dcf6a8

Comment by Roberto Sanchez [ 12/Oct/23 ]

https://github.com/mongodb/libmongocrypt/pull/704

Comment by Kevin Albertson [ 19/Sep/23 ]

zhanghuadedn@gmail.com thank you for the report. I can reproduce the error. Suggested workaround: install git and rerun the cmake command. libmongocrypt prefers using git over patch to apply the patch files.

Generated at Thu Feb 08 09:09:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.