Opened 15 months ago
Last modified 5 weeks ago
#68759 new defect
agrep @2.04: implicit function declarations
Reported by: | mission-bio | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.1 |
Keywords: | catalina bigsur monterey ventura sonoma sequoia | Cc: | rpilar@…, dhingra@…, T20231023.0099, ryandesign (Ryan Carsten Schmidt), balanco |
Port: | agrep |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
After installing MacPorts, we procedd to install agrep a few times and keep getting the same error:
---> Computing dependencies for agrep The following dependencies will be installed: bsdmake Continue? [Y/n]: y ---> Fetching archive for bsdmake ---> Attempting to fetch bsdmake-24_1.darwin_20.x86_64.tbz2 from https://packages.macports.org/bsdmake ---> Attempting to fetch bsdmake-24_1.darwin_20.x86_64.tbz2.rmd160 from https://packages.macports.org/bsdmake ---> Installing bsdmake @24_1 ---> Activating bsdmake @24_1 ---> Cleaning bsdmake ---> Fetching archive for agrep ---> Attempting to fetch agrep-2.04_1.darwin_20.x86_64.tbz2 from https://packages.macports.org/agrep ---> Attempting to fetch agrep-2.04_1.darwin_20.x86_64.tbz2 from http://mirror.fcix.net/macports/packages/agrep ---> Attempting to fetch agrep-2.04_1.darwin_20.x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/agrep ---> Fetching distfiles for agrep ---> Attempting to fetch agrep-2.04.tar.Z from https://distfiles.macports.org/agrep ---> Verifying checksums for agrep ---> Extracting agrep ---> Applying patches to agrep ---> Configuring agrep ---> Building agrep Error: Failed to build agrep: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_sysutils_agrep/agrep/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. Error: Processing of port agrep failed
==> Dissecting the script, it looks liek it is trying to install a file: agrep-2.04_1.darwin_20.x86_64.tbz2 which does not exist in any of the follwoing repositories:
https://packages.macports.org/agrep
http://mirror.fcix.net/macports/packages/agrep
https://ywg.ca.packages.macports.org/mirror/macports/packages/agrep
==> Have searched the internet for the file: agrep-2.04_1.darwin_20.x86_64.tbz2 but nothing exists.
==> Please advise on how we can install agrep
Change History (7)
comment:1 Changed 15 months ago by reneeotten (Renee Otten)
Description: | modified (diff) |
---|---|
Keywords: | agrep removed |
Milestone: | MacPorts Future |
Port: | agrep added |
Summary: | Error: Processing of port agrep failed → agrep: build failure |
comment:2 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Keywords: | catalina bigsur monterey ventura sonoma added |
Summary: | agrep: build failure → agrep @2.04: implicit function declarations |
It fails with Xcode 12 or later due to implicit function declarations. The developers have been advised what they need to do to fix it and have not reacted:
https://github.com/Wikinaut/agrep/issues/20
If you or anyone would like to submit fixes for these issues to the developers I'm sure they would appreciate it.
comment:3 Changed 15 months ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign added |
---|
I've submitted a PR to the developers. I plan to update the port to the latest version.
comment:4 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)
The developer is unresponsive to bug reports and pull requests. I suggest you find an alternative to agrep. The agrep web site has a list of alternatives here:
comment:5 Changed 6 weeks ago by balanco
Update 2025-01-02:
Original content updated to striked-through text, given the authoritative fast reactions in the subsequent comments. The original text currently kept for documentation/context only; please advise whether to just do away with this ‘how-NOT-to’.
More importantly: many thanks to ryandesign! (and due apologies…)
Rough solution (verified on macOS Monterey and macOS Sequoia)
1. install gcc (tested with gcc13 on Monterey:
install gcc13
and gcc14 on Sequoia: install gcc14
)
2. select the installed gcc (e.g.:
select gcc mp-gcc13
)
3. edit agrep
replace the specification of the compiler to use by gcc
, i.e. replace the line:
build.args CC="${configure.cc}" \
by:
build.args CC="gcc" \
(you only need to change content of the"…"
; in any case make sure not to lose the final backslash ('\') on the line, signifying the continuation on the next line…) and save the edited file
4.
install agrep
, which should give something like:
Portfile for agrep changed since last build; discarding previous state
---> Computing dependencies for agrep
---> Fetching archive for agrep
---> Attempting to fetch agrep-2.04_1.darwin_21.x86_64.tbz2 from https://packages.macports.org/agrep
---> Attempting to fetch agrep-2.04_1.darwin_21.x86_64.tbz2 from https://mse.uk.packages.macports.org/agrep
---> Attempting to fetch agrep-2.04_1.darwin_21.x86_64.tbz2 from https://vie.at.packages.macports.org/agrep
---> Fetching distfiles for agrep
---> Verifying checksums for agrep
---> Extracting agrep
---> Applying patches to agrep
---> Configuring agrep
---> Building agrep
---> Staging agrep into destroot
---> Installing agrep @2.04_1
---> Activating agrep @2.04_1
---> Cleaning agrep
(no guarantees, but fingers much crossed)
comment:6 Changed 6 weeks ago by ryandesign (Ryan Carsten Schmidt)
comment:7 Changed 6 weeks ago by ryandesign (Ryan Carsten Schmidt)
Cc: | balanco added |
---|---|
Keywords: | sequoia added |
No, please don't do those things.
If you want to override the compiler MacPorts uses for a port, there's no need to select
that compiler nor to edit the Portfile; you can simply sudo port -s install agrep configure.compiler=macports-gcc-14
. However compiling with gcc on macOS is generally not recommended, nor is overriding the compiler MacPorts chose, and I do not recommend doing that to try to ignore any implicit function declaration errors.
In this case, the preferred compiler clang is able to compile the code if you downgrade the implicit function declaration error back to a warning. This is not the preferred solution to this problem but it can be used as a workaround on non-Apple Silicon systems. On ARM processors, implicit function declarations may cause incorrect program execution so I really don't recommend trying this on Apple Silicon systems. I have committed a workaround to the port to disable implicit function declaration errors and to mark the port as not supporting Apple Silicon. (On Apple Silicon Macs, MacPorts will thus install the Intel version of agrep which should work via Rosetta.)
Add the
main.log
file mentioned in the error message to this ticket.