Skip to content

Xcode 26.4b1/b2/b3/RC • FMT Compile Errors (it needs upgrading) • REPRO **IS** included despite the erroneous label #55601

Description

@Brett-Best

Description

FMT needs upgrading so that it will compile with Xcode 26.4b1.

I modified the FMT and RCT-Folly pod specs to use 12.1.0 and the compilation succeeded.

I am not 100% sure but I'm suspecting this fmtlib/fmt#4065 may be the fix for the problem.

We currently depend on the legacy architecture so would be hoping this fix would qualify for an 0.81.x release.

NOTE: I did not need to fork the reproducer or use as a template because no changes were required to produce the problem.

Steps to reproduce

  1. npm install
  2. cd ReproducerApp/ios
  3. pod install
  4. DEVELOPER_DIR=/Applications/Xcode\ 26.4b1.app/Contents/Developer/ xed .
  5. Select the simulator and build

React Native Version

0.83.1

Affected Platforms

Build - MacOS

Output of npx @react-native-community/cli info

brettbest@Bretts-MacBook-Pro ~/D/r/ReproducerApp (main)> DEVELOPER_DIR=/Applications/Xcode\ 26.4b1.app/Contents/Developer/ npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: macOS 26.4
  CPU: (12) arm64 Apple M2 Pro
  Memory: 144.23 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.13.0
    path: /Users/brettbest/.local/share/mise/installs/node/24.13.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.6.2
    path: /Users/brettbest/.local/share/mise/installs/node/24.13.0/bin/npm
  Watchman:
    version: 2026.01.12.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.4
      - iOS 26.4
      - macOS 26.4
      - tvOS 26.4
      - visionOS 26.4
      - watchOS 26.4
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 26.4/17E5159k
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 25.0.2
    path: /opt/homebrew/opt/openjdk/bin/javac
  Ruby:
    version: 3.3.0
    path: /Users/brettbest/.local/share/mise/installs/ruby/3.3.0/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.1
    wanted: 0.83.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.84.0 is now available (your project is running on v0.83.1).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.84.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.83.1&to=0.84.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

/Users/brettbest/Developer/reproducer-react-native/ReproducerApp/ios/Pods/fmt/include/fmt/format-inl.h:59:24 Call to consteval function 'fmt::basic_format_string<char, fmt::basic_string_view<char> &, const char (&)[3]>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression

/Users/brettbest/Developer/reproducer-react-native/ReproducerApp/ios/Pods/fmt/include/fmt/format-inl.h:60:22 Call to consteval function 'fmt::basic_format_string<char, const char (&)[7], int &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression

/Users/brettbest/Developer/reproducer-react-native/ReproducerApp/ios/Pods/fmt/include/fmt/format-inl.h:1387:35 Call to consteval function 'fmt::basic_format_string<char, unsigned int &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression

/Users/brettbest/Developer/reproducer-react-native/ReproducerApp/ios/Pods/fmt/include/fmt/format-inl.h:1391:33 Call to consteval function 'fmt::basic_format_string<char, unsigned int &>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression

/Users/brettbest/Developer/reproducer-react-native/ReproducerApp/ios/Pods/fmt/include/fmt/format-inl.h:1394:33 Call to consteval function 'fmt::basic_format_string<char, int>::basic_format_string<FMT_COMPILE_STRING, 0>' is not a constant expression

MANDATORY Reproducer

https://github.com/Brett-Best/rn-fmt-reproducer

Screenshots and Videos

Image

