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

Build failure: ripgrep-all #250306

Closed
bayazidbh opened this issue Aug 20, 2023 · 15 comments · Fixed by #264362
Closed

Build failure: ripgrep-all #250306

bayazidbh opened this issue Aug 20, 2023 · 15 comments · Fixed by #264362
Labels
0.kind: build failure A package fails to build

Comments

@bayazidbh
Copy link

Steps To Reproduce

Steps to reproduce the behavior:

  1. build ripgrep-all

Build log

error: builder for '/nix/store/md5x85n2jdc3rxxi8i8nbb63g3qvp866-ripgrep-all-0.9.6.drv' failed with exit code 1;
       last 10 log lines:
       > adapter: poppler
       > adapter: poppler
       > adapter: zip
       > adapter: poppler
       > adapter: pandoc
       > Unknown option --atx-headers.
       > Try pandoc --help for more information.
       > Error: Broken pipe (os error 32)
       > -------------------------------------------------------------------------------
       > ERROR: test1 failed! Could not find the word 'hello' 26 times in the sample data.
       For full logs, run 'nix log /nix/store/md5x85n2jdc3rxxi8i8nbb63g3qvp866-ripgrep-all-0.9.6.drv'.

Additional context

https://discourse.nixos.org/t/ripgrep-all-build-error-on-latest-unstable/31907

It looks like ripgrep-all is trying to use a the pandoc flag --atx-headers, which no longer exists.
Upstream issue: Failure on searching epub with pandoc deprecation warning · Issue #115 · phiresky/ripgrep-all · GitHub

It looks like it was already fixed: fixes to postprocessing · phiresky/ripgrep-all@020000c · GitHub.

Updating ripgrep-all to the latest version should fix this, the release in nixpkgs is from 2020-05-19.

Notify maintainers

@Ma27 @zaninime

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.4.10-200.fc38.x86_64, Fedora Linux, 38.20230817.0 (Kinoite), nobuild`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/home/fenglengshun/.nix-defexpr/channels/nixpkgs`
@bayazidbh bayazidbh added the 0.kind: build failure A package fails to build label Aug 20, 2023
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/ripgrep-all-build-error-on-latest-unstable/31907/4

@delroth
Copy link
Contributor

delroth commented Aug 20, 2023

Updating ripgrep-all to the latest version should fix this, the release in nixpkgs is from 2020-05-19.

Upstream hasn't released a more recent version, fwiw. Probably best to cherry-pick the patch?

@liketechnik
Copy link
Member

For me the patch fails to apply cleanly on current (unstable) nixpkgs:

Build log
all-0.9.6.drv^*'
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/kfq2v7zln6bsarfch48kq7nrllmhzh9v-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/blwmdx1gqrdb8yfd29617plx1lm4jkci-ripgrep-all-0.9.6-vendor.tar.gz
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/fnpvgw7mpg6g39zf5y504lpb368dwad4-020000cc77d0d63c5a7b2871e6f22550b4dbc1a0.patch
can't find file to patch at input line 21
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 020000cc77d0d63c5a7b2871e6f22550b4dbc1a0 Mon Sep 17 00:00:00 2001
|From: phiresky <[email protected]>
|Date: Thu, 26 Aug 2021 14:54:42 +0200
|Subject: [PATCH] fixes to postprocessing
|
|---
| src/adapters/custom.rs   |   2 +-
| src/adapters/postproc.rs | 123 ++++++++++++++++++++++++++++++++++-----
| src/adapters/spawning.rs |   4 --
| src/adapters/zip.rs      |   2 +-
| src/bin/rga-preproc.rs   |  10 +++-
| src/caching_writer.rs    |   2 +-
| src/pipe.rs              |   1 -
| src/preproc_cache.rs     |  15 +++--
| 8 files changed, 129 insertions(+), 30 deletions(-)
|
|diff --git a/src/adapters/custom.rs b/src/adapters/custom.rs
|index b320a572..b2975167 100644
|--- a/src/adapters/custom.rs
|+++ b/src/adapters/custom.rs
--------------------------
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/kfq2v7zln6bsarfch48kq7nrllmhzh9v-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/blwmdx1gqrdb8yfd29617plx1lm4jkci-ripgrep-all-0.9.6-vendor.tar.gz
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/fnpvgw7mpg6g39zf5y504lpb368dwad4-020000cc77d0d63c5a7b2871e6f22550b4dbc1a0.patch
can't find file to patch at input line 21
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 020000cc77d0d63c5a7b2871e6f22550b4dbc1a0 Mon Sep 17 00:00:00 2001
|From: phiresky <[email protected]>
|Date: Thu, 26 Aug 2021 14:54:42 +0200
|Subject: [PATCH] fixes to postprocessing
|
|---
| src/adapters/custom.rs   |   2 +-
| src/adapters/postproc.rs | 123 ++++++++++++++++++++++++++++++++++-----
| src/adapters/spawning.rs |   4 --
| src/adapters/zip.rs      |   2 +-
| src/bin/rga-preproc.rs   |  10 +++-
| src/caching_writer.rs    |   2 +-
| src/pipe.rs              |   1 -
| src/preproc_cache.rs     |  15 +++--
| 8 files changed, 129 insertions(+), 30 deletions(-)
|
|diff --git a/src/adapters/custom.rs b/src/adapters/custom.rs
|index b320a572..b2975167 100644
|--- a/src/adapters/custom.rs
|+++ b/src/adapters/custom.rs
--------------------------
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/kfq2v7zln6bsarfch48kq7nrllmhzh9v-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/blwmdx1gqrdb8yfd29617plx1lm4jkci-ripgrep-all-0.9.6-vendor.tar.gz
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/fnpvgw7mpg6g39zf5y504lpb368dwad4-020000cc77d0d63c5a7b2871e6f22550b4dbc1a0.patch
can't find file to patch at input line 21
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 020000cc77d0d63c5a7b2871e6f22550b4dbc1a0 Mon Sep 17 00:00:00 2001
|From: phiresky <[email protected]>
|Date: Thu, 26 Aug 2021 14:54:42 +0200
|Subject: [PATCH] fixes to postprocessing
|
|---
| src/adapters/custom.rs   |   2 +-
| src/adapters/postproc.rs | 123 ++++++++++++++++++++++++++++++++++-----
| src/adapters/spawning.rs |   4 --
| src/adapters/zip.rs      |   2 +-
| src/bin/rga-preproc.rs   |  10 +++-
| src/caching_writer.rs    |   2 +-
| src/pipe.rs              |   1 -
| src/preproc_cache.rs     |  15 +++--
| 8 files changed, 129 insertions(+), 30 deletions(-)
|
|diff --git a/src/adapters/custom.rs b/src/adapters/custom.rs
|index b320a572..b2975167 100644
|--- a/src/adapters/custom.rs
|+++ b/src/adapters/custom.rs
--------------------------
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/kfq2v7zln6bsarfch48kq7nrllmhzh9v-source
source root is source
Executing cargoSetupPostUnpackHook
unpacking source archive /nix/store/blwmdx1gqrdb8yfd29617plx1lm4jkci-ripgrep-all-0.9.6-vendor.tar.gz
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/fnpvgw7mpg6g39zf5y504lpb368dwad4-020000cc77d0d63c5a7b2871e6f22550b4dbc1a0.patch
can't find file to patch at input line 21
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From 020000cc77d0d63c5a7b2871e6f22550b4dbc1a0 Mon Sep 17 00:00:00 2001
|From: phiresky <[email protected]>
|Date: Thu, 26 Aug 2021 14:54:42 +0200
|Subject: [PATCH] fixes to postprocessing
|
|---
| src/adapters/custom.rs   |   2 +-
| src/adapters/postproc.rs | 123 ++++++++++++++++++++++++++++++++++-----
| src/adapters/spawning.rs |   4 --
| src/adapters/zip.rs      |   2 +-
| src/bin/rga-preproc.rs   |  10 +++-
| src/caching_writer.rs    |   2 +-
| src/pipe.rs              |   1 -
| src/preproc_cache.rs     |  15 +++--
| 8 files changed, 129 insertions(+), 30 deletions(-)
|
|diff --git a/src/adapters/custom.rs b/src/adapters/custom.rs
|index b320a572..b2975167 100644
|--- a/src/adapters/custom.rs
|+++ b/src/adapters/custom.rs
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 34
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/src/adapters/postproc.rs b/src/adapters/postproc.rs
|index cbca91d1..00482001 100644
|--- a/src/adapters/postproc.rs
|+++ b/src/adapters/postproc.rs

@liketechnik
Copy link
Member

And I just checked, the probably most relevant change (which changes the options passed to pandoc, I believe from skimming the diff), cannot be applied stand-alone either, since the file does not exist in 0.9.6, which nixpkgs ships :(

@liketechnik
Copy link
Member

liketechnik commented Aug 20, 2023

Yes, but that is src/adapters/custom.rs in the commit -- custom.rs vs pandoc.rs

@liketechnik
Copy link
Member

liketechnik commented Aug 20, 2023

GitHub won't let me upload it here, so here's a gist for a minimalist version of the original commit. That patch can be applied to the 0.9.6 version and allows the tests to pass again.


Does this approach sound feasible to you? I would open a PR then...

@zaninime
Copy link
Contributor

I'm wondering if it's really better to keep patching 0.9.6 or updating directly to 1.0.0-alpha.5 in unstable and do a backport. Sure there are quite some code changes but if this issue went unnoticed all this time, the likelihood we'll actually break someone's usage is pretty low.

@lelgenio
Copy link
Contributor

@zaninime I tried updating to 1.0.0-alpha.5, it's not good. In particular adapters=tesseract does not seem to work.
I would advise patching 0.9.6 until 1.0.

@phiresky
Copy link

Tesseract Adapter was removed and won't make it back in 1.0 either

@magnetophon
Copy link
Member

@zaninime I tried updating to 1.0.0-alpha.5, it's not good. In particular adapters=tesseract does not seem to work. I would advise patching 0.9.6 until 1.0.

I also tried it. Other than missing Tesseract, was there anything else not good?

@MarkRijckenberg
Copy link

MarkRijckenberg commented Oct 24, 2023

I had this issue with ripgrep-all when trying to upgrade from NixOS 23.05 to unstable. As a workaround/mitigation strategy, I installed config.nur.repos.fliegendewurst.ripgrep-all to get NixOS upgraded to unstable.

So I'm using ripgrep-all 0.9.7-alpha.0 from nur....

Contents of my /nix/store:

-r--r--r-- 2 root root 4.1K Jan 1 1970 xgfijrdsgsp9r8jf77m18dr4lyifzf6l-ripgrep-all-0.9.7-infdev-vendor.tar.gz.drv
-r--r--r-- 2 root root 4.0K Jan 1 1970 jcpsrykb4r2q2yi6hp444lrb5wckq3yz-ripgrep-13.0.0-vendor.tar.gz.drv
-r--r--r-- 2 root root 4.2K Jan 1 1970 dc1m3gfpvr0xzyxlha729bj4whvhnb1n-ripgrep-all-0.9.7-infdev.drv
-r--r--r-- 2 root root 4.2K Jan 1 1970 49gqfknllbfj9p8hg9iqivzbhk42ah3g-ripgrep-all-0.9.7-infdev.drv
-r--r--r-- 2 root root 3.9K Jan 1 1970 155qhfj2zr7a7p1dz2qrb870sh0vm57w-ripgrep-13.0.0.drv

@pinpox
Copy link
Member

pinpox commented Oct 29, 2023

Any updates on this?

@magnetophon
Copy link
Member

IMHO, we should use the 1.0 branch.
Appart from tesseract, it seems to work just fine, and that doesn't leave us depending on patches.

pinpox added a commit to pinpox/nixpkgs that referenced this issue Oct 30, 2023
@pinpox
Copy link
Member

pinpox commented Oct 30, 2023

Created a PR to use 1.0 branch here: #264362
Tests run during build, the custom ones did no longer work. Also had to change the dependencies, tessaract is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: build failure A package fails to build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants