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

Carthage Compilation Error: 'module.modulemap' should be inside the 'include' directory #71

Closed
joeydong opened this issue Apr 8, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@joeydong
Copy link

joeydong commented Apr 8, 2020

Describe what happened

Hi, I'm trying to install the latest release dd-sdk-ios 1.0.1 using Carthage 0.34.0 and Xcode 11.3.1 but this dependency fails to compile with this error:

$ /usr/bin/xcrun xcodebuild -workspace /Carthage/Checkouts/dd-sdk-ios/instrumented-tests/Integration/Integration.xcworkspace CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list
Build settings from command line:
    CARTHAGE = YES
    CODE_SIGN_IDENTITY =
    CODE_SIGNING_REQUIRED = NO

Resolve Package Graph

Resolved source packages:
  dd-sdk-ios: /Carthage/Checkouts/dd-sdk-ios
  HTTPServerMock: /Carthage/Checkouts/dd-sdk-ios/instrumented-tests/http-server-mock

xcodebuild: error: Could not resolve package dependencies:
  package has unsupported layout; modulemap '/Carthage/Checkouts/dd-sdk-ios/Datadog/DatadogPrivate/module.modulemap' should be inside the 'include' directory

I got this xcrun command from the failed Carthage output:

A shell task (/usr/bin/xcrun xcodebuild -workspace /Carthage/Checkouts/dd-sdk-ios/instrumented-tests/Integration/Integration.xcworkspace CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
xcodebuild: error: Could not resolve package dependencies:
  package has unsupported layout; modulemap '/Carthage/Checkouts/dd-sdk-ios/Datadog/DatadogPrivate/module.modulemap' should be inside the 'include' directory

Any ideas?

Steps to reproduce the issue:

Looks like I can reproduce this in Xcode 11.3.1 by:

  1. Clone this repo
  2. Open /dd-sdk-ios/examples/iOS-app-example-spm/iOS-app-example-spm.xcodeproj
  3. Cmd + B

Screen Shot 2020-04-07 at 5 31 51 PM

The compilation works fine in Xcode 11.4.0, somewhat surprisingly, but 🤷‍♂ :

Screen Shot 2020-04-07 at 5 38 24 PM

Expected behaviour:
📝

Actual behaviour:
📝

Additional context

  • OS version and device model
  • Datadog SDK version

An explanation of what might cause the bug and/or how it can be fixed:

Removing the empty /Datadog/DatadogPrivate/module.modulemap file seems to satisfy the compiler and fixes the build. Not sure what the implications of this are, though, perhaps an undesirable one is auto-generated.

@joeydong joeydong added the bug Something isn't working label Apr 8, 2020
@ncreated
Copy link
Member

ncreated commented Apr 8, 2020

Hey @joeydong 👋. Thank you for reporting this and so much details. I can reproduce it on Xcode 11.3.1 (11C505). We're working on the fix.

As a workaround - it works fine on Xcode 11.4 (11E146), but I understand that this might be not possible to everyone.

@ncreated
Copy link
Member

ncreated commented Apr 8, 2020

Solved in #73 and 1.0.2 is available. Thanks for all the details @joeydong 🏅

@ncreated ncreated closed this as completed Apr 8, 2020
@fddecc
Copy link

fddecc commented Apr 8, 2020

when I pull 1.0.2 and run carthage build --no-skip-current I still get

A shell task (/usr/bin/xcrun xcodebuild -project .../dd-sdk-ios/dependency-manager-tests/spm/SPMProject.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
xcodebuild: error: Unable to read project 'SPMProject.xcodeproj' from folder '.../dd-sdk-ios/dependency-manager-tests/spm'.
	Reason: Project .../dd-sdk-ios/dependency-manager-tests/spm/SPMProject.xcodeproj cannot be opened because it is missing its project.pbxproj file.

I feel like im missing something...

@ncreated
Copy link
Member

ncreated commented Apr 8, 2020

@00FA9A Please ensure that Carthage/Checkout/dd-sdk-ios does not contain old revision of our repo:

$ rm -rf Carthage/Checkouts/dd-sdk-ios/

Seems that Carthage doesn't remove it entirely before clone and SPMProject.xcodeproj which was removed in recent version of our SDK is still there.

@fddecc
Copy link

fddecc commented Apr 8, 2020

@ncreated thanks for pointing out the local checkout folder. I was clearing up global Carthage cache, but forgot to clean this up too

@fddecc
Copy link

fddecc commented Apr 10, 2020

@ncreated we get Missing required module '_Datadog_Private' error on builds if Carthage/Checkouts/dd-sdk-ios/Datadog/DatadogPrivate/ is not present

we rely on CarthageCache for our dependencies, which just caches Builds folder. basically, we are unable to build on CI or whenever actual checkout of DataDog is not present

@fddecc
Copy link

fddecc commented Apr 10, 2020

@ncreated is the above expected or should a separate issue be filed?

I've been able to repro easily by including a Carthage dependency in a simple project, removing Carthage/Checkouts/dd-sdk-ios/Datadog/DatadogPrivate and trying to build

@ncreated
Copy link
Member

Hey @00FA9A 👋. This sounds like a separate issue as vanilla Carthage installation works fine. I just opened #77 - we jump on this next 💪.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants