Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.57k stars 12.32k forks source link

midnight-commander: latest formula uses broken version 4.8.27 #97718

Closed pgpbpadilla closed 2 years ago

pgpbpadilla commented 2 years ago

The current formula uses a version of MC which has the bug described in: https://midnight-commander.org/ticket/4356

However, that's not a bug in the formula but in MC itself.

I'm not an expert on Homebrew formulas but I've seen other formulas that have multiple versions available via brew search, e.g.

brew search postgres
==> Formulae
check_postgres     postgresql@10      postgresql@12      postgresql@9.4     postgresql@9.6     qt-postgresql
postgresql ✔       postgresql@11      postgresql@13      postgresql@9.5     postgrest          postgis

The following stable branch of MC does not have the bug: 4.8.1-stable

Having the ability to install the stable versions would be awesome :)

Verification

What were you trying to do (and why)?

See: https://midnight-commander.org/ticket/4356

What happened (include all command output)?

See: https://midnight-commander.org/ticket/4356

What did you expect to happen?

See: https://midnight-commander.org/ticket/4356

Step-by-step reproduction instructions (by running brew commands)

See: https://midnight-commander.org/ticket/4356
SMillerDev commented 2 years ago

If this is the version that MC deems stable I don't think we can do much about it.

pgpbpadilla commented 2 years ago

Would it be too difficult to extend the formula to allow the installation of stable releases and not only the latest release ?

The MC repo has a couple of stable branches. I'm currently using branch: 4.8.1-stable built from sources and that solves the problem for me.

I can give it a try, I just need a pointer to the docs on how to make multiple versions of a formula available.

SMillerDev commented 2 years ago

https://docs.brew.sh/Versions

pgpbpadilla commented 2 years ago

Ok, sounds like a tap would be more appropriate for this purpose. I guess we can close this issue then. Thanks for looking into it.

pgpbpadilla commented 2 years ago

Hi @SMillerDev, I'm a bit stuck creating my tap for the stable version.

I've created the following tap: pgpbpadilla/pgpb

brew tap pgpbpadilla/pgpb

And I'm able to get the information about my custom formula:

brew info midnight-commander-stable

pgpbpadilla/pgpb/midnight-commander-stable: stable 4.8.1.7 (bottled), HEAD
GNU Midnight Commander is a visual file manager
https://www.midnight-commander.org/
Conflicts with:
  minio-mc (because both install an `mc` binary)
Not installed
From: https://github.com/pgpbpadilla/homebrew-pgpb/blob/HEAD/Formula/midnight-commander-stable.rb
License: GPL-3.0-or-later
==> Dependencies
Build: pkg-config
Required: glib, libssh2, openssl@1.1, s-lang
==> Options
--HEAD
  Install HEAD version

However, installing it fails with an error:

    > $ brew install midnight-commander-stable
    > ==> Downloading <https://ghcr.io/v2/homebrew/core/midnight-commander-stable/manifests/4.8.1.7>
    > curl: (22) The requested URL returned error: 404
    > 
    > Error: midnight-commander-stable: Failed to download resource "midnight-commander-stable<sub>bottle</sub><sub>manifest</sub>"
    > Download failed: <https://ghcr.io/v2/homebrew/core/midnight-commander-stable/manifests/4.8.1.7>

I don't understand why brew is trying to download a manifest for my custom package from the core repo.

Am I missing some step before I can install the formula from my tap?

gromgit commented 2 years ago

It's almost certainly because:

pgpbpadilla/pgpb/midnight-commander-stable: stable 4.8.1.7 (bottled), HEAD

you left the bottle block in the formula: https://github.com/pgpbpadilla/homebrew-pgpb/blob/4b6cd606d8261adbf8453ea1ff7631a5e29e9b36/Formula/midnight-commander-stable.rb#L14-L22

Since there are no midnight-commander-stable bottles, only midnight-commander ones, your install failed. Removing the bottle block and building from source is the most expeditious way of solving this problem.

zyv commented 2 years ago

Hi there,

I'm one the maintainers of mc. I'm afraid that you are confused about our current release versioning. The current stable version is 4.8.27 and I'm going to release 4.8.28 soon.

The -stable branches are coming from the times, when we just took over the maintenance and were doing huge refactoring all over the place after releasing the last 4.6.x version and some 4.7.x releases. At that time we had releases like 4.8.1 and then stable versions like 4.8.1.2 and so on.

These old releases are not considered stable nowadays, these days we are just continuing with 4.8.27, 4.8.28, 4.8.29 and so on - the changes between these versions are mostly bug fixes.

Please don't use and/or package old stable branches. They are less stable than the current code, are insecure and probably don't even build properly at all.

Z.

carlocab commented 2 years ago

@zyv thanks for dropping by. Yes, we don't plan to package the older versions of mc. The latter part of this discussion is about how @pgpbpadilla can maintain their preferred version of mc in their own personal tap.

pgpbpadilla commented 2 years ago

I'm one the maintainers of mc. I'm afraid that you are confused about our current release versioning.

Ok, that makes sense, I was just guessing based on the branch names 😅

In any case, I believe the bug is still present when I build MC from sources: #4356

pgpbpadilla commented 2 years ago

It's almost certainly because:

pgpbpadilla/pgpb/midnight-commander-stable: stable 4.8.1.7 (bottled), HEAD

you left the bottle block in the formula: https://github.com/pgpbpadilla/homebrew-pgpb/blob/4b6cd606d8261adbf8453ea1ff7631a5e29e9b36/Formula/midnight-commander-stable.rb#L14-L22

Since there are no midnight-commander-stable bottles, only midnight-commander ones, your install failed. Removing the bottle block and building from source is the most expeditious way of solving this problem.

That did it! 😀 ... my tap now works!

I am now able to install v4.8.1.7 with brew install

brew tap pgpbpadilla/pgpb
brew info pgpbpadilla/pgpb/midnight-commander
brew install pgpbpadilla/pgpb/midnight-commander

Thank you all @SMillerDev @gromgit @zyv