Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake files use string(JOIN) while only requesting CMake >= 3.5 #12672

Closed
coryan opened this issue May 4, 2023 · 1 comment
Closed

CMake files use string(JOIN) while only requesting CMake >= 3.5 #12672

coryan opened this issue May 4, 2023 · 1 comment

Comments

@coryan
Copy link
Contributor

coryan commented May 4, 2023

What version of protobuf and what language are you using?

Version: 22.4
Language: C++

What operating system (Linux, Windows, ...) and version?

Ubuntu 18.04

What runtime / compiler are you using (e.g., python version or gcc version)

GCC 7.5

What did you do?

I used this Dockerfile:

https://github.com/coryan/google-cloud-cpp/blob/414854fb53439c3d34ccb17766312c518afa9e3d/ci/cloudbuild/dockerfiles/demo-ubuntu-bionic.Dockerfile#L66-L76

What did you expect to see

A successful build.

What did you see instead?

Step #0: -- The C compiler identification is GNU 7.5.0
Step #0: -- The CXX compiler identification is GNU 7.5.0
Step #0: -- Check for working C compiler: /usr/bin/cc
Step #0: -- Check for working C compiler: /usr/bin/cc -- works
Step #0: -- Detecting C compiler ABI info
Step #0: -- Detecting C compiler ABI info - done
Step #0: -- Detecting C compile features
Step #0: -- Detecting C compile features - done
Step #0: -- Check for working CXX compiler: /usr/bin/c++
Step #0: -- Check for working CXX compiler: /usr/bin/c++ -- works
Step #0: -- Detecting CXX compiler ABI info
Step #0: -- Detecting CXX compiler ABI info - done
Step #0: -- Detecting CXX compile features
Step #0: -- Detecting CXX compile features - done
Step #0: -- 
Step #0: -- 22.4.0
Step #0: -- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT
Step #0: -- Performing Test protobuf_HAVE_LD_VERSION_SCRIPT - Success
Step #0: -- Looking for pthread.h
Step #0: -- Looking for pthread.h - found
Step #0: -- Looking for pthread_create
Step #0: -- Looking for pthread_create - not found
Step #0: -- Looking for pthread_create in pthreads
Step #0: -- Looking for pthread_create in pthreads - not found
Step #0: -- Looking for pthread_create in pthread
Step #0: -- Looking for pthread_create in pthread - found
Step #0: -- Found Threads: TRUE  
Step #0: -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
Step #0: -- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
Step #0: -- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - SuccessStep #0: CMake Error at cmake/install.cmake:9 (string):
Step #0:   string does not recognize sub-command JOIN
Step #0: Call Stack (most recent call first):
Step #0:   CMakeLists.txt:409 (include)

Anything else we should know about your project / environment

string(JOIN) ships with CMake >= 3.12:

https://cmake.org/cmake/help/latest/command/string.html#join

However Protobuf 22.4 requires CMake >= 3.5:

cmake_minimum_required(VERSION 3.5)

You could bump the CMake requirements but notice that the overall foundations matrix still says CMake >= 3.10:

https://github.com/google/oss-policies-info/blob/6587f128170c23282eb40949c914403a4010079a/foundational-cxx-support-matrix.md?plain=1#L6

@coryan coryan added the untriaged auto added to all issues by default when created. label May 4, 2023
@fowles fowles added packaging & distribution and removed untriaged auto added to all issues by default when created. labels May 4, 2023
@fowles
Copy link
Contributor

fowles commented May 4, 2023

Somewhere around here:

string(JOIN " " _pc_target_list ${_pc_targets})

One needs to write a loop

CMake
  set(_protobuf_PC_REQUIRES "")
  set(_sep "")
  foreach (_target IN LISTS _pc_target_list)
    string(CONCAT _protobuf_PC_REQUIRES "${_protobuf_PC_REQUIRES}" "${_sep}" "${_target}")
    set(_sep " ")
  endforeach ()

copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
copybara-service bot pushed a commit that referenced this issue May 5, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529751568
mkruskal-google added a commit that referenced this issue May 6, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529840763
mkruskal-google added a commit that referenced this issue May 6, 2023
This also downgrades our tests to use cmake 3.10, compatible with our support window.

Closes #12672

PiperOrigin-RevId: 529840763
copybara-service bot pushed a commit that referenced this issue May 7, 2023
My sketch to fix #12672 was wrong.  This works for realsies.

Closes #12698

COPYBARA_INTEGRATE_REVIEW=#12698 from coryan:fix-cmake-typo-in-string-join-workaround 182d2e2
PiperOrigin-RevId: 530116824
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants