AzureAD / azure-activedirectory-library-for-objc

The ADAL SDK for Objective C gives you the ability to add support for Work Accounts to your iOS and macOS applications with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support.
MIT License
178 stars 113 forks source link

Can't build version 4.0.6 with carthage #1524

Closed cassianodialpad closed 4 years ago

cassianodialpad commented 4 years ago

On trying to build version 4.0.6 with carthage, I get the following error:

The following build commands failed: CompileC /Users/cassiano/Library/Caches/org.carthage.CarthageKit/DerivedData/11.3.1_11C505/azure-activedirectory-library-for-objc/4.0.6/Build/Intermediates.noindex/ArchiveIntermediates/ADAL\ iOS/IntermediateBuildFilesPath/ADAL.build/Release-iphoneos/ADAL-core.build/Objects-normal/armv7/ADAuthenticationRequest+WebRequest.o /Users/cassiano/Developer/master/Vendor/Carthage/Checkouts/azure-activedirectory-library-for-objc/ADAL/src/request/ADAuthenticationRequest+WebRequest.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -workspace /Users/cassiano/Developer/master/Vendor/Carthage/Checkouts/azure-activedirectory-library-for-objc/ADAL.xcworkspace -scheme ADAL\ iOS -configuration Release -derivedDataPath /Users/cassiano/Library/Caches/org.carthage.CarthageKit/DerivedData/11.3.1_11C505/azure-activedirectory-library-for-objc/4.0.6 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/1m/qtjwktc57nl09cm7k2j4d29r0000gp/T/azure-activedirectory-library-for-objc SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/cassiano/Developer/master/Vendor/Carthage/Checkouts/azure-activedirectory-library-for-objc)

Carthage command used: carthage update --platform iOS --no-use-binaries --cache-builds

Using XCode 11.3.1.

I'm attaching the build logs. carthage-xcodebuild.1BB34n.log

rohitnarula7176 commented 4 years ago

@cassianodialpad Can you please try cleaning your Carthage cache using the command (rm -rf ~/Library/Caches/org.carthage.CarthageKit) and retrying it.

cassianodialpad commented 4 years ago

@cassianodialpad Can you please try cleaning your Carthage cache using the command (rm -rf ~/Library/Caches/org.carthage.CarthageKit) and retrying it.

Same issue. Version 4.0.5 builds fine, but 4.0.6 gives me those errors in the attached logs.

potrebic commented 4 years ago

I'm also hitting an error in ADAuthenticationRequest+WebRequest.m, more specifically:

ADAuthenticationRequest+WebRequest.m:117:146: error: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Werror,-Wformat]
        MSID_LOG_VERBOSE(_requestParams, @"Retrieve refresh token from cache for web view: %@, error code: %ld", _PII_NULLIFY(refreshTokenItem), refreshTokenError.code);
                                                                                                           ~~~                                   ^~~~~~~~~~~~~~~~~~~~~~
                                                                                                           %ld                                   (long)

This error only happens when I build ADAL via carthage. If I open the ADAL workspace in XCode and build... things work fine. I suppose that's due to different compiler flags resulting in different treatment of "warnings"

The offending line:

MSID_LOG_VERBOSE(_requestParams, @"Retrieve refresh token from cache for web view: %@, error code: %ld", _PII_NULLIFY(refreshTokenItem), refreshTokenError.code)

is fixed by adding the cast (as suggesting by the error message)

MSID_LOG_VERBOSE(_requestParams, @"Retrieve refresh token from cache for web view: %@, error code: %ld", _PII_NULLIFY(refreshTokenItem), (long) refreshTokenError.code)
fergalrooney commented 4 years ago

I'm getting the exact same error as @cassianodialpad when trying to install with carthage. Tried clearing carthage cache as suggested and didn't resolve issue.

oldalton commented 4 years ago

Thanks for the information. Looks like this is a warning that is being treated as error. We will need to fix that warning on our side. As a workaround in the meantime, can you please disable "treat warnings as errors"? Thanks.

rohitnarula7176 commented 4 years ago

Please update to release 4.0.7 and let us know if the issue still persists.

cassianodialpad commented 4 years ago

@rohitnarula7176 It worked, thanks!