Skip to content

Commit 04e4932

Browse files
committed
Merge branch 'master' into cosmopolitan
2 parents f154f5c + 7099e17 commit 04e4932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+7588
-4670
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-55
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Bug Report
2+
description: An issue with ripgrep or any of its crates (ignore, globset, etc.).
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Please review the following common issues before filing a bug. You may also be interested in reading the [FAQ](https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md)
8+
and the [user guide](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md).
9+
10+
* Unable to search for text with leading dash/hyphen: This is not a bug. Use `rg -- -mytext` or `rg -e -mytext`. See #102, #215, #624.
11+
* Unable to build with old version of Rust. This is not a bug. ripgrep tracks the latest stable release of Rust. See #1019, #1433, #2534.
12+
* ripgrep package is broken or out of date. ripgrep's author does not maintain packages for Red Hat, Ubuntu, Arch, Homebrew, WinGet, etc. If you have an issue with one of these, please contact your package maintainer. See #1637, #2264, #2459.
13+
14+
- type: checkboxes
15+
id: issue-not-common
16+
attributes:
17+
label: Please tick this box to confirm you have reviewed the above.
18+
options:
19+
- label: I have a different issue.
20+
required: true
21+
22+
- type: textarea
23+
id: ripgrep-version
24+
attributes:
25+
label: What version of ripgrep are you using?
26+
description: Enter the output of `rg --version`.
27+
placeholder: ex. ripgrep 13.0.0
28+
validations:
29+
required: true
30+
31+
- type: textarea
32+
id: install-method
33+
attributes:
34+
label: How did you install ripgrep?
35+
description: |
36+
If you installed ripgrep with snap and are getting strange file permission or file not found errors, then please do not file a bug. Instead, use one of the GitHub binary releases.
37+
38+
Please report any other issues with downstream ripgrep packages to their respective maintainers as mentioned above.
39+
placeholder: ex. Cargo, APT, Homebrew
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
id: operating-system
45+
attributes:
46+
label: What operating system are you using ripgrep on?
47+
description: Enter the name and version of your operating system.
48+
placeholder: ex. Debian 12.0, macOS 13.4.1
49+
validations:
50+
required: true
51+
52+
- type: textarea
53+
id: description
54+
attributes:
55+
label: Describe your bug.
56+
description: Give a high level description of the bug.
57+
placeholder: ex. ripgrep fails to return the expected matches when...
58+
validations:
59+
required: true
60+
61+
- type: textarea
62+
id: steps-to-reproduce
63+
attributes:
64+
label: What are the steps to reproduce the behavior?
65+
description: |
66+
If possible, please include both your search patterns and the corpus on which you are searching. Unless the bug is very obvious, then it is unlikely that it will be fixed if the ripgrep maintainers cannot reproduce it.
67+
68+
If the corpus is too big and you cannot decrease its size, file the bug anyway and the ripgrep maintainers will help figure out next steps.
69+
placeholder: >
70+
ex. Run `rg bar` in a directory containing a file with the lines 'bar' and 'barbaz'
71+
validations:
72+
required: true
73+
74+
- type: textarea
75+
id: actual-behavior
76+
attributes:
77+
label: What is the actual behavior?
78+
description: |
79+
Show the command you ran and the actual output. **Include the `--debug` flag in your invocation of ripgrep.**
80+
81+
If the output is large, put it in a gist: <https://gist.github.com/>
82+
83+
If the output is small, put it in code fences (see placeholder text).
84+
placeholder: |
85+
ex.
86+
```
87+
$ rg --debug bar
88+
DEBUG|grep_regex::literal|crates/regex/src/literal.rs:58: literal prefixes detected: Literals { lits: [Complete(bar)], limit_size: 250, limit_class: 10 }
89+
...
90+
```
91+
validations:
92+
required: true
93+
94+
- type: textarea
95+
id: expected-behavior
96+
attributes:
97+
label: What is the expected behavior?
98+
description: What do you think ripgrep should have done?
99+
placeholder: ex. ripgrep should have returned 2 matches
100+
validations:
101+
required: true

.github/workflows/ci.yml

