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

—getNimbleDir prints out debug info and brakes installation script #50

Open
federico-lox opened this issue Oct 24, 2024 · 3 comments
Open

Comments

@federico-lox
Copy link

federico-lox commented Oct 24, 2024

I’m setting the NIMBLE_DIR environment variable, and it seems that choosenim --getNimbleDir, which is used in the installation script to get the value, prints out debug info data when it doesn’t seem to be expected in the output, breaking the invitation of cp to move the downloaded binary to its permanent destination:

choosenim-init: Downloading choosenim-0.8.9_linux_amd64
Info: Using the environment variable: NIMBLE_DIR='/home/runner/Nim-stable/.nimble'
Info: Using the environment variable: NIMBLE_DIR='/home/runner/Nim-stable/.nimble'
Info: Version 2.2.0 already selected
cp: cannot create regular file ''$'\033''[32m'$'\033' '[1mInfo: '$'\033''[0m'$'\033'' [OmUsing the environment variable: NIMBLE_DIR='\''/home/runner/Nim-stable/.nimble'\'''$'\n\033''[32m'$
'\033'' [1mInfo: '$'\033''[0m'$'\033'' [OmUsing the environment variable: NIMBLE_DIR='\''/ho me/runner/Nim-stable/.nimble'\'''$'\n''/home/run ner/Nim-stable/.nimble/bin/choosenim': No such file or directory

I’m running on NixOS 24.05 and with bash 5.2.26 and it’s reproducible on the latest version of the script downloaded directly from this repo.

@SpotlightKid
Copy link

You mean --getNimbleBin, which is used by the init.sh script.

But the output is from setNimbleDir, which is imported from nimblepkg.options and is called by newCliParams, so in any case.

@federico-lox
Copy link
Author

federico-lox commented Oct 24, 2024

@SpotlightKid Yes, the is an artefact of iOS autocompletion. Fixed in OP.

It’s invoked here:

local nimbleBinDir=`"$temp_prefix/$filename" --getNimbleBin`

# Copy choosenim binary to Nimble bin.
local nimbleBinDir= '"$temp_prefix/$filename" --getNimbleBin'

That invocation doesn’t seem to account for the command outputting “Info: …” debug lines when NIMBLE_DIR is set for the environment.

@SpotlightKid
Copy link

SpotlightKid commented Oct 25, 2024

@SpotlightKid Yes, the is an artefact of iOS autocompletion. Fixed in OP.

My correction wasn't about the --, but that the option is --getNimbleBin, not --getNimbleDir. 😄

The "Info: ..." output goes to stdout, so it is captured by the shell backticks in the line you cited, there is no way to prevent that. So either nimble needs to be fixed to don't output those lines or the init.sh script needs to use another way to determine the nimble bin dir.

The output is not triggered by the --getNimbleBin option, but solely by the presence of the NIMBLE_DIR env variable. E.g. try:

NIMBLE_DIR=/tmp/foo choosenim --help | head

which outputs:

      Info: Using the environment variable: NIMBLE_DIR='/tmp/foo'
      Info: Using the environment variable: NIMBLE_DIR='/tmp/foo'
choosenim: The Nim toolchain installer.

Choose a job. Choose a mortgage. Choose life. Choose Nim.

Usage:
  choosenim <version/path/channel>

Example:

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

No branches or pull requests

2 participants