Activity

  1. react-native-bot commented on Feb 18, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  2. Brett-Best commented on Feb 18, 2026

    @Brett-Best
    Author

    See https://github.com/Brett-Best/rn-fmt-reproducer which is a direct clone of the template since no changes were needed to reproduce the problem. Hopefully this pleases the bot.

  3. changed the title [-]Xcode 26.4b1 • FMT Compile Errors (it needs upgrading)[/-] [+]Xcode 26.4b1 • FMT Compile Errors (it needs upgrading) • REPRO **IS** included despite the erroneous label[/+] on Feb 18, 2026
  4. bennettp123 commented on Feb 20, 2026

    @bennettp123

    Worth mentioning: I wasn't able to reproduce this after priming the build cache using Xcode 26.3.

    It was reproducible after clearing build cache, or running the following:

    touch ios/Pods/fmt/src/**/* ios/Pods/fmt/include/**/*

    Edit: also, my project builds fine after updating fmt to 12.1.0

  5. bennettp123 commented on Feb 26, 2026

    @bennettp123

    Still reproducible in Xcode 26.4 beta 2.

  6. changed the title [-]Xcode 26.4b1 • FMT Compile Errors (it needs upgrading) • REPRO **IS** included despite the erroneous label[/-] [+]Xcode 26.4b1/b2 • FMT Compile Errors (it needs upgrading) • REPRO **IS** included despite the erroneous label[/+] on Feb 26, 2026
  7. Brett-Best commented on Mar 12, 2026

    @Brett-Best
    Author
  8. leotm commented on Mar 12, 2026

    @leotm
    Contributor

    works for me after disabling iOS bins w RCT_USE_PREBUILT_RNCORE=0 bundle exec pod install which strips

      - React-Core-prebuilt (0.84.1):
        - ReactNativeDependencies

    including all transitive

        - React-Core-prebuilt

    and updates most of the spec checksums

  9. 26 remaining items

  10. Iuriy-Budnikov commented on Apr 6, 2026

    @Iuriy-Budnikov

    RN 0.78.3 helped

    # TODO: remove it later
    # Bump fmt version to 12.1.0 to avoid build failure with Xcode 16.4+
    # Patch all react-native podspecs that pin fmt to 11.0.2 before CocoaPods resolves dependencies
    rn_path = File.join(__dir__, '..', 'node_modules', 'react-native')
    Dir.glob(File.join(rn_path, '**', '*.podspec')).each do |podspec_path|
      content = File.read(podspec_path)
      if content.include?('"fmt", "11.0.2"') || (podspec_path.end_with?('fmt.podspec') && content.include?('"11.0.2"'))
        content.gsub!('"fmt", "11.0.2"', '"fmt", "12.1.0"')
        content.gsub!(/"11\.0\.2"/, '"12.1.0"') if podspec_path.end_with?('fmt.podspec')
        File.write(podspec_path, content)
      end
    end
    
  11. zhouxlin commented on Apr 15, 2026

    @zhouxlin

    rn: 0.81.4
    xcode: 26.4
    AI fixed with adding this on Podfile;

       installer.pods_project.targets.each do |target|
          if target.name == 'fmt'
            target.build_configurations.each do |config|
              config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
            end
          end
        end
    

    But i think i need to upgrade rn.

  12. ambadah commented on Apr 27, 2026

    @ambadah

    rn: 0.81.4 xcode: 26.4 AI fixed with adding this on Podfile;

       installer.pods_project.targets.each do |target|
          if target.name == 'fmt'
            target.build_configurations.each do |config|
              config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
            end
          end
        end
    

    But i think i need to upgrade rn.

    I tried this, then build work fine :)

    post_install do |installer|
        # Fix fmt 11.0.2 consteval errors with Xcode 26 / Clang 17+.
        # base.h unconditionally `#define`s FMT_USE_CONSTEVAL inside its detection
        # chain, so a -D flag is overwritten. Patch the header to force it to 0.
        fmt_base_h = "#{Pod::Config.instance.installation_root}/Pods/fmt/include/fmt/base.h"
        if File.exist?(fmt_base_h)
          text = File.read(fmt_base_h)
          marker = '// FMT_USE_CONSTEVAL override for Xcode 26 / Clang 17+'
          if text.include?(marker)
            puts "ℹ️ fmt/base.h already patched"
          else
            needle = "#if FMT_USE_CONSTEVAL\n#  define FMT_CONSTEVAL consteval"
            raise "fmt/base.h structure unexpected; cannot patch FMT_USE_CONSTEVAL" unless text.include?(needle)
            replacement = "#{marker}\n#undef FMT_USE_CONSTEVAL\n#define FMT_USE_CONSTEVAL 0\n#{needle}"
            File.write(fmt_base_h, text.sub(needle, replacement))
            puts "🔧 Patched fmt/base.h to force FMT_USE_CONSTEVAL=0"
          end
        else
          puts "ℹ️ fmt/base.h not found (skipping consteval patch)"
        end
    end
    
  13. added a commit that references this issue on May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions