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

Adding expo-datadog breaks my build on expo 49 #29

Closed
wcastand opened this issue Mar 6, 2024 · 10 comments · Fixed by #38
Closed

Adding expo-datadog breaks my build on expo 49 #29

wcastand opened this issue Mar 6, 2024 · 10 comments · Fixed by #38
Labels
bug Something isn't working

Comments

@wcastand
Copy link

wcastand commented Mar 6, 2024

I'm using expo sdk 49
my build fails on android and ios as soon as i try to add expo-datadog
I'm in a monorepo so according to the issue about monorepo i added the patch. #17

datadog works fine if i don't add expo-datadog or set to false the sourcemaps, dSym config options.

On ios it complains avec about minimum version being set to ios 11 when most dependencies and expo itself only support minimum version of 12 or 13.

It looks like i can build the app if i set to false all the sourcemaps and dSym config.
On android, i can build locally for dev but on eas it fails.

i tried to use expo-build-properties to force :

ios: { deploymentTarget: "13.0" },

but it didn't help no matter the order of the plugins.

Expo SDK: 49

"@datadog/mobile-react-native": "^2.2.0",
"expo-datadog": "^50.2.0",
"@datadog/datadog-ci": "^2.32.0",

plugins: [
		[
			"expo-build-properties",
			{
				android: { compileSdkVersion: 34 },
				ios: { deploymentTarget: "13.0" },
			},
		],
		[
			"expo-datadog",
			{
			  errorTracking: {
				iosDsyms: true,
				iosSourcemaps: true,
				androidSourcemaps: true,
				androidProguardMappingFiles: true,
			   },
			},
		],
		"expo-localization",
		// "sentry-expo",
		[
		  "expo-notifications",
		  {
		    icon: "./assets/images/notif_icon.png",
		    color: "#FFFFFF",
	           },
		],
		"expo-router",
		"./modules/google-pay-bank/app.plugin.js",
		[ "./plugins/intercom.plugin.js", IS_DEV ? {...} : {...} ],
		"./plugins/android-material.plugin.js",
		"./plugins/android-sentry-fix.plugin.js",
		"./plugins/android-secure-flag.plugin.js",
		"./plugins/android-storyly-fix.plugin.js",
		"@config-plugins/react-native-blob-util",
		"@config-plugins/react-native-pdf",
	],

on android the error is

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:uploadReleaseSourcemaps'.
> A problem occurred starting process 'command '/home/expo/workingdir/build/apps/mobile-app/node_modules/.bin/datadog-ci''

ios logs (they are so long they don't git into my terminal history so i just grabed the last bit, if you need more let me know but it's like really long)

    /bin/sh -c /Users/wcastand/Library/Developer/Xcode/DerivedData/GreenGotdev-dcaddrcjpsfyhxeskedwyqmoynhh/Build/Intermediates.noindex/GreenGotdev.build/Debug-iphonesimulator/GreenGotdev.build/Script-00DD1BFF1BD5951E006B06BC.sh
/Users/wcastand/Library/Developer/Xcode/DerivedData/GreenGotdev-dcaddrcjpsfyhxeskedwyqmoynhh/Build/Intermediates.noindex/GreenGotdev.build/Debug-iphonesimulator/GreenGotdev.build/Script-00DD1BFF1BD5951E006B06BC.sh: line 30: ../node_modules/.bin/datadog-ci: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'expo-dev-client' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogCore-DatadogPrivacyInfo' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'Storyly' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'lottie-ios' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'SentryPrivate' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'SPAlert' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'ReachabilitySwift' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'PLCrashReporter' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogInternal' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'MMKVCore' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'MMKV' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-keyboard-controller' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'ReactNativeAvoidSoftinput' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNFlashList' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-webview' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-pdf' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-mmkv' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-get-random-values' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-blob-util' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNSVG' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNGestureHandler' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNDateTimePicker' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'lottie-react-native' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'Sentry' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogWebViewTracking' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogTrace' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogRUM' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogLogs' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogCrashReporting' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogCore' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNSentry' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'DatadogSDKReactNative' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'storyly-react-native' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'react-native-skia' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNScreens' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNSecureRandom' from project 'Pods')
/Volumes/dev/retails/apps/mobile-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.4.99. (in target 'RNReanimated' from project 'Pods')
warning: Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
warning: Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXUpdates' from project 'Pods')
warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'GreenGotdev' from project 'GreenGotdev')
note: Run script build phase '[Expo] Configure project' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'GreenGotdev' from project 'GreenGotdev')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'GreenGotdev' from project 'GreenGotdev')
warning: Run script build phase 'Upload dSYMs to Datadog' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'GreenGotdev' from project 'GreenGotdev')


--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:81AC0CD3-6413-4F64-955C-9D4CDE239226, OS:17.4, name:iPhone 15 }
{ platform:iOS Simulator, id:81AC0CD3-6413-4F64-955C-9D4CDE239226, OS:17.4, name:iPhone 15 }
** BUILD FAILED **


The following build commands failed:
	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/wcastand/Library/Developer/Xcode/DerivedData/GreenGotdev-dcaddrcjpsfyhxeskedwyqmoynhh/Build/Intermediates.noindex/GreenGotdev.build/Debug-iphonesimulator/GreenGotdev.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'GreenGotdev' from project 'GreenGotdev')
(1 failure)
Build logs written to /Volumes/dev/retails/apps/mobile-app/.expo/xcodebuild.log```


Let me know if i can provide other things and missed something
@wcastand wcastand added the bug Something isn't working label Mar 6, 2024
@louiszawadzki
Copy link
Contributor

Hi @wcastand, thanks for reaching out!

expo-datadog versions are tied to a specific Expo SDK version since with for major Expo SDK version the sourcemaps generation might be working differently, so you should use version 49.0.1 if you are on Expo 49.

The error message you get means that the path to the mobile-app/node_modules/.bin/datadog-ci file is incorrect. This is what the patch is supposed to fix, and it's probably not applied since you are using a different expo-datadog version that the one the patch was made for.

Can you check if it's applied locally?
If not, I would recommend you to switch to expo-datadog version 49.0.1 and check again if the patch is applied.

@wcastand
Copy link
Author

wcastand commented Mar 6, 2024

will keep you inform but looks like i fixed the version and the path, now for some reason he says i don't have a valid api_key when it's the one from datadog application setup. So must have missed something.

if i still can't build after fixing this env thing, i'll comeback to you with hopefully more info :)

EDIT: i don't get why i check by console.log what the api key the script receive and it's the one from the datadog setup RUM page, but it sayds it's invalid so not sure what is happening

@louiszawadzki
Copy link
Contributor

louiszawadzki commented Mar 6, 2024

Hi @wcastand,

You indeed need to specify an API key to upload the sourcemaps to Datadog. We recommend to run eas secret:create to set DATADOG_API_KEY to your Datadog API key.

Note: This is an API key, which is different from the RUM application id. You can check our docs on how to get an API key.

If you have already done that and your key is still invalid, I would recommend you to reach out to our support team so they can have a look into what's wrong here.

@wcastand
Copy link
Author

wcastand commented Mar 6, 2024

hmm ok let me try but that's quite confusing :/
between the API KEY , APP ID and API KEY for uploading
should probably also add the expo version needs to be a match to the datadog package version because i don't remember seeing it mentioned(unless i missed it of course then my bad)

same for the patch for monorepo, it should probably be in the docs, a lot of expo app are on monorepo as far as i know.

let me try to setup that then

@wcastand
Copy link
Author

wcastand commented Mar 6, 2024

I think i fixed ios build but android is still failing on the sourcemaps

[RUN_GRADLEW] > Task :app:uploadReleaseSourcemaps FAILED
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] Exception raised during command execution, stderr=, stdout=
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Execution failed for task ':app:uploadReleaseSourcemaps'.
[RUN_GRADLEW] > A problem occurred starting process 'command '/private/var/folders/rz/_g_4f1k95bl68ld6_tjj4wt40000gn/T/eas-build-local-nodejs/08d11e9f-3642-40c1-9cbe-0a27c848205b/build/apps/mobile-app/node_modules/.bin/datadog-ci''

i don't know if it's the monorepo setup again that make the path fail. i can't find where yo modify the path since it's dynamic with

 `apply plugin: "com.facebook.react"\napply from: "${require("path").dirname(
        require.resolve("@datadog/mobile-react-native/package.json")
      )}/datadog-sourcemaps.gradle"`

and it looks like the issue is maybe in the datadog-ci cli and not the expo-datadog this time but not sure.

looks like it's looking for datadog-ci in mobile-app/node_modules instead of ../../node_modules

from what i see the issue is in
@datadog/mobile-react-native/datadog-sourcemaps.gradle

 def execCommand = { jsBundleFile ->
                return [
                        "$reactConfig.root/node_modules/.bin/datadog-ci",
                        "react-native",
                        "upload",
                        "--platform",
                        "android",
                        "--service",
                        serviceName,
                        "--bundle",
                        jsBundleFile.absolutePath,
                        "--sourcemap",
                        jsOutputSourceMapFile.absolutePath,
                        "--release-version",
                        releaseVersion,
                        "--build-version",
                        buildVersion
                ]
            }

looks like $reactConfig.root is coming from getReactConfig which use
reactConfig['root'] = project.extensions.react.root.get() ?: "../../"

but it seems to return the wrong path, getting : /build/apps/mobile-app/node_modules/.bin/datadog-ci'' instead of /build/node_modules/.bin/datadog-ci''

looking at how sentry is doing it, in the plugin for expo they add a their cli path as a project.ext to get the right absolute path it seems.

in my bbuild.gradle generated by expo i have this from sentry-expo
project.ext.sentryCli=[collectModulesScript: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../dist/js/tools/collectModules.js")]

which i assumed give the right path to use for the script later on when it comes to uploading sourcemaps in android. maybe you need to do something similar to handle monorepo in android expo app

@louiszawadzki
Copy link
Contributor

Hi @wcastand, thanks for taking the time to investigate into this, I think what you describe is very likely the root cause.

I believe we should handle monorepo setups for Expo apps better, I'll bump the priority for this in our backlog. The approach from Sentry seems like a good one indeed, thanks for looking into it!

However we likely won't have the bandwidth to prioritize this straight away, so to get you unblocked in the meantime, can you try to apply this patch to @datadog/mobile-react-native as @datadog+mobile-react-native+2.2.0.patch?

diff --git a/node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle b/node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle
index 8d61d71..c4e29e1 100644
--- a/node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle
+++ b/node_modules/@datadog/mobile-react-native/datadog-sourcemaps.gradle
@@ -57,7 +57,7 @@ afterEvaluate {
 
             def execCommand = { jsBundleFile ->
                 return [
-                        "$reactConfig.root/node_modules/.bin/datadog-ci",
+                        "$reactConfig.root/../../node_modules/.bin/datadog-ci",
                         "react-native",
                         "upload",
                         "--platform",

Let me know if that unblocks you, that would also validate the root cause of the issue at the same time :)

@wcastand
Copy link
Author

wcastand commented Mar 7, 2024

@louiszawadzki i can confirm, this fixes the issue on eas, i managed to build without fail once i made the patch.

@wcastand
Copy link
Author

wcastand commented Mar 7, 2024

worth noting just in case, for ios the path change was a bit different than the one you proposed in the other issue for me it was
../../../node_modules and not ../../node_modules

because there is the ios folder too in that case.

so it would depend on people setup for sure, can't be an constant or absolute value anymore if you want to handle monorepos

@navignaw
Copy link

navignaw commented May 29, 2024

Ran into the exact same issue and confirmed it was fixed by a similar patch, although my directory structure was slightly different from @wcastand 's. We use yarn workspaces, and recently upgraded from yarn classic to yarn berry. It looks like the .bin/datadog-ci script was being hoisted into the root node_modules rather than the workspace's node_modules.

It seems like a long-term fix needs to be smart enough to traverse up the workspace tree to figure out where to find the datadog-ci binary. For yarn users, you could run yarn bin datadog-ci which prints out the absolute path to the binary, but this probably wouldn't work for pnpm or other package managers.

Edit: unfortunately am running into a similar issue for iOS, trying to find the same place where it's being modified:

/Users/expo/Library/Developer/Xcode/DerivedData/<MyProject>/Build/Intermediates.noindex/ArchiveIntermediates/<MyProject>/IntermediateBuildFilesPath/<MyProject>.build/Release-iphoneos/<MyProject>.build/Script-00DD1BFF1BD5951E006B06BC.sh: line 41: ../node_modules/.bin/datadog-ci: No such file or directory

@marco-saia-datadog
Copy link
Member

Hi @navignaw

Sorry for the long wait!

We are addressing the issue in this PR: #38

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

Successfully merging a pull request may close this issue.

4 participants