Skip to content

bug: non-zero exit codes + messages to stderr produced in non-error context #2041

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

Open
DelevoXDG opened this issue Mar 25, 2025 · 0 comments
Labels

Comments

@DelevoXDG
Copy link

Describe the Bug

  • Some messages are printed to stderr where streaming them to stdout would be more appropriate.
  • Additionally, non-zero exit codes are produced in cases where no failure seem to be present.

Steps to Reproduce

Examples:

  1. Updating plugins
    $ asdf plugin update scarb > /dev/null
    updated scarb to ref refs/heads/main
    There seems to be no error, the exit code is 0, yet, the output is sent to stderr, which would indicate that something has gone wrong, even though the contents of the message suggest success.
    Emitted here:
    logger.Printf("updated %s to ref %s\n", pluginName, updatedToRef)
  2. Listing installed versions for plugin that has no versions installed
    $ asdf list scarb > /dev/null
    No compatible versions installed (scarb )
    echo $?                               
    1
    This is unexpected, as normally tools just produce empty list in such context and exit successfully, e.g.
    $ mkdir empty
    $ ls empty > /dev/null
    $ echo $?
    0
    Normally, grep would be used to parse output and exit with error if necessary.

Expected Behaviour

  1. Exit code: 0, empty stderr
  2. Exit code: 0, empty stderr

Actual Behaviour

  1. Exit code: 0, non-empty stderr
  2. Exit code: 1, non-empty stderr

Environment

asdf info
OS:
Darwin MacBook-Pro.local 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:24 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6030 arm64

SHELL:
zsh 5.9 (arm64-apple-darwin24.0)

BASH VERSION:
5.2.37(1)-release

ASDF VERSION:
0.16.6

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/delevo/.asdf
ASDF_CONFIG_FILE=/Users/delevo/.asdfrc

asdf plugins affected (if relevant)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant