Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Clang Compiler Test Failing For iOS-10-3-armv7.cmake At Master Commit 3e3f903 #170

Closed
MrJman006 opened this issue Aug 22, 2017 · 21 comments
Closed

Comments

@MrJman006
Copy link

I am trying to use the Polly toolchain files to build the weather example (https://github.com/ruslo/weather#mac-ios) for IOS. I follow the directions exactly and get the following error:

cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DCMAKE_TOOLCHAIN_FILE=$POLLY_ROOT/ios-10-3-armv7.cmake -GXcode
-- [hunter *** DEBUG *** 2017-08-22T10:25:35] HUNTER_ROOT detected by environment variable
-- [hunter *** DEBUG *** 2017-08-22T10:25:35] HUNTER_ROOT: /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Resources/Ruslo_Hunter
-- [hunter *** DEBUG *** 2017-08-22T10:25:35] Settings (initialize):
-- [hunter *** DEBUG *** 2017-08-22T10:25:35]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2017-08-22T10:25:35]   Cache init (NO)
-- [polly] Used toolchain: iOS 10.3 / clang / armv7 / c++11 support

CMake minimum required version for iOS is 3.5 (current ver: 3.0.0)

CMake Error at /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Resources/Ruslo_Polly/utilities/polly_fatal_error.cmake:10 (message):
Call Stack (most recent call first):
  /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Resources/Ruslo_Polly/os/iphone.cmake:24 (polly_fatal_error)
  /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Resources/Ruslo_Polly/ios-10-3-armv7.cmake:37 (include)
  /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Resources/CMake-3.0.0-ios-universal/_install/share/cmake-3.0/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:11 (project)


CMake Error: Could not find cmake module file: /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Sandbox/Hunter_Test/_builds/CMakeFiles/3.0.0/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file: /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Sandbox/Hunter_Test/_builds/CMakeFiles/3.0.0/CMakeCXXCompiler.cmake
CMake Error at CMakeLists.txt:11 (project):
  No CMAKE_C_COMPILER could be found.



CMake Error at CMakeLists.txt:11 (project):
  No CMAKE_CXX_COMPILER could be found.



-- Configuring incomplete, errors occurred!

So I upgraded to the newest standard CMake toolchain (v3.8) and tried again. Still no luck. I also have tried following all of the pointers outlined in issue 102 (i.e. setting various CMake/xCode variables as environment variables and as CMake variables, running empty projects with xCode to generate default provisioning profiles, etc.) and still can not get the project to build. Here is the error I am getting stuck on.

DADDYMACs-iMac:Hunter_Test daddymac$ cmake -H. -B_builds -DHUNTER_STATUS_DEBUG=ON -DCMAKE_TOOLCHAIN_FILE=$POLLY_ROOT/ios-10-3-armv7.cmake -GXcode
-- [hunter *** DEBUG *** 2017-08-22T11:12:58] HUNTER_ROOT detected by environment variable
-- [hunter *** DEBUG *** 2017-08-22T11:12:58] HUNTER_ROOT: /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Resources/Ruslo_Hunter
-- [hunter *** DEBUG *** 2017-08-22T11:12:58] Settings (initialize):
-- [hunter *** DEBUG *** 2017-08-22T11:12:58]   HunterGate done (NO)
-- [hunter *** DEBUG *** 2017-08-22T11:12:58]   Cache init (NO)
-- [polly] Used toolchain: iOS 10.3 / clang / armv7 / c++11 support
-- The C compiler identification is AppleClang 8.1.0.8020042
-- The CXX compiler identification is AppleClang 8.1.0.8020042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler
  "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/daddymac/Documents/DiGiorgioJ/Projects/CONFIRM/Sandbox/Hunter_Test/_builds/CMakeFiles/CMakeTmp

  

  Run Build Command:"/usr/bin/xcodebuild" "-project"
  "CMAKE_TRY_COMPILE.xcodeproj" "build" "-target" "cmTC_ba692"
  "-configuration" "Debug"

  === BUILD TARGET cmTC_ba692 OF PROJECT CMAKE_TRY_COMPILE WITH CONFIGURATION
  Debug ===

  

  Check dependencies

  No profiles for 'com.example' were found: Xcode couldn't find a
  provisioning profile matching 'com.example'.

  Code signing is required for product type 'Application' in SDK 'iOS 10.3'

  

  ** BUILD FAILED **

  

  

  The following build commands failed:

    Check dependencies

  (1 failure)

  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:11 (project)


