Bug 257744 - math/lapacke: relies on buggy base system ranlib behaviour
Summary: math/lapacke: relies on buggy base system ranlib behaviour
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks: 257599
  Show dependency treegraph
 
Reported: 2021-08-10 15:53 UTC by Ed Maste
Modified: 2021-08-10 21:18 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (phd_kimberlite)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer freebsd_triage 2021-08-10 15:53:56 UTC
FreeBSD's base system /usr/bin/ar and /usr/bin/ranlib have a bug where the exit status is 0 (i.e., success) even in the case of a missing file, and it turns out math/lapacke relies on this.  With the bug fixed lapacke's build fails with:

ranlib SRC/liblapacke.a
ranlib: fatal: Failed to open 'SRC/liblapacke.a': No such file or directory
*** Error code 1

The referenced file is in .build/LAPACKE/liblapacke.a instead. However, note that ranlib is basically unnecessary and the invocation could just be eliminated instead.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2021-08-10 16:09:42 UTC
Fix in https://reviews.freebsd.org/D31492
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-08-10 21:07:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6fd5f57d0613a9f6d1816a912f21728b0d12435a

commit 6fd5f57d0613a9f6d1816a912f21728b0d12435a
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2021-08-10 16:01:23 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2021-08-10 21:03:05 +0000

    math/lapack: remove superfluous and broken ranlib invocation

    FreeBSD's base system ar and ranlib have a bug where they exit with
    status 0 (success) even in case of fatal errors.  This hid the fact that
    math/lapacke was invoking ranlib on a non-existent file.  (Presumably the
    ranlib invocation was correct when introduced, but broken by some
    rework of lapack's upstream build system).

    Use of ranlib is generally unncessary, assuming the -s flag is passed to
    ar (as is typical, and as done here), so just delete the invocation.

    See PR 257599 and review D31402 for the ar/ranlib base system bug.

    PR:             257599, 257744
    Reviewed by:    jrm
    Tested by:      jrm
    Approved by:    kevans (ports), portmgr (implicit, blanket: build fix)
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D31492

 math/lapack/files/static.mk | 1 -
 1 file changed, 1 deletion(-)