Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#54028 closed defect (fixed)

Gawk fails to update after readline update

Reported by: augustusjdporter Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: gawk

Description (last modified by mf2k (Frank Schima))

Gawk fails to update after a readlines update from version 6 to version 7. In the main.log of Gawk there is this section:

:info:configure config.status: creating Makefile
:info:configure dyld: Library not loaded: /Data/macports/portera/lib/libreadline.6.dylib
:info:configure   Referenced from: /Data/macports/portera/bin/gawk
:info:configure   Reason: image not found

When I look in the directory "/Data/macports/portera/lib" there is only the libreadline.7.dylib library, causing the update of Gawk to fail.

Attachments (1)

main.log (160.6 KB) - added by augustusjdporter 8 years ago.

Download all attachments as: .zip

Change History (14)

Changed 8 years ago by augustusjdporter

Attachment: main.log added

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Owner: set to Schamschula
Status: newassigned

In the future, please use WikiFormatting and Cc the port maintainers (port info --maintainers gawk), if any.

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Description: modified (diff)

comment:3 Changed 8 years ago by mf2k (Frank Schima)

See also #54026.

Last edited 8 years ago by mf2k (Frank Schima) (previous) (diff)

comment:4 Changed 8 years ago by mf2k (Frank Schima)

Summary: Gawk fails to update after readlines updateGawk fails to update after readline update

comment:5 Changed 8 years ago by Schamschula (Marius Schamschula)

All it needs is a revision bump.

comment:6 Changed 8 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed

In 84172063dce39d781b14a621daf7f554a533d39c/macports-ports:

gawk: revision bump due to readline update

Closes: #54028

comment:7 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

gawk already got a revbump in [44840c49dbb96941fe5dfd27eba5f6aa3d954fd8/macports-ports]. Doing it a second time fixes nothing.

The problem is that standard configure scripts, such as the one gawk uses, automatically check for common utilities like gawk which are used during the build process. So when trying to rebuild gawk with the new readline, gawk's configure script finds the already-installed broken copy of gawk, and tries to use it during the build, which fails. The solution is to deactivate gawk, then upgrade gawk.

sudo port -f deactivate gawk
sudo port clean gawk
sudo port -u upgrade gawk

There's not really anything we can do to automate this fix. We could use the conflicts_build portgroup to indicate that gawk is incompatible with itself, but that would only be necessary in the unusual circumstance where the already-installed gawk is broken due to a new major version of one of its dependencies; it would be an unnecessary inconvenience other times. It also wouldn't help the thousands of other ports whose configure scripts will opportunistically use MacPorts gawk if it is installed.

If we could figure out a way to tell gawk's configure script to always use /usr/bin/awk even if /opt/local/bin/gawk is installed, that would be a good step. I feel like we tried to figure that out before and failed.

Last edited 8 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:8 in reply to:  7 ; Changed 8 years ago by danielluke (Daniel J. Luke)

Replying to ryandesign:

If we could figure out a way to tell gawk's configure script to always use /usr/bin/awk even if /opt/local/bin/gawk is installed, that would be a good step. I feel like we tried to figure that out before and failed.

apr does this by setting ac_cv_prog_AWK=awk (because setting 'AWK' only half-worked) - I haven't looked at the gawk build, but maybe something similar is possible?

comment:9 in reply to:  7 Changed 8 years ago by Schamschula (Marius Schamschula)

Replying to ryandesign:

gawk already got a revbump in [44840c49dbb96941fe5dfd27eba5f6aa3d954fd8/macports-ports]. Doing it a second time fixes nothing.

The problem is that standard configure scripts, such as the one gawk uses, automatically check for common utilities like gawk which are used during the build process. So when trying to rebuild gawk with the new readline, gawk's configure script finds the already-installed broken copy of gawk, and tries to use it during the build, which fails. The solution is to deactivate gawk, then upgrade gawk.

sudo port -f deactivate gawk
sudo port clean gawk
sudo port -u upgrade gawk

There's not really anything we can do to automate this fix. We could use the conflicts_build portgroup to indicate that gawk is incompatible with itself, but that would only be necessary in the unusual circumstance where the already-installed gawk is broken due to a new major version of one of its dependencies; it would be an unnecessary inconvenience other times. It also wouldn't help the thousands of other ports whose configure scripts will opportunistically use MacPorts gawk if it is installed.

If we could figure out a way to tell gawk's configure script to always use /usr/bin/awk even if /opt/local/bin/gawk is installed, that would be a good step. I feel like we tried to figure that out before and failed.

My update worked on my machine, as I was rebuilding gawk in trace mode...

Of course, gawk is not a prerequisite for gawk, but as mentioned above, most configure scripts will look for gawk before awk.

comment:10 in reply to:  8 Changed 8 years ago by Schamschula (Marius Schamschula)

Replying to danielluke:

Replying to ryandesign:

If we could figure out a way to tell gawk's configure script to always use /usr/bin/awk even if /opt/local/bin/gawk is installed, that would be a good step. I feel like we tried to figure that out before and failed.

apr does this by setting ac_cv_prog_AWK=awk (because setting 'AWK' only half-worked) - I haven't looked at the gawk build, but maybe something similar is possible?

Thanks for the suggestion, I will look into this later today.

comment:11 Changed 8 years ago by Schamschula (Marius Schamschula)

In 02e9c089206d04e8dc828bc04d176828671b85c7/macports-ports:

gawk: add ac_cv_prog_AWK=awk to avoid building against an old gawk

See: #54028

comment:12 Changed 8 years ago by kencu (Ken)

On my system, trying to upgrade gawk insisted to upgrade gdbm first, which also failed due to the broken installation of the not-yet-upgraded gawk. So I had to use Ryan's force uninstall of gawk method above to get around that, which then allowed gdbm to proceed, and then a new gawk to be built.

Here's the tail of the gdbm failure.

dyld: Library not loaded: /opt/local/lib/libreadline.6.dylib
  Referenced from: /opt/local/bin/gawk
  Reason: image not found
sed: stdout: Broken pipe
./config.status: line 1259: 16506 Done(1)                 eval sed \"\$ac_sed_extra\" "$ac_file_inputs"
     16507 Trace/BPT trap          | $AWK -f "$ac_tmp/subs.awk" > $ac_tmp/out
config.status: error: could not create tests/Makefile
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_gdbm/gdbm/work/gdbm-1.13" && ./configure --prefix=/opt/local --disable-dependency-tracking --disable-silent-rules 
Exit code: 1
Error: Failed to configure gdbm, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_gdbm/gdbm/work/gdbm-1.13/config.log

comment:13 Changed 8 years ago by Schamschula (Marius Schamschula)

In 4ee4598c94f7bab484fe8973e2014d916beac568/macports-ports:

gdbm: add ac_cv_prog_AWK=awk to avoid building against gawk

See: #54028

Note: See TracTickets for help on using tickets.