react-native-community / react-native-circleci-orb

A CircleCI Orb to Simplify Testing your React Native App
MIT License
174 stars 81 forks source link

Cache fails on ios_build #165

Closed alexborton closed 7 months ago

alexborton commented 1 year ago

Orb version

react-native-community/react-native@7.1.1

What happened

When the cache is enabled on ios_build (true by default) it fails every time with;

error computing cache key: template: cacheKey:1:30: executing "cacheKey" at <checksum "~/.tmp/checksumfiles/package.json">: error calling checksum: open /Users/distiller/.tmp/checksumfiles/package.json: no such file or directory

Example job;

orbs:
  rn: react-native-community/react-native@7.1.1

...

  build_ios:
    executor: macos_executor

    steps:
      - attach_workspace:
          at: .
      - set_env_config:
          env: ci
      - run:
          name: Yarn Zero Install
          command: yarn install
      - rn/pod_install
      - rn/ios_build:
          build_configuration: 'Release'
          derived_data_path: 'ios/build'
          device: 'iPhone 11'
          project_path: 'ios/native.xcworkspace'
          project_type: workspace
          scheme: 'native'
      - persist_to_workspace:
          root: .
          paths:
            - ios/build/Build/Products/*

on both restore and save actions.

Expected behavior

Should save and restore from cache as expected.

fotos commented 1 year ago

@alexborton the ios_build command “depends” on yarn_install for the checksums.

Since you are running a “custom” yarn install, instead of rn/yarn_install, you can disable the cache for the ios_build command by using the cache: false parameter.

fotos commented 7 months ago

Closing this as stale. Feel free to reopen if there issue persists.