+80-62
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ on:
66
- master
77
schedule:
88
- cron: '00 01 * * *'
9+
10+
# The section is needed to drop write-all permissions that are granted on
11+
# `schedule` event. By specifying any permission explicitly all others are set
12+
# to none. By using the principle of least privilege the damage a compromised
13+
# workflow can do (because of an injection or compromised third party tool or
14+
# action) is restricted. Currently the worklow doesn't need any additional
15+
# permission except for pulling the code. Adding labels to issues, commenting
16+
# on pull-requests, etc. may need additional permissions:
17+
#
18+
# Syntax for this section:
19+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
20+
#
21+
# Reference for how to assign permissions on a job-by-job basis:
22+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
23+
#
24+
# Reference for available permissions that we can enable if needed:
25+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
26+
permissions:
27+
# to fetch code (actions/checkout)
28+
contents: read
29+
930
jobs:
1031
test:
1132
name: test
@@ -14,81 +35,69 @@ jobs:
1435
# systems.
1536
CARGO: cargo
1637
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
38+
# Note that we only use cross on Linux, so setting a target on a
39+
# different OS will just use normal cargo.
1740
TARGET_FLAGS:
1841
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
1942
TARGET_DIR: ./target
43+
# Bump this as appropriate. We pin to a version to make sure CI
44+
# continues to work as cross releases in the past have broken things
45+
# in subtle ways.
46+
CROSS_VERSION: v0.2.5
2047
# Emit backtraces on panics.
2148
RUST_BACKTRACE: 1
2249
runs-on: ${{ matrix.os }}
2350
strategy:
51+
fail-fast: false
2452
matrix:
25-
build:
26-
# We test ripgrep on a pinned version of Rust, along with the moving
27-
# targets of 'stable' and 'beta' for good measure.
28-
- pinned
29-
- stable
30-
- beta
31-
# Our release builds are generated by a nightly compiler to take
32-
# advantage of the latest optimizations/compile time improvements. So
33-
# we test all of them here. (We don't do mips releases, but test on
34-
# mips for big-endian coverage.)
35-
- nightly
36-
- nightly-musl
37-
- nightly-32
38-
- nightly-mips
39-
- nightly-arm
40-
- macos
41-
- win-msvc
42-
- win-gnu
4353
include:
4454
- build: pinned
45-
os: ubuntu-18.04
46-
rust: 1.52.1
55+
os: ubuntu-latest
56+
rust: 1.72.1
4757
- build: stable
48-
os: ubuntu-18.04
58+
os: ubuntu-latest
4959
rust: stable
5060
- build: beta
51-
os: ubuntu-18.04
61+
os: ubuntu-latest
5262
rust: beta
5363
- build: nightly
54-
os: ubuntu-18.04
55-
rust: nightly
56-
- build: nightly-musl
57-
os: ubuntu-18.04
64+
os: ubuntu-latest
5865
rust: nightly
66+
- build: stable-musl
67+
os: ubuntu-latest
68+
rust: stable
5969
target: x86_64-unknown-linux-musl
60-
- build: nightly-32
61-
os: ubuntu-18.04
62-
rust: nightly
70+
- build: stable-x86
71+
os: ubuntu-latest
72+
rust: stable
6373
target: i686-unknown-linux-gnu
64-
- build: nightly-mips
65-
os: ubuntu-18.04
66-
rust: nightly
67-
target: mips64-unknown-linux-gnuabi64
68-
- build: nightly-arm
69-
os: ubuntu-18.04
70-
rust: nightly
71-
# For stripping release binaries:
72-
# docker run --rm -v $PWD/target:/target:Z \
73-
# rustembedded/cross:arm-unknown-linux-gnueabihf \
74-
# arm-linux-gnueabihf-strip \
75-
# /target/arm-unknown-linux-gnueabihf/debug/rg
76-
target: arm-unknown-linux-gnueabihf
74+
- build: stable-aarch64
75+
os: ubuntu-latest
76+
rust: stable
77+
target: aarch64-unknown-linux-gnu
78+
- build: stable-powerpc64
79+
os: ubuntu-latest
80+
rust: stable
81+
target: powerpc64-unknown-linux-gnu
82+
- build: stable-s390x
83+
os: ubuntu-latest
84+
rust: stable
85+
target: s390x-unknown-linux-gnu
7786
- build: macos
7887
os: macos-latest
7988
rust: nightly
8089
- build: win-msvc
81-
os: windows-2019
90+
os: windows-2022
8291
rust: nightly
8392
- build: win-gnu
84-
os: windows-2019
93+
os: windows-2022
8594
rust: nightly-x86_64-gnu
8695
steps:
8796
- name: Checkout repository
88-
uses: actions/checkout@v2
97+
uses: actions/checkout@v3
8998