-- Configuring incomplete, errors occurred!
@MrJman006 MrJman006 changed the title Clang Compiler Test Failing For iOS-10-3-armv.cmake At Master Commit 3e3f903 Clang Compiler Test Failing For iOS-10-3-armv7.cmake At Master Commit 3e3f903 Aug 22, 2017
@MrJman006
Copy link
Author

For simplicity sake, I just tried a bare minimum CMake project

cmake_minimum_required(VERSION 3.8)
project(foo)

and get the same error.

@ruslo
Copy link
Owner

ruslo commented Aug 22, 2017

and get the same error

Nothing I can recommend here except fixes from documentation:

If you'll find the fix feel free to add it to docs.

@joeced
Copy link

joeced commented Aug 31, 2017

I'm working on a fix. You need to set the MACOSX_BUNDLE_GUI_IDENTIFIER to something different. For me setting it to com.<company-name>.example worked.

@ruslo What I'm considering a is fix of the try-compile introducing a POLLY_XCODE_BUNDLE_IDENTIFIER variable that can be set from an environment variable. Does this sound like a reasonable solution?

@ruslo
Copy link
Owner

ruslo commented Aug 31, 2017

@joeced Are you sure that while doing these steps your team-id is the same as you used in POLLY_IOS_DEVELOPMENT_TEAM?

@joeced
Copy link

joeced commented Aug 31, 2017

@ruslo Yes most definitely. The problem is that we are not allowed to use com.example as bundle identifier, it will fail with the error:

No profiles for ´com.example´ were found: Xcode couldn't find a
provisioning profile matching ´com.example´.

Code signing is required for product type ´Application´ in SDK ´iOS 10.3´

If I

set(MACOSX_BUNDLE_GUI_IDENTIFIER com.<my company name>.example)

it works!

@ruslo
Copy link
Owner

ruslo commented Aug 31, 2017

The problem is that we are not allowed to use com.example as bundle identifier

Is it a limitation of your provisioning profile?

@joeced
Copy link

joeced commented Aug 31, 2017

Step set the bundle id to com.example in signing-request-development-team fails for me.
xcode screenshot
The problem being that another team in my organization used com.example as bundle identifier at some point in time. I'm on another enterprise account. Hope this clarifies the problem.

Addition:
I just realized this might not have been @MrJman006 original problem. Sorry, for littering the issue with unrelated comments. The problem still persists though.

@jetersen
Copy link

jetersen commented Aug 31, 2017

@joeced @ruslo
Checked our appstore and enterprise team and there is no com.example
Think the issue properly lies with the fact it is an enterprise account, apple doesn't allows creating bundle identifiers used by other enterprise account.
As I am able to use the com.example in our appstore team but not our enterprise team.

But it is definitely an issue we see with our enterprise account.

@ruslo
Copy link
Owner

ruslo commented Aug 31, 2017

The problem being that another team in my organization used com.example as bundle identifier at some point in time. I'm on another enterprise account. Hope this clarifies the problem.

@joeced No, I'm not sure I undestand that. This stuff is quite opaque to me :) I hope to find clear and simple way to use/set this ID. At this moment iOS toolchains was working for completely unrelated teams and developers.

apple doesn't allows creating bundle identifiers used by other enterprise account

@Casz Can you clarify this? Can we check whom to blame and how to fix/workaround this. Even if POLLY_IOS_BUNDLE_IDENTIFIER will be introduced, there is a chance that same issue will appear again. What the difference here between com.example and com.mycompany?

@jetersen
Copy link

jetersen commented Aug 31, 2017

@ruslo I can try.

On our enterprise team:
I am not able to generate provisioning profiles for the following.
com.abc
com.bob
com.example
com.cnn
com.starwars

However I am able to type random stuff after those previously blocked
com.asdasjdksdjn
com.abc.helloworld9231
com.starwars.helloworld9231

On our appstore team it is not an issue at all.

Now with the ability to set POLLY_IOS_BUNDLE_IDENTIFIER it doesn't have to be com.example but com.example.helloworld9231

obviously com.widex or com.widex.anything will also work

@joeced
Copy link

joeced commented Aug 31, 2017

@ruslo @Casz A simpler solution would be to change the set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example.polly) in every ios*.cmake file, and the update the docs. I will gladly provide a pull request for this. Eventually refactoring to extract the # fix try_compile part.

@ruslo
Copy link
Owner

ruslo commented Aug 31, 2017

On our enterprise team:
I am not able to generate provisioning profiles for the following.
com.abc
com.bob
com.example
com.cnn
com.starwars

@Casz Do you know what is the reason?

A simpler solution would be to change the set(MACOSX_BUNDLE_GUI_IDENTIFIER com.example.polly) in every ios*.cmake file, and the update the docs. I will gladly provide a pull request for this. Eventually refactoring to extract the # fix try_compile part.

@joeced Okay, we can try it.

@jetersen
Copy link

jetersen commented Aug 31, 2017

@ruslo other than this error message below. I cannot.

The app ID "com.example" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.

xcode error

@ruslo
Copy link
Owner

ruslo commented Sep 1, 2017

Sorry guys I still don't see the reason of the failure.

The app ID "com.example" cannot be registered to your development team. Change your bundle identifier to a unique string to try again

Where is the guarantee that we will not have same error for com.example.polly?

@jetersen
Copy link

jetersen commented Sep 1, 2017

Nothing, at all.
At least it fixes it for enterprise accounts for now.
I do not see any harm in the PR.

You want us to explain the inner workings of Xcode and Apple Developer Portal for Enterprise Accounts.
Which I cannot. Sadly, it is closed source.

What gives?

My best guess is there is a slight difference towards how uniqueness is handled on the enterprise bundle identifier for Apple Developer Portal.

Since for Apple App store all apps are re-signed by Apple and assigned to a team. Where on the Enterprise account, each bundle is unique when you want to distribute with your app.

@jetersen
Copy link

jetersen commented Sep 1, 2017

If you want a permanent fix. Let's introduce POLLY_IOS_BUNDLE_IDENTIFIER and have it default to the com.example or even com.example.polly when it is not set.

@ruslo
Copy link
Owner

ruslo commented Sep 1, 2017

What I'm considering a is fix of the try-compile introducing a POLLY_XCODE_BUNDLE_IDENTIFIER variable that can be set from an environment variable. Does this sound like a reasonable solution?

If you want a permanent fix. Let's introduce POLLY_IOS_BUNDLE_IDENTIFIER and have it default to the com.example or even com.example.polly when it is not set.

Okay, probably this one is better. At least we can be sure that it will not break iOS build for other developers.

@ruslo
Copy link
Owner

ruslo commented Sep 1, 2017

As a sidenote this problem can be fixed in CMake itself by adding no-code-sign logic for iOS internals.

@jetersen
Copy link

jetersen commented Sep 1, 2017

As a sidenote this problem can be fixed in CMake itself by adding no-code-sign logic for iOS internals.

Which might be the better solution

@ruslo
Copy link
Owner

ruslo commented Sep 7, 2017

Fixed by #173

@ruslo ruslo closed this as completed Sep 7, 2017
@ruslo
Copy link
Owner

ruslo commented Sep 7, 2017

Step by step document with screenshots:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants