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

hermes macCatalyst framework signing issue ("bundle format is ambiguous") in 0.75.0-rc.5 #390

Closed
mikehardy opened this issue Jul 18, 2024 · 4 comments
Assignees

Comments

@mikehardy
Copy link

Old Version

0.75.0-rc.2

New Version

0.75.0-rc.3+ ?

Description

I am unable to run my typical react-native-firebase release qualification script to completion as it fails to build macCatalyst with a signing issue.

It appeared to work in 0.75.0-rc.3 I thought, it appears to fail first in 0.75.0-rc.5, however my test results are very confusing.
Specifically, I believe this worked in 0.75.0-rc.2 and rc.3 but after attempting a build with 0.75.0-rc.5 I can no longer get it to work, so perhaps there is some state that is corrupted between runs related to hermes and it's downloaded tarball?

Note that this is macCatalyst, which is "sort of" iOS, it is not really macos (that is, it is not react-native-macos)
You will need to have an Apple Developer Account and certificate installed on your machine to test this.

Steps to reproduce

I have a build reproducer for react-native-firebase that I use to demonstrate how builds should work for end users, and also to pre-qualify react-native RCs. I have a branch for rn75, so you should clone it and run it:

  • git clone [email protected]:mikehardy/rnfbdemo
  • cd rnfbdemo
  • git checkout rn75
  • XCODE_DEVELOPMENT_TEAM=2W4T2B656C ./make-demo.sh (but replace with your own development team that you have a valid certificate installed for...)

It will first run iOS in debug and Release mode, then it will attempt to do the macCatalyst build
(it will continue and also do android debug and release - feel free to comment all of that out and just focus on macCatalyst if you like)

Affected Platforms

Other (please specify)

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M2
  Memory: 88.20 MB / 16.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 18.20.3
    path: ~/.nvm/versions/node/v18.20.3/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v18.20.3/bin/yarn
  npm:
    version: 10.8.1
    path: ~/.nvm/versions/node/v18.20.3/bin/npm
  Watchman:
    version: 2024.07.08.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/mike/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.23
    path: /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin//javac
  Ruby:
    version: 3.3.3
    path: /Users/mike/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 19.0.0-rc-fb9a90fa48-20240614
    wanted: 19.0.0-rc-fb9a90fa48-20240614
  react-native:
    installed: 0.75.0-rc.5
    wanted: 0.75.0-rc.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

npm notice
npm notice New patch version of npm available! 10.8.1 -> 10.8.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.2
npm notice To update run: npm install -g [email protected]
npm notice

Stacktrace or Logs

I'll attach the full build log in case that is useful but here is the important part



PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Intermediates.noindex/rnfbdemo.build/Debug-maccatalyst/rnfbdemo.build/Script-00EEFC60759A1932668264C0.sh (in target 'rnfbdemo' from project 'rnfbdemo')
    cd /Users/mike/work/invertase/rnfbdemo/rnfbdemo/ios
    /bin/sh -c /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Intermediates.noindex/rnfbdemo.build/Debug-maccatalyst/rnfbdemo.build/Script-00EEFC60759A1932668264C0.sh

mkdir -p /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks
rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/hermes-engine/Pre-built/hermes.framework" "/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks"
building file list ... done
hermes.framework/
hermes.framework/hermes

sent 13566934 bytes  received 48 bytes  27133964.00 bytes/sec
total size is 40697160  speedup is 3.00
Stripped /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework/hermes of architectures: x86_64
Code Signing /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework with Identity Apple Development: Mike Hardy (U38P8Z7KJ4)
/usr/bin/codesign --force --sign 35F4FEA979570C1B891C53872B9F9BB1FFB7A65E  --preserve-metadata=identifier,entitlements '/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework'
/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework: replacing existing signature
/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework: bundle format is ambiguous (could be app or framework)
Command PhaseScriptExecution failed with a nonzero exit code

mkdir -p /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks

rsync --delete -av --filter P .*.?????? --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/XCFrameworkIntermediates/hermes-engine/Pre-built/hermes.framework" "/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks"

building file list ... done

hermes.framework/

hermes.framework/hermes



sent 13566934 bytes  received 48 bytes  27133964.00 bytes/sec

total size is 40697160  speedup is 3.00

Stripped /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework/hermes of architectures: x86_64

Code Signing /Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework with Identity Apple Development: Mike Hardy (U38P8Z7KJ4)

/usr/bin/codesign --force --sign 35F4FEA979570C1B891C53872B9F9BB1FFB7A65E  --preserve-metadata=identifier,entitlements '/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework'

/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework: replacing existing signature

/Users/mike/Library/Developer/Xcode/DerivedData/rnfbdemo-gsuyjvwnbefbzvbfqtovnhthepew/Build/Products/Debug-maccatalyst/rnfbdemo.app/Contents/Frameworks/hermes.framework: bundle format is ambiguous (could be app or framework)

Command PhaseScriptExecution failed with a nonzero exit code

Build target React-RCTAppDelegate
Build target Pods-rnfbdemo


Activity Log Complete    7/18/24, 5:13 PM    35.3 seconds


### Reproducer

https://github.com/mikehardy/rnfbdemo/blob/rn75/make-demo.sh

### Screenshots and Videos

_No response_
@mikehardy
Copy link
Author

Build rnfbdemo_2024-07-18T17-13-10.txt

That's the build log.

I'm going to attempt to re-do a build on rc.2 (which I remember working for macCatalyst but with some patches for iOS config scripts in react-native-config.js as used in react-native-firebase) and get it to succeed then fail again on rc.5 so I can prove this is reproducible

In the meantime if anyone else can successfully do repeated builds of macCatalyst and report, that would be informative

@cipolleschi
Copy link
Collaborator

Hi Mike, I'm trying to repro this, but so far I couldn't.

The steps I'm following:

  • created a new app from 0.75
  • build&run Catalyst - Debug: worked
  • build&run Catalyst - Release: worked
  • build&run iOS - Release: worked
  • build&run iOS - Debug: worked
  • switched back to Catalyst - Debug: worked
  • build&run Catalyst - Release: worked
  • Cleaned with + + k
  • build&run Catalyst - Debug: worked
  • build&run Catalyst - Release: worked

Do you know if perhaps something changed in Firebase?
Could it be that you have some dirty cache?

@cipolleschi cipolleschi moved this from Inbox to Needs Confirmation in React Native 0.75 Releases Jul 22, 2024
@mikehardy
Copy link
Author

I suspect this must be local then, as I feared. I work pretty hard to be repeatable+reproducible but this won't be the first time some local thing has crept in. Will continue checking on my side - haven't had a chance since initial post

@cipolleschi
Copy link
Collaborator

Closing as not reproducible on my end. Let's reopen if we have a better repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done / Picked
Development

No branches or pull requests

2 participants