yarnpkg / berry

πŸ“¦πŸˆ Active development trunk for Yarn βš’
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.42k stars 1.11k forks source link

[Feature] add possibility to include/exclude items to supportedArchitectures matrix #3775

Open bgotink opened 2 years ago

bgotink commented 2 years ago

Describe the user story

As a developer I'm using a darwin arm64 machine and my CI/CD runs on win32/linux/darwin x64. The current supportedArchitectures matrix leads me to install windows arm64 and linux arm64 versions of esbuild, which are never actually used.

Describe the solution you'd like

I'd like the supportedArchitectures matrix to have include and/or exclude functionality, similar to how matrices work in GitHub workflows.

In my example scenario that could look like this:

supportedArchitectures:
  os: [linux, darwin, win32]
  cpu: [x64]
  include:
    - os: darwin
      cpu: arm64

Describe the drawbacks of your solution

The default value for os and cpu could lead to confusion. For example:

supportedArchitectures:
  include:
    - os: darwin
      cpu: arm64
    - os: darwin
      cpu: x64
    - os: linux
      cpu: x64

Does the resulting matrix contain os = current && cpu = current as well? The way it's currently implemented says yes, I'd have to explicitly pass empty arrays into the os and cpu options to disable that.

Describe alternatives you've considered

adrian-gierakowski commented 1 year ago

this is very much needed