Bug 272602 - textpoc/ripgrep: compilation fails
Summary: textpoc/ripgrep: compilation fails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Petteri Valkonen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-19 16:17 UTC by Alexey Vyskubov
Modified: 2023-07-19 20:09 UTC (History)
1 user (show)

See Also:
petteri.valkonen: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Vyskubov 2023-07-19 16:17:43 UTC
I have FreeBSD 13.2-p1 and the latest port branch. Compilation of textproc/ripgrep fails like this: https://github.com/BurntSushi/ripgrep/issues/2516

As far as I understand, grep crate version 0.2.12 is required, and ripgrep indeed depends on it: https://github.com/BurntSushi/ripgrep/blob/304a60e8e9d4b2a42dc3dfb1ba4cef6d7bf92515/Cargo.toml#L53

However, here is what I see after failed compilation:

# grep '\<grep\>' /usr/ports/textproc/ripgrep/work/ripgrep-13.0.0/Cargo.toml | grep version
grep = { version = "0.2.8", path = "crates/grep" }
Comment 1 Joseph Mingrone freebsd_committer freebsd_triage 2023-07-19 16:22:27 UTC
A workaround is in https://reviews.freebsd.org/D41095
Comment 2 Joseph Mingrone freebsd_committer freebsd_triage 2023-07-19 16:29:33 UTC
Petteri, do you approve of the change in https://reviews.freebsd.org/D41095 ? If so, I will commit.  We can also just remove #![deny(missing_docs)] as upstream did.
Comment 3 Alexey Vyskubov 2023-07-19 16:33:26 UTC
(In reply to Joseph Mingrone from comment #1)
Why not to pump up the "grep" crate version instead?
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-07-19 16:45:35 UTC
A commit in branch main references this bug:

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

commit a2d8ee60597516c1116dedf0ab721db0e9e67ea5
Author:     Joseph Mingrone <jrm@FreeBSD.org>
AuthorDate: 2023-07-19 16:16:07 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2023-07-19 16:44:40 +0000

    textproc/ripgrep: Fix build with rust 1.71.0

    Summary:
    Do not abort if documentation is missing.

    error: missing documentation for an extern crate
      --> crates/grep/src/lib.rs:17:1
       |
    17 | pub extern crate grep_cli as cli;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |

    PR:             272602
    Reviewed by:    mikael
    Approved by:    portmgr (build fix blanket)
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D41095

 textproc/ripgrep/files/patch-crates_grep_src_lib.rs (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)
Comment 5 Joseph Mingrone freebsd_committer freebsd_triage 2023-07-19 16:56:09 UTC
(In reply to Alexey Vyskubov from comment #3)
That may be the correct fix for the next version of ripgrep, but this workaround is less intrusive than bumping dependencies to something different than what is specified in this version of ripgrep.

On the advice of mikael@ who does much of our rust work in the ports tree, I committed with a blanket portmgr approval to fix the build.
Comment 6 Alexey Vyskubov 2023-07-19 17:06:43 UTC
(In reply to Joseph Mingrone from comment #5)
That makes sense, thanks!
Comment 7 Joseph Mingrone freebsd_committer freebsd_triage 2023-07-19 17:07:41 UTC
You're welcome.  Thanks for reporting.
Comment 8 Petteri Valkonen 2023-07-19 20:00:46 UTC
(In reply to Joseph Mingrone from comment #2)

Joseph, I see you’ve already committed the change, but for posterity: LGTM.
Comment 9 Joseph Mingrone freebsd_committer freebsd_triage 2023-07-19 20:09:38 UTC
(In reply to Petteri Valkonen from comment #8)
mikael@ suggested the build be fixed without waiting through a blanket approval.  Good to know you, as the maintainer, are ok with the change.