DataDog / datadog-ci

Use Datadog from your CI.
https://datadoghq.com
Apache License 2.0
119 stars 51 forks source link

Xcode cloud dSYMs upload using datadog-ci #1206

Open sladan-hedvig opened 4 months ago

sladan-hedvig commented 4 months ago

Bug description

I have added ci_post_xcodebuild.sh file in my project

#!/usr/bin/env bash

if [ "$CI_WORKFLOW" = "Release" ];
then
    mkdir build
    TMPDIR=build/datadog

    mkdir $TMPDIR

    curl -L --fail https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_darwin-x64 --output $TMPDIR/datadog-ci && chmod +x $TMPDIR/datadog-ci

    echo "Uploading Symbol"
    export DATADOG_SITE="datadoghq.eu"
    export DATADOG_API_KEY="${DATADOG_API_KEY}"
    build/datadog/datadog-ci dsyms upload $CI_ARCHIVE_PATH/dSYMs/
fi

Which should upload dSYMs files from the xcode cloud.

when it comes to executing this script it looks like this

Run command: 'cd /Volumes/workspace/repository/ci_scripts && CI_XCODEBUILD_EXIT_CODE=0 /Volumes/workspace/repository/ci_scripts/ci_post_xcodebuild.sh'

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

 52 72.3M   52 37.7M    0     0  27.5M      0  0:00:02  0:00:01  0:00:01 27.5M

100 72.3M  100 72.3M    0     0  37.6M      0  0:00:01  0:00:01 --:--:-- 62.5M

Uploading Symbol

Starting upload with concurrency 20. 

Will look for dSYMs in /Volumes/workspace/build.xcarchive/dSYMs/

Once dSYMs upload is successful files will be processed and ready to use within the next 5 minutes.

Will use temporary intermediate directory: build/datadog/869845565736001.9/datadog-ci/dsyms/intermediate

Will use temporary upload directory: build/datadog/869845565736001.9/datadog-ci/dsyms/upload

Internal Error: Command failed: zip -r 'build/datadog/869845565736001.9/datadog-ci/dsyms/upload/D9A29B22-21BC-31EF-B8D8-2E61FDA3EF6A.zip' 'ResourceBundledDependencies.framework.dSYM'

    at ChildProcess.exithandler (child_process.js:383:12)

    at ChildProcess.emit (events.js:400:28)

    at maybeClose (internal/child_process.js:1058:16)

    at Socket.<anonymous> (internal/child_process.js:443:11)

    at Socket.emit (events.js:400:28)

    at Pipe.<anonymous> (net.js:686:12)

Error
Command exited with non-zero exit-code: 1

Describe what you expected

I would expect that dSYMs are uploaded to the datadog.

Steps to reproduce the issue

No response

Additional context

Command

dsyms

siddarthkay commented 3 months ago

here is how I do it :

Below are the contents of ci_post_xcodebuild.sh

echo "===== upload to datadog phase ====="
npx @datadog/datadog-ci dsyms upload "${DWARF_DSYM_FOLDER_PATH}"

note : DATADOG_API_KEY is part of my environment variables in Xcode cloud.

rohdester commented 1 week ago

Did this get resolved? I am experiencing the same thing. @siddarthkay how are you using npx in a Xcode Cloud post build script?

siddarthkay commented 1 week ago

@rohdester : Back when I was experimenting with xcode-cloud :

echo "===== upload to datadog phase ====="
npx @datadog/datadog-ci dsyms upload "${DWARF_DSYM_FOLDER_PATH}"

in ios/ci_scripts/ci_post_xcodebuild.sh

and

echo "===== Installing Node.js using Homebrew ====="
brew install node

echo "===== Installing Yarn using Homebrew ====="
brew install yarn

in ios/ci_scripts/ci_post_clone.sh