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

Xcode 16.1 - macOS 15 - build failed #2693

Open
salvatoreboemia opened this issue Jan 14, 2025 · 3 comments
Open

Xcode 16.1 - macOS 15 - build failed #2693

salvatoreboemia opened this issue Jan 14, 2025 · 3 comments

Comments

@salvatoreboemia
Copy link

Hi until two months ago everything was working fine.

Suddenly it stopped working. here is my YAML and some logs

- name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        languages: swift
        build-mode: manual
        tools: latest
    - if: matrix.build-mode == 'manual'
      shell: bash
      run: |
        echo "Building project manually..."
        xcodebuild -workspace MyApp.xcworkspace \
        -scheme MyApp \
        -destination "platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1" \
        clean build --verbose | xcbeautify --renderer github-actions

Logs:

debug: false
Job run UUID is 2da9b11a-c96e-4c2d-8fb4-5c6861dbd930.
/usr/bin/csrutil status
System Integrity Protection status: disabled.
Setup CodeQL tools
  /usr/bin/tar --version
  bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8 
  Found bsd tar version 3.5.3.
  'tools: latest' was requested, so using CodeQL version 2.20.1, the version shipped with the Action.
  Warning: `tools: latest` has been renamed to `tools: linked`, but the old name is still supported. No action is required.
  Did not find CodeQL tools version 2.20.1 in the toolcache.
  Using CodeQL CLI version 2.20.1 sourced from https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.1/codeql-bundle-osx64.tar.zst .
  Downloading CodeQL tools from https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.20.1/codeql-bundle-osx64.tar.zst . This may take a while.
  Finished downloading CodeQL bundle to /Users/runner/work/_temp/0ecd4510-1cf6-4736-9e8b-2a80a28490cd (15.2s).
  Extracting CodeQL bundle.
  tar -x --zstd -f /Users/runner/work/_temp/0ecd4510-1cf6-4736-9e8b-2a80a28490cd -C /Users/runner/work/_temp/b087463c-5803-4f52-9c42-893c1eab815c
  Finished extracting CodeQL bundle to /Users/runner/work/_temp/b087463c-5803-4f52-9c42-893c1eab815c (10.6s).
  Added CodeQL bundle to the tool cache (26.3s).
  /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/codeql version --format=json
  {
    "productName" : "CodeQL",
    "vendor" : "GitHub",
    "version" : "2.20.1",
    "sha" : "0dc816df5f02b3bcb09fa880c0a76367727585ff",
    "branches" : [
      "codeql-cli-2.20.1"
    ],
    "copyright" : "Copyright (C) 2019-2025 GitHub, Inc.",
    "unpackedLocation" : "/Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql",
    "configFileLocation" : "/Users/runner/.config/codeql/config",
    "configFileFound" : false,
    "features" : {
      "analysisSummaryV2Default" : true,
      "buildModeOption" : true,
      "bundleSupportsIncludeDiagnostics" : true,
      "bundleSupportsIncludeLogs" : true,
      "databaseInterpretResultsSupportsSarifRunProperty" : true,
      "featuresInVersionResult" : true,
      "indirectTracingSupportsStaticBinaries" : false,
      "informsAboutUnsupportedPathFilters" : true,
      "supportsPython312" : true,
      "mrvaPackCreate" : true,
      "threatModelOption" : true,
      "traceCommandUseBuildMode" : true,
      "v2ramSizing" : true,
      "mrvaPackCreateMultipleQueries" : true,
      "setsCodeqlRunnerEnvVar" : true,
      "sarifMergeRunsFromEqualCategory" : true,
      "forceOverwrite" : true,
      "generateSummarySymbolMap" : true,
      "pythonDefaultIsToNotExtractStdlib" : true
    }
  }
Validating workflow
  Detected no issues with the code scanning workflow.

Package install location: /Users/runner/.codeql/packages
Nothing downloaded.
Calculating baseline information in /Users/runner/work/my-repo/my-repo
Running command in /Users/runner/work/my-repo/my-repo: [/Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/javascript/tools/configure-baseline.sh]
Calculated baseline information for languages: c, javascript, python, ruby, swift (609ms).
Resolving extractor swift.
Successfully loaded extractor Swift (swift) from /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/swift.
Created skeleton CodeQL database at /Users/runner/work/_temp/codeql_databases/swift. This in-progress database is ready to be populated by an extractor.

Run LOGS:

Run echo "Building project manually..."
  echo "Building project manually..."
  xcodebuild -workspace MyApp.xcworkspace \
  -scheme MyApp \
  -destination "platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1" \
  build | xcbeautify --renderer github-actions
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    CODEQL_ACTION_FEATURE_MULTI_LANGUAGE: false
    CODEQL_ACTION_FEATURE_SANDWICH: false
    CODEQL_ACTION_FEATURE_SARIF_COMBINE: true
    CODEQL_ACTION_FEATURE_WILL_UPLOAD: true
    CODEQL_ACTION_VERSION: 3.28.1
    JOB_RUN_UUID: 2da9b11a-c96e-4c2d-8fb4-5c6861dbd930
    CODEQL_ACTION_INIT_HAS_RUN: true
    CODEQL_ACTION_IS_SIP_ENABLED: false
    CODEQL_ACTION_ANALYSIS_KEY: .github/workflows/CodeQLAdvanced.yml:analyze
    CODEQL_WORKFLOW_STARTED_AT: 2025-01-14T15:25:01.448Z
    CODEQL_RAM: 13004
    CODEQL_THREADS: 6
    CODEQL_SCRATCH_DIR: /Users/runner/work/_temp/codeql_databases/working
    CODEQL_VERBOSITY: warnings
    CODEQL_DIST: /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql
    CODEQL_PLATFORM: osx64
    CODEQL_PLATFORM_DLL_EXTENSION: .dylib
    CODEQL_JAVA_HOME: /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/tools/osx64/java-aarch64
    CODEQL_EXTRACTOR_SWIFT_ROOT: /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/swift
    CODEQL_EXTRACTOR_SWIFT_WIP_DATABASE: /Users/runner/work/_temp/codeql_databases/swift
    CODEQL_EXTRACTOR_SWIFT_DIAGNOSTIC_DIR: /Users/runner/work/_temp/codeql_databases/swift/diagnostic/extractors/swift
    CODEQL_EXTRACTOR_SWIFT_LOG_DIR: /Users/runner/work/_temp/codeql_databases/swift/log
    CODEQL_EXTRACTOR_SWIFT_SCRATCH_DIR: /Users/runner/work/_temp/codeql_databases/swift/working
    CODEQL_EXTRACTOR_SWIFT_TRAP_DIR: /Users/runner/work/_temp/codeql_databases/swift/trap/swift
    CODEQL_EXTRACTOR_SWIFT_SOURCE_ARCHIVE_DIR: /Users/runner/work/_temp/codeql_databases/swift/src
    CODEQL_EXTRACTOR_SWIFT_BUILD_MODE: manual
    CODEQL_EXTRACTOR_SWIFT_THREADS: 6
    CODEQL_EXTRACTOR_SWIFT_RAM: 13004
    CODEQL_TRACER_LOG: /Users/runner/work/_temp/codeql_databases/log/build-tracer.log
    CODEQL_TRACER_DIAGNOSTICS_DIR: /Users/runner/work/_temp/codeql_databases/diagnostic/tracer
    SEMMLE_COPY_EXECUTABLES_ROOT: /Users/runner/work/_temp/codeql_databases/working/copy-root
    CODEQL_TOOL_PATH: /opt/homebrew/lib/ruby/gems/3.3.0/bin:/opt/homebrew/opt/[email protected]/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools
    CODEQL_TRACER_LANGUAGES: swift
    SEMMLE_PRELOAD_libtrace: /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/tools/osx64/libtrace.dylib
    CODEQL_RUNNER: /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/tools/osx64/runner
    DYLD_INSERT_LIBRARIES: /Users/runner/hostedtoolcache/CodeQL/2.20.1/arm64/codeql/tools/osx64/libtrace.dylib
Building project manually...
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:76A85DF1-6BE9-4303-96BE-E5C1846ACAD9, OS:18.1, name:iPhone 16 Pro }
{ platform:iOS Simulator, id:76A85DF1-6BE9-4303-96BE-E5C1846ACAD9, OS:18.1, name:iPhone 16 Pro }

ERROR:

2025-01-14T15:58:31.4807620Z The following build commands failed:
2025-01-14T15:58:31.4929100Z 	AppIntentsSSUTraining (in target 'NotificationVideoContent' from project 'MyApp')
2025-01-14T15:58:33.1519120Z 	Building workspace MyApp with scheme MyApp
2025-01-14T15:58:33.1620800Z (2 failures)

never seen this error before and no other workflow (that work without problems)

PS: I use the same xcode build command in other workflows (like Sonarqube) and it works without errors

Can you tell me how I can fix it?

Thanks

@redsun82
Copy link
Contributor

👋 @salvatoreboemia I'm sorry to hear that you're having problems. I'm guessing your last successful run from a couple of months ago was not with Xcode 16, right? Could you provide the files or excerpts thereof of the build_tracer.log files in the databases produced by the successful and failed runs?

@salvatoreboemia
Copy link
Author

👋 @salvatoreboemia I'm sorry to hear that you're having problems. I'm guessing your last successful run from a couple of months ago was not with Xcode 16, right? Could you provide the files or excerpts thereof of the build_tracer.log files in the databases produced by the successful and failed runs?

Thanks for your quick help

Yes exactly, the problem only arose with Xcode 16.x, unfortunately, I can't use (not even for testing) Xcode 15.4 because in the code there are many "if available iOS 18" so Xcode 16.x is mandatory

I tried to upload the artifact in this way

....
....
....
 -destination "platform=iOS Simulator,name=iPhone 16 Pro,OS=18.1" \
        clean build -verbose | xcbeautify --renderer github-actions
      continue-on-error: true

    - name: Upload build_tracer.log
      if: ${{ always() }}
      uses: actions/upload-artifact@v4
      with:
        name: build_tracer-log
        path: $CODEQL_EXTRACTOR_SWIFT_DIAGNOSTIC_DIR/build_tracer.log

But I got this

Warning: No files were found with the provided path: $CODEQL_EXTRACTOR_SWIFT_DIAGNOSTIC_DIR/build_tracer.log. No artifacts will be uploaded.

Probably is know issue, in this closed issue -> #2506 (comment)

Thanks

@redsun82
Copy link
Contributor

@salvatoreboemia sorry, I might have been a bit too hasty writing my previous reply, and did not get into all necessary details.

The correct env variable for the directory containing the build_tracer.log file is CODEQL_EXTRACTOR_SWIFT_LOG_DIR. You can probably upload the whole directory. That said, you can't pass env variables directly to actions like that with bash variable syntax, but (untested) path: ${{ env.CODEQL_EXTRACTOR_SWIFT_LOG_DIR }} should work.

In any case, it does indeed seem related to what was reported in #2506 (comment).

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

No branches or pull requests

2 participants