jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
9.59k stars 270 forks source link

`mise install` broken in GitHub Actions with specific `npm:*` versions #2725

Open xremming opened 1 week ago

xremming commented 1 week ago

Describe the bug Installing a specific version of an npm package freezes in GitHub Actions (runs-on: ubuntu-latest).

To Reproduce Use the jdx/mise-action in GitHub Actions with "npm:prettier" = { version = "3.3.3" } and it blows up with over 16k lines that look like the following in the log. Changing from 3.3.3 to latest fixed the problem.

Problem seems to exist at least with multiple 2024.10.x releases as none of the ones I tried worked.

[DEBUG] ToolRequestSet.build(20.269344ms): ToolRequestSet: terraform@1.9.7 python@3.12 pipx:poetry@1.8.3 node@20.18 npm:prettier@3.3.3 go@1.23 go:github.com/go-task/task/v3/cmd/task@3.39.2 go:github.com/GoogleCloudPlatform/cloud-sql-proxy/v2@2.13.0 go:github.com/terraform-linters/tflint@0.53.0
[DEBUG] $ npm view prettier versions --json
[DEBUG] Config {
    Config Files: [
        "~/work/redacted/redacted/.mise.toml",
    ],
}
[DEBUG] ToolRequestSet.build(67.616µs): ToolRequestSet: terraform@1.9.7 python@3.12 pipx:poetry@1.8.3 node@20.18 npm:prettier@3.3.3 go@1.23 go:github.com/go-task/task/v3/cmd/task@3.39.2 go:github.com/GoogleCloudPlatform/cloud-sql-proxy/v2@2.13.0 go:github.com/terraform-linters/tflint@0.53.0
[DEBUG] $ npm view prettier versions --json

Expected behavior Should work as it does locally.

mise doctor output This is from my local machine where everything works fine.

version: 2024.10.1 macos-arm64 (7184e60 2024-10-07)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 7 Oct 2024 19:08:03 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell:
  /opt/homebrew/bin/bash
  GNU bash, versio 5.2.37(1)-release (aarch64-apple-darwin24.0.0)
  Copyright (C) 2022 Free Software Foundation, Inc.
  Lisenssi GPLv3+: GNU GPL versio 3 tai uudempi <http://gnu.org/licenses/gpl.html>

  This is free software; you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files:
  ~/.config/mise/config.toml
  ~/Work/redacted/.mise.toml

backends:
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  terraform  https://github.com/asdf-community/asdf-hashicorp.git#22eb1c4
  watchexec  https://github.com/nyrst/asdf-watchexec.git#b667a08

toolset:
  terraform@1.9.7
  python@3.12.7
  pipx:poetry@1.8.3
  node@20.18.0
  npm:prettier@3.3.3
  go@1.23.2
  go:github.com/go-task/task/v3/cmd/task@3.39.2
  go:github.com/GoogleCloudPlatform/cloud-sql-proxy/v2@2.13.0
  go:github.com/terraform-linters/tflint@0.53.0
  watchexec@2.1.2

env_vars:
  MISE_SHELL=bash

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cache_prune_age = "30d"
  cargo_binstall = true
  ci = false
  color = true
  debug = false
  disable_default_shorthands = false
  disable_hints = []
  disable_tools = []
  experimental = true
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  log_level = "info"
  not_found_auto_install = true
  paranoid = false
  pin = false
  pipx_uvx = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  python_venv_auto_create = false
  quiet = false
  raw = false
  trace = false
  trusted_config_paths = []
  use_versions_host = true
  verbose = false
  vfox = false
  yes = false

  [node]

  [ruby]
  default_packages_file = "~/.default-gems"
  ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
  ruby_install = false
  ruby_install_repo = "https://github.com/postmodern/ruby-install.git"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false
No warnings found
No problems found
roele commented 5 days ago

I've seen this behaviour occasionally on my mac OS causing the system to crash because of all the spawned processes. This is most likely caused by the shims calling themselves as mentioned in #2254.

The problem reproduces with the following workflow and cancelling it shows the cleanup of countless orphaned processes.

name: test
on:
  workflow_dispatch:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: jdx/mise-action@v2
        with:
          experimental: true
          log_level: debug
          mise_toml: |
            [tools]
            "terraform" = "1.9.7"
            "python" = "3.12"
            "pipx:poetry" = "1.8.3"
            "node" = "20.18"
            "npm:prettier" = "3.3.3"
            "go" = "1.23"
            "go:github.com/go-task/task/v3/cmd/task" = "3.39.2"
            "go:github.com/GoogleCloudPlatform/cloud-sql-proxy/v2" = "2.13.0"
            "go:github.com/terraform-linters/tflint" = "0.53.0"
      - run: |
          mise doctor

It does not reproduce if you only have the tool npm:prettier" = "3.3.3", so i assume node/npm cause an endless loop being called via shims.