Bug: rename_exe renames wrong binary when archive contains multiple executables (github backend)
#8632
Unanswered
GaMoCh
asked this question in
Troubleshooting and bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
When using the
githubbackend with a tool that ships multiple executables in its release archive,rename_exerenames the wrong binary. The functionrename_executable_in_diriterates the directory and renames the first executable it finds, which is non-deterministic (readdirorder). It does not use thetool_namehint available to it.Steps to reproduce
mise install --force "github:thought-machine/please@17.28.0"The archive
please_17.28.0_darwin_arm64.tar.gzcontains 3 binaries:build_langserver,please,please_sandbox.Expected behavior
pleaseis renamed toplz, and onlyplzis exposed via shims.Actual behavior
build_langserver(or whichever binaryreaddirreturns first) is renamed toplz.pleaseremains untouched. Thefilter_binsthen fails to findpleasesince it wasn't renamed, and the shim directory ends up empty.With
MISE_TRACE=1:Root cause
rename_executable_in_dirpicks the first executable that passesshould_skip_file, ignoring thetool_nameparameter which is only used in the second pass (for non-executable files in ZIP archives). With multiple executables, this is essentially random.Additionally,
rename_exeandfilter_binsdon't coordinate —rename_exeruns insideinstall_artifactbeforefilter_binsruns increate_symlink_bin_dir, sofilter_binssearches for a binary name that may have already been (incorrectly) renamed.Workaround
The only working alternative is the
ubibackend, which has its own rename logic via the ubi library:However, the
ubibackend is deprecated and emits a warning on every install:So currently there is no way to achieve this with a non-deprecated backend.
Beta Was this translation helpful? Give feedback.
All reactions