Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template using exec command no-longer working after upgrade to 2024.2.7 #1636

Closed
dwooldridge-ctoken opened this issue Feb 9, 2024 · 2 comments · Fixed by #1643
Closed

template using exec command no-longer working after upgrade to 2024.2.7 #1636

dwooldridge-ctoken opened this issue Feb 9, 2024 · 2 comments · Fixed by #1643
Labels
bug Something isn't working

Comments

@dwooldridge-ctoken
Copy link

dwooldridge-ctoken commented Feb 9, 2024

Describe the bug
Since upgrading from version 2024.1.21 to 2024.2.7 the exec command no-longer works

To Reproduce
Have the following in your .mise.toml:

[env]
GO_VERSION = "{{exec(command='grep \"^go 1\\.[0-9]\\+\\.[0-9]\\+$\" go.mod | cut -f2 -d\" \"')}}"

[tools]
golang = "{{exec(command='grep \"^go 1\\.[0-9]\\+\\.[0-9]\\+$\" go.mod | cut -f2 -d\" \"')}}"

Then run:

mise install
mise failed to resolve tool version: regex parse error:
    ^{{exec(command='grep "^go 1\.[0-9]\+\.[0-9]\+$" go.mod | cut -f2 -d" "')}}([-.].+)?$
      ^

Expected behavior
I expect the golang version to be taken from the go.mod file and GO_VERSION env var to be set to the same value. This used to work with version 2024.1.21

mise doctor output

mise version:
  2024.2.7 linux-x64 (e2845f3 2024-02-08)

build:
  Target: x86_64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Thu, 8 Feb 2024 04:03:31 +0000
  Rust Version: rustc 1.75.0 (82e1608df 2023-12-21)
  Profile: release

shell:
  /bin/bash
  GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
  Copyright (C) 2020 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <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.

mise dirs:
  data: /home/myuser/.local/share/mise
  config: /home/myuser/.config/mise
  cache: /home/myuser/.cache/mise
  state: /home/myuser/.local/state/mise
  shims: /home/myuser/.local/share/mise/shims

mise environment variables:
  MISE_SHELL=bash

settings:
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_tools = []
  experimental = false
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_compile = false
  python_default_packages_file = "/home/myuser/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  python_venv_auto_create = false
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false


activated: yes
shims_on_path: no
config files:
  ~/Repos/svc-demo/.mise.toml

plugins:
  bun      (core)
  deno     (core)
  go       (core)
  java     (core)
  node     (core)
  python   (core)
  ruby     (core)

mise failed to resolve tool version: regex parse error:
    ^{{exec(command='grep "^go 1\.[0-9]\+\.[0-9]\+$" go.mod | cut -f2 -d" "')}}([-.].+)?$
      ^
error: repetition quantifier expects a valid decimal
toolset:
  go@{{exec(command='grep "^go 1\.[0-9]\+\.[0-9]\+$" go.mod | cut -f2 -d" "')}}

No problems found

Additional context
Maybe there is a better way to achieve this, but I would like to be able to get the go version from the go.mod file AND set the GO_VERSION environment variable so that it can be passed to other tools like just/docker builds etc.

@dwooldridge-ctoken dwooldridge-ctoken added the bug Something isn't working label Feb 9, 2024
@dwooldridge-ctoken
Copy link
Author

dwooldridge-ctoken commented Feb 9, 2024

Just to confirm, I reverted back to the older version 2024.1.21 and it works again:

» mise install
mise go@1.21.6 ✓ installed                                                                                                                                        

» mise --version
2024.1.21 linux-x64 (b7e61d6 2024-01-15)

» mise list
Plugin  Version  Config Source               Requested
go      1.21.6   ~/Repos/svc-demo/.mise.toml 1.21.6

» echo $GO_VERSION
1.21.6

@dwooldridge-ctoken
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant