B2_Command_Line_Tool icon indicating copy to clipboard operation
B2_Command_Line_Tool copied to clipboard

on MacOS binary release "b2-cli [-h]" command is executed after upload_file or download_file commands are used

Open alina-lotfulina opened this issue 2 years ago • 7 comments

Environment / versions: ./b2-cli version
b2 command line tool, version 3.3.0 (self-contained download for Mac)

python3 --version Python 3.8.9

macOS: 12.3.1 (on M1 apple silicon)

Steps:

  1. Call upload file command (e.g. ./b2-cli upload-file bucket_name ~/folder_path/test_file.jpeg
  2. Check output of the command

Expected: Response data should be displayed and command prompt returned

Actual: Response data is displayed, then immediately after it, I see something like this in terminal: myname@machine ~ % b2-cli [-h] and then a whole help page is printed to console and command prompt doesn't "return" (doesn't show on new line)

alina-lotfulina avatar May 10 '22 23:05 alina-lotfulina

This is a bug in the macos binary, which is being phased out (in part because of this bug, but also because it's slow).

Please use brew install b2-tools instead.

ppolewicz avatar May 11 '22 13:05 ppolewicz

I lived with this bug for half a year. Maybe this info should be posted somewhere? In the readme, standalone CLI is "the most straightforward way to use", pip install b2 an alternative. Btw, what is the difference to brew install b2-tools

soundflix avatar Jul 29 '22 15:07 soundflix

brew installs from a macos repository where someone uploads it (not sure who), pip installs it from pypi where it's being uploaded by github actions whenever a tag is pushed to this repo.

It's time to remove the macos binary and adjust the installation instructions.

ppolewicz avatar Jul 31 '22 07:07 ppolewicz

Thanks for the clarification.

The binary is also on Backblaze's website. That's why I thought it's the way to go.

soundflix avatar Jul 31 '22 08:07 soundflix

I find it very disappointing that this whole tail of installations has to be done for a simple cli tool. (python then pip OR home-brew with hundreds of directories created) Why can we not have a working executable? I also don't understand the connection of backblaze to this GitHub project. Backblaze make it seem the b2 CLI is theirs and is a professional offering.

soundflix avatar Sep 25 '22 01:09 soundflix

Personally I'd be quite disappointed if the standalone releases went away.

Providing a binary is quick and simple, whereas homebrew is slow and complicated.

iamcalledrob avatar Nov 09 '22 01:11 iamcalledrob

🤔 how long does running brew install b2-tools take?

ppolewicz avatar Nov 09 '22 02:11 ppolewicz

Sometimes upwards of 15 minutes if brew needs to be updated over a slow connection.

iamcalledrob avatar Nov 28 '22 21:11 iamcalledrob

Also, with standalone releases I can pin a specific version. This is especially useful for CI jobs.

Homebrew integration with CI isn't very good, and there's no way to pin specific versions easily. Homebrew is probably fine for a developer machine, but it's not a good enough solution for running on servers or CI machines.

There are cases where I might have multiple scripts that specify different versions of a tool (like b2 cli), and homebrew doesn't handle this well either.

iamcalledrob avatar Nov 28 '22 22:11 iamcalledrob

Due to the way python packages are wrapped up together by pyinstaller (a tool to turn a python program into an executable) for osx, the cli in the console version can be slower than we'd like it to be. The version installed from brew and pip is way faster. The linux binary is as fast as the version from pip and the Windows binary is, admittedely, slightly slower, but the difference is so small that even I can't be bothered. On Windows I just use the binary myself.

Testing the osx binary slows down development, because the test suite that normally runs for a couple of minutes takes ages to execute on the osx binary version.

While I'm not in a hurry to remove the osx binary, I'd like to stop saying it's a recommended way. It's sort of a "if you have to", "that might be a best option in some circumstances" etc, but I'd argue that most osx B2 cli users won't be installing it while on a slow connection.

As for pinning versions, pip is not bad and B2 cli as well as b2-sdk-python have a rather legendary track record in terms of backwards compatibility.

One way of using b2 cli with a pinned version may be through docker, which supports pinning and isolates environments so that the dependency hell that you've mentioned is not a problem.

ppolewicz avatar Nov 28 '22 22:11 ppolewicz

Since MacOS binary has been since removed completely, we now encourage using other methods of B2 CLI installation, as listed above. A relative new addition is the official Docker image: https://github.com/Backblaze/B2_Command_Line_Tool#docker-image , which as mentioned offers better ability to pin to specific version.

mjurbanski-reef avatar Nov 10 '23 13:11 mjurbanski-reef