[MDEV-26523] Re-running recursion when configuring with make and building with ninja generator Created: 2021-09-02  Updated: 2021-09-02  Resolved: 2021-09-02

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Anel Husakovic Assignee: Anel Husakovic
Resolution: Not a Bug Votes: 0
Labels: None


 Description   

I'm not sure is this expected behavior, but when we configure the builds with Unix makefile generator and build them with ninja generator we got the recursion of re-running of CMake files ending with build files have completed for OQGraph target.
I haven't tested opposite or with other types of generators.
I would expect failure with some message at the beginning - not compatible generators.
The solution is to use cmake's native build option cmake --build . , but however seems something is happening (maybe some sort of conversions of Makes files to ninja files?).
Example of the recursion:

$ ninja
[0/1] Re-running CMake...
CMake Warning (dev) at CMakeLists.txt:30 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
 
  The following variable(s) would be set to empty:
 
    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Running cmake version 3.20.0-rc4
-- MariaDB 10.7.0
-- Updating submodules
Submodule path 'libmariadb': checked out '2ca0c22fd36c1b34115352e22c5f6b7d23c2c04a'
CMake Deprecation Warning at wsrep-lib/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Wsrep-lib version: 1.0.0
== Configuring MariaDB Connector/C
-- MariaDB Connector/C 3.2.5
CMake Deprecation Warning at storage/mroonga/vendor/groonga/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
CMake Deprecation Warning at storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Configuring OQGraph
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anel/mariadb/builds/10.7
[0/1] Re-running CMake...
CMake Warning (dev) at CMakeLists.txt:30 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
 
  The following variable(s) would be set to empty:
 
    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Running cmake version 3.20.0-rc4
-- MariaDB 10.7.0
-- Updating submodules
CMake Deprecation Warning at wsrep-lib/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Wsrep-lib version: 1.0.0
== Configuring MariaDB Connector/C
CMake Deprecation Warning at storage/mroonga/vendor/groonga/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
CMake Deprecation Warning at storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Configuring OQGraph
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anel/mariadb/builds/10.7
[0/1] Re-running CMake...
CMake Warning (dev) at CMakeLists.txt:30 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
 
  The following variable(s) would be set to empty:
 
    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Running cmake version 3.20.0-rc4
-- MariaDB 10.7.0
-- Updating submodules
CMake Deprecation Warning at wsrep-lib/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Wsrep-lib version: 1.0.0
== Configuring MariaDB Connector/C
CMake Deprecation Warning at storage/mroonga/vendor/groonga/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
CMake Deprecation Warning at storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Configuring OQGraph
-- Configuring done
-- Build files have been written to: /home/anel/mariadb/builds/10.7
[0/1] Re-running CMake...
CMake Warning (dev) at CMakeLists.txt:30 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
 
  The following variable(s) would be set to empty:
 
    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Running cmake version 3.20.0-rc4
-- MariaDB 10.7.0
-- Updating submodules
CMake Deprecation Warning at wsrep-lib/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Wsrep-lib version: 1.0.0
== Configuring MariaDB Connector/C
CMake Deprecation Warning at storage/mroonga/vendor/groonga/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
CMake Deprecation Warning at storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Configuring OQGraph
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anel/mariadb/builds/10.7
[0/1] Re-running CMake...
CMake Warning (dev) at CMakeLists.txt:30 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
 
  The following variable(s) would be set to empty:
 
    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.
 
-- Running cmake version 3.20.0-rc4
-- MariaDB 10.7.0
-- Updating submodules
CMake Deprecation Warning at wsrep-lib/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Wsrep-lib version: 1.0.0
== Configuring MariaDB Connector/C
CMake Deprecation Warning at storage/mroonga/vendor/groonga/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
CMake Deprecation Warning at storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt:18 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.
 
  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
 
 
-- Configuring OQGraph
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anel/mariadb/builds/10.7
[0/1] Re-running CMake...
CMake Warning (dev) at CMakeLists.txt:30 (PROJECT):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.



 Comments   
Comment by Vladislav Vaintroub [ 2021-09-02 ]

How can you even configure with Makefiles and build with ninja?

Comment by Anel Husakovic [ 2021-09-02 ]
  • Configured
    $ CMAKE ../../10.7 -DCMAKE_BUILD_TYPE=Debug

    //Name of generator.
    CMAKE_GENERATOR:INTERNAL=Unix Makefiles
    

  • Used build:

    $ cmake --buid .
    

  • Old habit:
    $ ninja // maybe is trying to interpret above Makefiles (already created) as Ninja files ?
Comment by Vladislav Vaintroub [ 2021-09-02 ]

– Build files have been written to: /home/wlad/yy
wlad@workpc:~/yy$ ninja
ninja: error: loading 'build.ninja': No such file or directory
wlad@workpc:~/yy$ grep GENERAT CMakeCache.txt
CMAKE_EXTRA_GENERATOR:INTERNAL=
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
CMAKE_GENERATOR_PLATFORM:INTERNAL=
CMAKE_GENERATOR_TOOLSET:INTERNAL=

ninja is not trying to interpret Makefiles. It fails right away

Comment by Vladislav Vaintroub [ 2021-09-02 ]

Do you have a build.ninja in the build directory? Makefile generator does not create it. ninja fails if it is not there.
Could that be you deleted CMakeCache.txt and rebuild with different generator? I usually suggest to remove the build directory (and of course I also suggest out-of-source builds )

Comment by Anel Husakovic [ 2021-09-02 ]

And that is exactly I would expect to have.
Don't know wlad could it be related with previous {{cmake --build . }} ?

Comment by Anel Husakovic [ 2021-09-02 ]

Yes I have

$ find .|grep ninja
./build.ninja
./.ninja_log
./.ninja_deps
./CMakeFiles/rules.ninja

but don't know how is created :S. I'm using out-of-source builds.
Will try from scratch again and will let you know, thanks wlad .

Comment by Vladislav Vaintroub [ 2021-09-02 ]

I'm pretty sure it was not the "Unix makefiles" that generated them, but a previous run with different generator. CMake does not allow that normally

ninja: error: loading 'build.ninja': No such file or directory
wlad@workpc:~/yy$ grep GENERAT CMakeCache.txt
CMAKE_EXTRA_GENERATOR:INTERNAL=
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
CMAKE_GENERATOR_PLATFORM:INTERNAL=
CMAKE_GENERATOR_TOOLSET:INTERNAL=
wlad@workpc:~/yy$ cmake /mnt/c/work/server -G Ninja
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

But if you just removed CMakeCache.txt , and build in the same directory, cmake would not know, and all bets are off

Comment by Anel Husakovic [ 2021-09-02 ]

wlad you are right, it had old ninja files, so I'm closing this as Not a bug.
Thanks

Generated at Thu Feb 08 09:45:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.