Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Incorrect architecture definition for cache key

Aperta
#1,397 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
node.js, typescript
Ambito
ci-cd, devops

Direzione di ricerca

Inizia da src/cache-restore.ts alla riga 25 e segui come viene selezionata l’architettura della cache per setup-node. Riproduci il problema con i due workflow macos-latest nell’issue, quindi verifica che le build x64 e arm64 utilizzino cache separate in base all’architettura richiesta anziché a quella dell’host.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature request

Description:
The architecture used to pull the cache is based on the runner's host architecture and not the architecture key supplied to the action. This problem manifests when running two pipelines that use the same host runner but build for different architectures. In this case the action which is building for an architecture that is different from the host will try to pull the cache for it's host architecture which causes the build to fail. The current solution is to only use caching for the pipeline where the host architecture matches the build architecture which is not ideal.

Action version:
Latest

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

all

Repro steps:
Make two actions pipelines with macos-latest and run with a package.json that include native modules:

for x86_64

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20.17.0'
          cache: 'yarn'
          architecture: 'x64'
      - name: Install dependencies with Yarn
        run: npm_config_arch=x64 yarn install --frozen-lockfile --verbose

for arm64

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20.17.0'
          cache: 'yarn'
      - name: Install dependencies with Yarn
        run: yarn install --frozen-lockfile --verbose

Expected behavior:
These pipelines should have separate caches because they are specifying different architectures even though the host architecture is the same.

Actual behavior:
They pull the same cache key because the key is derived from the runner os architecture instead of the specified architecture in the action.
https://github.com/actions/setup-node/blob/89d709d423dc495668cd762a18dd4a070611be3f/src/cache-restore.ts#L25

Lingua principale
TypeScript
Stelle
5k
Fork
1.7k
Merge medio
2g 11h
PR unite (30g)
3

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di actions/setup-node

Tutte le issue di actions/setup-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.