9099
- name: Install packages (Ubuntu)
91-
if: matrix.os == 'ubuntu-18.04'
100+
if: matrix.os == 'ubuntu-latest'
92101
run: |
93102
ci/ubuntu-install-packages
94103
@@ -98,14 +107,22 @@ jobs:
98107
ci/macos-install-packages
99108
100109
- name: Install Rust
101-
uses: dtolnay/rust-toolchain@v1
110+
uses: dtolnay/rust-toolchain@master
102111
with:
103112
toolchain: ${{ matrix.rust }}
104113

105114
- name: Use Cross
106-
if: matrix.target != ''
115+
if: matrix.os == 'ubuntu-latest' && matrix.target != ''
107116
run: |
108-
cargo install cross
117+
# In the past, new releases of 'cross' have broken CI. So for now, we
118+
# pin it. We also use their pre-compiled binary releases because cross
119+
# has over 100 dependencies and takes a bit to compile.
120+
dir="$RUNNER_TEMP/cross-download"
121+
mkdir "$dir"
122+
echo "$dir" >> $GITHUB_PATH
123+
cd "$dir"
124+
curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
125+
tar xf cross-x86_64-unknown-linux-musl.tar.gz
109126
echo "CARGO=cross" >> $GITHUB_ENV
110127
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
111128
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
@@ -148,14 +165,14 @@ jobs:
148165
run: ${{ env.CARGO }} test --verbose --workspace ${{ env.TARGET_FLAGS }}
149166

150167
- name: Test for existence of build artifacts (Windows)
151-
if: matrix.os == 'windows-2019'
168+
if: matrix.os == 'windows-2022'
152169
shell: bash
153170
run: |
154171
outdir="$(ci/cargo-out-dir "${{ env.TARGET_DIR }}")"
155172
ls "$outdir/_rg.ps1" && file "$outdir/_rg.ps1"
156173
157174
- name: Test for existence of build artifacts (Unix)
158-
if: matrix.os != 'windows-2019'
175+
if: matrix.os != 'windows-2022'
159176
shell: bash
160177
run: |
161178
outdir="$(ci/cargo-out-dir "${{ env.TARGET_DIR }}")"
@@ -172,33 +189,34 @@ jobs:
172189
# 'rg' binary (done in test-complete) with qemu, which is a pain and
173190
# doesn't really gain us much. If shell completion works in one place,
174191
# it probably works everywhere.
175-
if: matrix.target == '' && matrix.os != 'windows-2019'
192+
if: matrix.target == '' && matrix.os != 'windows-2022'
176193
shell: bash
177194
run: ci/test-complete
178195

196+
- name: Print hostname detected by grep-cli crate
197+
shell: bash
198+
run: ${{ env.CARGO }} test --manifest-path crates/cli/Cargo.toml ${{ env.TARGET_FLAGS }} --lib print_hostname -- --nocapture
199+
179200
rustfmt:
180-
name: rustfmt
181-
runs-on: ubuntu-18.04
201+
runs-on: ubuntu-latest
182202
steps:
183203
- name: Checkout repository
184-
uses: actions/checkout@v2
204+
uses: actions/checkout@v3
185205
- name: Install Rust
186-
uses: dtolnay/rust-toolchain@v1
206+
uses: dtolnay/rust-toolchain@master
187207
with:
188208
toolchain: stable
189209
components: rustfmt
190210
- name: Check formatting
191-
run: |
192-
cargo fmt --all -- --check
211+
run: cargo fmt --all --check
193212

194213
docs:
195-
name: Docs
196-
runs-on: ubuntu-20.04
214+
runs-on: ubuntu-latest
197215
steps:
198216
- name: Checkout repository
199-
uses: actions/checkout@v2
217+
uses: actions/checkout@v3
200218
- name: Install Rust
201-
uses: dtolnay/rust-toolchain@v1
219+
uses: dtolnay/rust-toolchain@master
202220
with:
203221
toolchain: stable
204222
- name: Check documentation

0 commit comments

Comments
 (0)