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

ack: Fix extract phase failure on old macOSes #27330

Closed
wants to merge 2 commits into from

Conversation

snowflake
Copy link
Contributor

Closes: https://trac.macports.org/ticket/71725

Description

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 10.11.6 15G22010 x86_64
Xcode 8.2.1 8C1002

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@snowflake
Copy link
Contributor Author

I can't get " tried a full install with sudo port -vst install?" to work because of this error:

Warning: The following existing file was hidden from the build system by trace mode:
  /opt/local/bin/gnutar
The following files would have been hidden from the build system by trace mode if they existed:
  /opt/local/bin/sh
  /opt/local/sbin/gnutar
  /opt/local/sbin/sh
Error: Failed to extract ack: command execution failed

However sudo port -vs install ack does work.

@reneeotten
Copy link
Contributor

that suggests there is something wrong with the way you declare the dependency. Why don't you just depend on the "gnutar" port with the usual "port"-style dependency on systems that need it?

@snowflake
Copy link
Contributor Author

Regarding the port -vst failure, I changed the relevant parts of the Portfile to:

depends_extract     port:gnutar
extract.post_args   "| ${prefix}/bin/gnutar -xf -"

and tried port -vst install ack
This is the error:

--->  Checksumming ack-v3.8.1.tar.gz
--->  Extracting ack
--->  Extracting ack-v3.8.1.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_davidevans_macports_sources_github.com_macports_macports-ports_devel_ack/ack/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/perl5/ack-v3.8.1.tar.gz' | /opt/local/bin/gnutar -xf - 
sh: /opt/local/bin/gnutar: No such file or directory
gzip: error writing to output: Broken pipe
gzip: /opt/local/var/macports/distfiles/perl5/ack-v3.8.1.tar.gz: uncompress failed
Command failed:  cd "/opt/local/var/macports/build/_Users_davidevans_macports_sources_github.com_macports_macports-ports_devel_ack/ack/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/perl5/ack-v3.8.1.tar.gz' | /opt/local/bin/gnutar -xf - 
Exit code: 127
The following files would have been hidden from the build system by trace mode if they existed:
  /opt/local/bin/sh
  /opt/local/sbin/sh
Error: Failed to extract ack: command execution failed
Error: See /opt/local/var/macports/logs/_Users_davidevans_macports_sources_github.com_macports_macports-ports_devel_ack/ack/main.log for details.

@snowflake
Copy link
Contributor Author

I checked out an older commit of ack: d954fcd
from 2023-02-27 18:05:16 -0500 before the tar file format changed.

and sudo port -vs build worked.
I tried sudo port -vst build and got this error (on macOS 10.11.6)

Checksumming ack-v3.7.0.tar.gz
--->  Extracting ack
--->  Extracting ack-v3.7.0.tar.gz
Executing:  cd "/opt/local/var/macports/build/_Users_davidevans_forks_macports-forks_macports-ports_devel_ack/ack/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/perl5/ack-v3.7.0.tar.gz' | /usr/bin/tar -xf - 
The following files would have been hidden from the build system by trace mode if they existed:
  /opt/local/bin/sh
  /opt/local/sbin/sh
--->  Configuring ack
Executing:  cd "/opt/local/var/macports/build/_Users_davidevans_forks_macports-forks_macports-ports_devel_ack/ack/work/ack-v3.7.0" && /opt/local/bin/perl5.34 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" 
sh: /opt/local/bin/perl5.34: No such file or directory
Command failed:  cd "/opt/local/var/macports/build/_Users_davidevans_forks_macports-forks_macports-ports_devel_ack/ack/work/ack-v3.7.0" && /opt/local/bin/perl5.34 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" 
Exit code: 127
Warning: The following existing file was hidden from the build system by trace mode:
  /opt/local/bin/perl5.34
The following files would have been hidden from the build system by trace mode if they existed:
  /opt/local/bin/sh
  /opt/local/sbin/sh
Error: Failed to configure ack: configure failure: command execution failed
Error: See /opt/local/var/macports/logs/_Users_davidevans_forks_macports-forks_macports-ports_devel_ack/ack/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port ack failed

There must be something odd about my system. What exactly I do not know.

@reneeotten
Copy link
Contributor

okay, so if it's something with your system then let's just close this PR and the Trac ticket it links.

@snowflake
Copy link
Contributor Author

I suspect it is something to do with code-signing. Maybe gnutar and perl have to be code signed. I tried installing gnutar
from Macports archives and I found it was not code signed. I thought all the archives were code-signed, but they're apparently not

There are only 3 people using ack on 10.11. You may as well close this PR and ticket

@snowflake
Copy link
Contributor Author

This comment applies to macOS 10.11.6.

All previous comments here refer to me using macports-base built from the latest commit on the master branch:
914c648c34a0e1fb0bc8ba6e671ce6645728dbd3
This is port 2.10.99

I've now installed macports-base on this branch:
commit 2d2dad3174844640452fe627783a805978f9f04e (HEAD, origin/release-2.10)

sudo port -vst install now works on 10.11. I then ran sudo port clean and now sudo port -vst install does not run the build phase. Here's the output:

sudo port -vst install
--->  Computing dependencies for ack.
--->  Cleaning ack
--->  Removing work directory for ack
--->  Scanning binaries for linking errors

However, sudo port -vst build does run extract patch configure build in the usual way.

So I've made some progress

@snowflake
Copy link
Contributor Author

Sometimes, i forget how port works.
I should run:

sudo port clean
sudo port uninstall
sudo port -vst install

@snowflake snowflake closed this Jan 13, 2025
@snowflake snowflake deleted the ack-3 branch January 13, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants