Tuist Cache CAS error in Github Actions

Hello there and Merry Christmas,
I’m setting up a new side project and use the latest Tuist version 4.115.1 . I have an issue where the Github Action is stuck when running tuist test

Warning: CAS error: deadlineExceeded(connectionError: Optional(connect(descriptor:addr:size:): No such file or directory (errno: 2)))note: cache key query failed

In my Tuist.swift, I have

let tuist = Tuist(
    fullHandle: "myorg/tuist-app",
    project: .tuist(
        generationOptions: .options(
            enableCaching: true
        )
    )
)

If I set enableCaching: false, the test run and the selective testing works :+1:

GH Action Log:

Generating project OCFoundation
Generating project MyApp
There are no tests to run, finishing early
Uploading run metadata...

but I get the message basically telling me that I should set the property to true:

GH Action Log:

Run tuist setup cache
Tuist Cache setup is almost complete!

To enable caching for this project, set the enableCaching property in your Tuist.swift file to true:

My Github workflow yaml is

name: Test

env:
  TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}
  
on:
  pull_request:
    branches:
      - '*'
jobs:
  test:
    permissions:
      contents: read
      id-token: write

    name: Run Tuist Tests
    runs-on: macos-26
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      
      - name: Install mise
        uses: jdx/mise-action@v2
      
      - name: Install tools
        run: mise install
      
      - run: tuist auth login
      - run: tuist setup cache
      
      - name: Generate Tuist project
        run: tuist generate --no-open

      - name: Run tests
        run: tuist test 

and I did set the TUIST_TOKEN secret in my repo as per docs

brw, does enableCaching mean

true → use Xcode cache caching system
false → use Tuist module caching system

?

thanks in advance,

Jan

Hey,

enableCaching is exclusively for the Xcode Cache. You can use both the Xcode Cache and Module Cache simultaneously – or just one of these, depends on your preferences.

Warning: CAS error: deadlineExceeded(connectionError: Optional(connect(descriptor:addr:size:): No such file or directory (errno: 2)))note: cache key query failed

This is expected if set enableCaching: true without running tuist setup cache. The Xcode Cache needs to have a local socket running which is started as part of the setup command.

Ahoj Marku :slight_smile:

My Github Action yaml does have a tuist setup cache though.

I noticed this message on the CI though

Run tuist setup cache
Tuist Cache has been enabled 🎉
Uploading run metadata…
Failed to upload run metadata: forbidden("<my tuist handle> is not authorized to create run")

Are you then getting the deadlineExceeded warnings when enableCaching is set to true?

This is not the latest version – did you mean 4.118.1?

Additionally, are you able to reproduce the issue locally?

oh wait .. I was indeed using 4.115.1 :man_facepalming: :man_facepalming: I updated to 4.118.1

Additionally, are you able to reproduce the issue locally?

Nope, only on the CI.

Now I get another error

Failed to upload run metadata: forbidden("<my-tuist-user> is not authorized to create run")
✖ Error 
<my-tuist-user> is not authorized to create run 

I would suggest to remove TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}. It doesn’t make sense to use an OIDC token (tuist auth login) and the token-based configuration.

See the CI examples here: Continuous Integration (CI) · Automate · Guides · Tuist

awesome. Now all works :partying_face:

I would suggest to remove TUIST_TOKEN: ${{ secrets.TUIST_TOKEN }}. It doesn’t make sense to use an OIDC token (tuist auth login) and the token-based configuration.

See the CI examples here: Continuous Integration (CI) · Automate · Guides · Tuist

I did read that documentation and was initially using only OIDC but then I read the docs about Xcode Cache and understood that for Xcode cache, the TUIST_TOKEN has to be set :slight_smile:

Additionally, you need to ensure the TUIST_TOKEN environment variable is set.

Btw, in the case enableCaching: false, isn’t this message a bit misleading? It seems like a misconfiguration message but from what you say, it’s only specific to the XC cache (so not needed when using Tuist Module cache)

tuist setup cache
Tuist Cache setup is almost complete!

To enable caching for this project, set the enableCaching property in your Tuist.swift file to true:

let tuist = Tuist(
    fullHandle: "user/app",
    project: .tuist(
        generationOptions: .options(
            enableCaching: true
        )
    )
)

The tuist setup cache is only mentioned in the Xcode Cache guide and we do mention it’s Xcode Cache only in the --help, although I suppose we could also be explicit in that message as well

tuist setup cache --help
OVERVIEW: Set up the Tuist Xcode cache

USAGE: tuist setup cache [--path <path>]

This should hopefully make things clearer :slightly_smiling_face:

1 Like

awesome, thanks a lot :folded_hands: