ripgrep 11.0.2
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
apt-get install -y ripgrep strace
Running with gitlab-runner 13.1.0 (6214287e)
on docker-auto-scale ed2dce3a
Preparing the "docker+machine" executor
Using Docker executor with image ubuntu:20.04 ...
ripgrep doesn't show anything on GitLab CI and just quit.
Use this gitlab-ci.yml and run the pipeline.
image: ubuntu:20.04
before_script:
- apt-get update
- apt-get install -y ripgrep strace
test:
script:
- mkdir -p /tmp/test
- cd /tmp/test
- echo test > test
- echo temp > temp
- ls -la
- grep te *
- rg --version
- rg te
https://gitlab.com/danpintara/ripgrep-test/-/pipelines/160716263
It should works, at least show something like what grep does.
$ grep te *
temp:temp
test:test
My guess is that gitlab is improperly advertising stdin as available. Please use rg te ./ instead. (When you provide no paths to ripgrep to search, it has to guess between reading stdin or searching the current directory. It does the former only when stdin is available. So ripgrep is likely trying to read from it, and gitlab is likely leaving it open but not writing anything to stdin. Which means ripgrep will block forever.)
Sorry for putting an invalid bug report, but thank you, @BurntSushi, for helping me with this problem, which I've struggled for nearly the whole day. I confirmed that your solution works here: https://gitlab.com/danpintara/ripgrep-test/-/jobs/614149788
To clarify, it's not waiting forever but it just quit. From what I got from your comment, the situation is somewhat like this:
$ echo | rg te | cat
$ echo $?
1
If I put the path, ripgrep will use that instead of using the standard input:
$ echo | rg te . | cat
./test:test
./temp:temp
$ echo $?
1
I learned new things today.
Ah okay. It probably quit because stdin was closed.
Most helpful comment
Ah okay. It probably quit because stdin was closed.