Opened 20 months ago

Closed 19 months ago

Last modified 19 months ago

#65847 closed defect (fixed)

shellcheck: broken pre-built binary package, wants to be rebuilt

Reported by: sierkb (Sierk Bornemann) Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: Cc: essandess (Steve Smith)
Port: shellcheck

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Since a few days (I guess, since this commit Use cabal-based native builds [32d0ff91ea0257e2ad0268e603ff4730865f321a/macports-ports], because until that change, the problem didn't ocur to me before):

% sudo port selfupdate; sudo port -u upgrade outdated
Password:
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.7.2 installed,
MacPorts base version 2.7.2 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
Nothing to upgrade.
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
% sudo port install shellcheck
--->  Fetching archive for shellcheck
--->  Attempting to fetch shellcheck-0.8.0_1.darwin_21.arm64.tbz2 from https://packages.macports.org/shellcheck
--->  Attempting to fetch shellcheck-0.8.0_1.darwin_21.arm64.tbz2.rmd160 from https://packages.macports.org/shellcheck
--->  Installing shellcheck @0.8.0_1
--->  Activating shellcheck @0.8.0_1
--->  Cleaning shellcheck
--->  Scanning binaries for linking errors
--->  Found 1 broken file, matching files to ports
--->  Found 1 broken port, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: shellcheck @0.8.0
Continue? [Y/n]: n

% sudo port selfupdate; sudo port -u upgrade outdated
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.7.2 installed,
MacPorts base version 2.7.2 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
Nothing to upgrade.
--->  Scanning binaries for linking errors
--->  Found 1 broken file, matching files to ports
--->  Found 1 broken port, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: shellcheck @0.8.0
Continue? [Y/n]: n

I point to THIS:

--->  Found 1 broken file, matching files to ports
--->  Found 1 broken port, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: shellcheck @0.8.0

System: macOS 12.6 (21G115, Darwin 21.6.0), Apple Silicon (arm64))

I prefer pre-built port packages (I guess, in this case it comes from https://packages.macports.org/shellcheck/ and is https://packages.macports.org/shellcheck/shellcheck-0.8.0_1.darwin_21.arm64.tbz2), because I don't want to rebuild this port and therefore let install a bunch of other packages to satisfy build dependencies.

Something seems to be broken with this recent pre-built package of the shellcheck port, I guess.

Change History (16)

comment:1 Changed 20 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: essandess added
Description: modified (diff)
Owner: set to neverpanic
Status: newassigned

If you run sudo port -d rev-upgrade it'll show us how it's broken.

comment:2 Changed 20 months ago by essandess (Steve Smith)

Would you also please run sudo port selfupdate and try again?

We just merged PR https://github.com/macports/macports-ports/pull/16115 that fixes a bunch of ghc and cabal dependencies.

comment:3 in reply to:  1 Changed 20 months ago by sierkb (Sierk Bornemann)

Replying to ryandesign:

If you run sudo port -d rev-upgrade it'll show us how it's broken.

% sudo port -d rev-upgrade
--->  Scanning binaries for linking errors
Could not open /opt/local/lib/libgmp.10.dylib: Error opening or reading file (referenced from /opt/local/bin/shellcheck)
DEBUG: Marking /opt/local/bin/shellcheck as broken
--->  Found 1 broken file, matching files to ports
--->  Found 1 broken port, determining rebuild order
DEBUG: Broken: shellcheck
DEBUG: Processing port shellcheck @0:0.8.0_1
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: shellcheck @0.8.0
Continue? [Y/n]: n

% ls -la /opt/local/lib/libgmp.10.dylib
ls: /opt/local/lib/libgmp.10.dylib: No such file or directory
% sudo port installed|grep gmp
%

comment:4 in reply to:  2 Changed 20 months ago by sierkb (Sierk Bornemann)

Replying to essandess:

Would you also please run sudo port selfupdate and try again?

We just merged PR https://github.com/macports/macports-ports/pull/16115 that fixes a bunch of ghc and cabal dependencies.

Already done right before I've written this report 2 hours ago (see above) and now again (with the same result).
Anyway: the pre-built binarys on https://packages.macports.org/shellcheck/, especially the darwin21/arm64 build https://packages.macports.org/shellcheck/shellcheck-0.8.0_1.darwin_21.arm64.tbz2 has changed since then and is/are already built including these fixes?

Last edited 20 months ago by sierkb (Sierk Bornemann) (previous) (diff)

comment:5 Changed 20 months ago by essandess (Steve Smith)

The shellcheck binary is not affected by the recent PR, but library checking may be—not sure how it works. Those are builds dependencies, not lib dependencies, so I’m honestly not confident why or if the PR would have an impact.

Also I have checked this on my own arm64 and x86_64 boxes and do not observe this issue.

Version 0, edited 20 months ago by essandess (Steve Smith) (next)

comment:6 in reply to:  5 Changed 20 months ago by jmroot (Joshua Root)

Replying to essandess:

Also I have checked this on my own arm64 and x86_64 boxes and do not observe this issue.

Do you mean rev-upgrade doesn't complain, or shellcheck is not linked with gmp? You wouldn't see the former if gmp happens to be installed (so installing it should also be an effective workaround). The shellcheck port claims to have only build-time dependencies, but this rev-upgrade output indicates that it is linked with gmp and thus needs to list it in depends_lib.

comment:7 Changed 20 months ago by jmroot (Joshua Root)

One of the binaries from the buildbot:

% otool -L ./shellcheck-0.8.0_1.darwin_21.arm64/opt/local/bin/shellcheck                    
./shellcheck-0.8.0_1.darwin_21.arm64/opt/local/bin/shellcheck:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
	/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
	/opt/local/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0)

So not just gmp, but libiconv too. nm -u indicates that this is not overlinking; there are references to symbols provided by those libs.

comment:8 Changed 20 months ago by essandess (Steve Smith)

I mean that rev-upgrade doesn’t complain. I don’t have the arm box accessible now but am pretty sure that that shellcheck binary depends on MacPorts [gmp:

otool -L `which shellcheck`

The first thing I’d recommend is installing gmp by hand:

sudo port install gmp

I see that I have another dependency bug in https://github.com/macports/macports-ports/blob/master/_resources/port1.0/group/haskell_cabal-1.0.tcl: This PG should add lib dependencies for the lib dependencies that ghc has. I’ll post another PR with this fix.

comment:9 Changed 20 months ago by sierkb (Sierk Bornemann)

Replying to jmroot:

Replying to essandess:

Also I have checked this on my own arm64 and x86_64 boxes and do not observe this issue.

Do you mean rev-upgrade doesn't complain, or shellcheck is not linked with gmp? You wouldn't see the former if gmp happens to be installed (so installing it should also be an effective workaround). The shellcheck port claims to have only build-time dependencies, but this rev-upgrade output indicates that it is linked with gmp and thus needs to list it in depends_lib.

Your are right with your last sentence at least:

% otool -L /opt/local/bin/shellcheck
/opt/local/bin/shellcheck:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
	/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
	/opt/local/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0)

comment:10 Changed 20 months ago by essandess (Steve Smith)

@jmroot When I modify PG haskell_cabal to add these lib dependencies none of the binaries of the ports that use this PG will change, so those don’t need to rev-bumped, correct?

comment:12 Changed 19 months ago by essandess (Steve Smith)

Resolution: fixed
Status: assignedclosed

In 5d2c3bd063738a0d0967c3a74ae58eb719200f2a/macports-ports (master):

haskell_cabal PG: Bugfix

comment:13 in reply to:  12 Changed 19 months ago by sierkb (Sierk Bornemann)

Replying to essandess:

In 5d2c3bd063738a0d0967c3a74ae58eb719200f2a/macports-ports (master):

haskell_cabal PG: Bugfix

Thank you. Rebuilt pre-built packages on https://packages.macports.org/shellcheck/, especially a rebuilt https://packages.macports.org/shellcheck/shellcheck-0.8.0_1.darwin_21.arm64.tbz2 binary reflecting the bugfixes can be estimated when?
Or/and should the portfile https://github.com/macports/macports-ports/blob/master/devel/shellcheck/Portfile be adjusted to reflect the dependency on gmp port and then provide the rebuilt the binary?

comment:14 Changed 19 months ago by essandess (Steve Smith)

There are no binary changes and therefore no binary rebuilds or port revbumps.

You may either wait for the chipmunks to deliver the PR changes that fix the dependencies, then reinstall shellcheck, which will now correctly install the necessary dependencies automatically:

sudo port uninstall shellcheck
sudo port install shellcheck

Or you can just install the necessary dependency by hand yourself right now and the issue will go away:

sudo port install gmp

comment:15 Changed 19 months ago by neverpanic (Clemens Lang)

When the metadata changes, the port's revision should also be increased to ensure users will get the correct metadata.

In this case, the shellcheck port should be revbumped. The same also applies for all other ports that use the haskell_cabal port group.

comment:16 in reply to:  15 Changed 19 months ago by essandess (Steve Smith)

Replying to neverpanic:

When the metadata changes, the port's revision should also be increased to ensure users will get the correct metadata.

In this case, the shellcheck port should be revbumped. The same also applies for all other ports that use the haskell_cabal port group.

Roger. All added to https://github.com/macports/macports-ports/pull/16154

Note: See TracTickets for help on using tickets.