Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Incorrect architecture definition for cache key

Abierto
#1,397 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
node.js, typescript
Área
ci-cd, devops

Línea de trabajo

Comienza en src/cache-restore.ts, en la línea 25, y sigue cómo se selecciona la arquitectura de caché para setup-node. Reprodúcelo con los dos workflows de macos-latest del issue y, a continuación, verifica que las compilaciones x64 y arm64 utilicen cachés separados según la arquitectura solicitada, en lugar de la arquitectura del host.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
5k
Forks
1.7k
Merge medio
2 d 11 h
PR fusionados (30 d)
3

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de actions/setup-node

Todos los issues de actions/setup-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.