rive-app / rive-ios

iOS runtime for Rive
MIT License
512 stars 58 forks source link

Release 5.11.4 causes build failures due to naming collision #315

Open jonahgrant opened 5 months ago

jonahgrant commented 5 months ago

Description

Release 5.11.4's updated Package.swift.template has two targets with the same name. This causes workflows of projects using rive-ios to fail.

Provide a Repro

With 5.11.4 in a project's packages, archiving it locally and running an xcodebuild Github workflow causes a failure.

Run scheme_list=$(xcodebuild -list -json | tr -d "\n")
2024-05-13 18:53:51.809 xcodebuild[2832:1[7](https://github.com/mongoosehq/ios/actions/runs/9068255434/job/24915134902#step:3:8)283] Writing error result bundle to /var/folders/3m/p59k4qdj0f17st0gn2cmj3640000gn/T/ResultBundle_2024-13-05_18-53-0051.xcresult
xcodebuild: error: Could not resolve package dependencies:
  duplicate target named 'RiveRuntime'

Workflow file:

name: Xcode - Build and Analyze

on: [push, pull_request]

jobs:
  build:
    name: Build and analyse default scheme using xcodebuild command
    runs-on: macos-14

    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set Default Scheme
        run: |
          scheme_list=$(xcodebuild -list -json | tr -d "\n")
          default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]")
          echo $default | cat >default
          echo Using default scheme: $default
      - name: Build
        env:
          scheme: ${{ 'default' }}
        run: |
          if [ $scheme = default ]; then scheme=$(cat default); fi
          if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
          file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
          sudo xcode-select -s /Applications/Xcode_15.2.app
          xcodebuild clean build analyze -scheme "$scheme" -"$filetype_parameter" "$file_to_build" | exit ${PIPESTATUS[0]}
      - name: Test
        env:
          scheme: ${{ 'default' }}
        run: |
          if [ $scheme = default ]; then scheme=$(cat default); fi
          if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi
          file_to_build=`echo $file_to_build | awk '{$1=$1;print}'`
          sudo xcode-select -s /Applications/Xcode_15.2.app
          xcodebuild test -scheme "$scheme" -"$filetype_parameter" "$file_to_build" | exit ${PIPESTATUS[0]}

Additional context

We've reverted to version 5.11.3 which resolved these failures.

philter commented 5 months ago

@jonahgrant Build 5.11.6 should resolve this build error.

dskuza commented 2 months ago

@jonahgrant Has this been resolved for you?

georgmay commented 2 weeks ago

Got the same crash today