mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-04 14:12:06 -07:00
Compare commits
16 Commits
globset-0.
...
ag/fix-ci
Author | SHA1 | Date | |
---|---|---|---|
|
6cdea9a631 | ||
|
51765f2f4c | ||
|
67abd49678 | ||
|
a7fe296772 | ||
|
f75991538b | ||
|
962d47e6a1 | ||
|
19b6a45abb | ||
|
c51790b56d | ||
|
2af3734e0c | ||
|
61733f6378 | ||
|
7227e94ce5 | ||
|
341a19e0d0 | ||
|
fed4fea217 | ||
|
053a1669bb | ||
|
31d3f16254 | ||
|
304a60e8e9 |
89
.github/workflows/ci.yml
vendored
89
.github/workflows/ci.yml
vendored
@@ -6,6 +6,27 @@ on:
|
|||||||
- master
|
- master
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '00 01 * * *'
|
- cron: '00 01 * * *'
|
||||||
|
|
||||||
|
# The section is needed to drop write-all permissions that are granted on
|
||||||
|
# `schedule` event. By specifying any permission explicitly all others are set
|
||||||
|
# to none. By using the principle of least privilege the damage a compromised
|
||||||
|
# workflow can do (because of an injection or compromised third party tool or
|
||||||
|
# action) is restricted. Currently the worklow doesn't need any additional
|
||||||
|
# permission except for pulling the code. Adding labels to issues, commenting
|
||||||
|
# on pull-requests, etc. may need additional permissions:
|
||||||
|
#
|
||||||
|
# Syntax for this section:
|
||||||
|
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
|
||||||
|
#
|
||||||
|
# Reference for how to assign permissions on a job-by-job basis:
|
||||||
|
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
|
||||||
|
#
|
||||||
|
# Reference for available permissions that we can enable if needed:
|
||||||
|
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
|
||||||
|
permissions:
|
||||||
|
# to fetch code (actions/checkout)
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: test
|
name: test
|
||||||
@@ -14,32 +35,21 @@ jobs:
|
|||||||
# systems.
|
# systems.
|
||||||
CARGO: cargo
|
CARGO: cargo
|
||||||
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
|
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
|
||||||
|
# Note that we only use cross on Linux, so setting a target on a
|
||||||
|
# different OS will just use normal cargo.
|
||||||
TARGET_FLAGS:
|
TARGET_FLAGS:
|
||||||
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
|
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
|
||||||
TARGET_DIR: ./target
|
TARGET_DIR: ./target
|
||||||
|
# Bump this as appropriate. We pin to a version to make sure CI
|
||||||
|
# continues to work as cross releases in the past have broken things
|
||||||
|
# in subtle ways.
|
||||||
|
CROSS_VERSION: v0.2.5
|
||||||
# Emit backtraces on panics.
|
# Emit backtraces on panics.
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build:
|
|
||||||
# We test ripgrep on a pinned version of Rust, along with the moving
|
|
||||||
# targets of 'stable' and 'beta' for good measure.
|
|
||||||
- pinned
|
|
||||||
- stable
|
|
||||||
- beta
|
|
||||||
# Our release builds are generated by a nightly compiler to take
|
|
||||||
# advantage of the latest optimizations/compile time improvements. So
|
|
||||||
# we test all of them here. (We don't do mips releases, but test on
|
|
||||||
# mips for big-endian coverage.)
|
|
||||||
- nightly
|
|
||||||
- nightly-musl
|
|
||||||
- nightly-32
|
|
||||||
- nightly-mips
|
|
||||||
- nightly-arm
|
|
||||||
- macos
|
|
||||||
- win-msvc
|
|
||||||
- win-gnu
|
|
||||||
include:
|
include:
|
||||||
- build: pinned
|
- build: pinned
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
@@ -53,27 +63,26 @@ jobs:
|
|||||||
- build: nightly
|
- build: nightly
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: nightly
|
rust: nightly
|
||||||
- build: nightly-musl
|
- build: stable-musl
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: nightly
|
rust: stable
|
||||||
target: x86_64-unknown-linux-musl
|
target: x86_64-unknown-linux-musl
|
||||||
- build: nightly-32
|
- build: stable-x86
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: nightly
|
rust: stable
|
||||||
target: i686-unknown-linux-gnu
|
target: i686-unknown-linux-gnu
|
||||||
- build: nightly-mips
|
- build: stable-aarch64
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: nightly
|
rust: stable
|
||||||
target: mips64-unknown-linux-gnuabi64
|
target: aarch64-unknown-linux-gnu
|
||||||
- build: nightly-arm
|
- build: stable-powerpc64
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
rust: nightly
|
rust: stable
|
||||||
# For stripping release binaries:
|
target: powerpc64-unknown-linux-gnu
|
||||||
# docker run --rm -v $PWD/target:/target:Z \
|
- build: stable-s390x
|
||||||
# rustembedded/cross:arm-unknown-linux-gnueabihf \
|
os: ubuntu-latest
|
||||||
# arm-linux-gnueabihf-strip \
|
rust: stable
|
||||||
# /target/arm-unknown-linux-gnueabihf/debug/rg
|
target: s390x-unknown-linux-gnu
|
||||||
target: arm-unknown-linux-gnueabihf
|
|
||||||
- build: macos
|
- build: macos
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
rust: nightly
|
rust: nightly
|
||||||
@@ -103,9 +112,17 @@ jobs:
|
|||||||
toolchain: ${{ matrix.rust }}
|
toolchain: ${{ matrix.rust }}
|
||||||
|
|
||||||
- name: Use Cross
|
- name: Use Cross
|
||||||
if: matrix.target != ''
|
if: matrix.os == 'ubuntu-latest' && matrix.target != ''
|
||||||
run: |
|
run: |
|
||||||
cargo install cross
|
# In the past, new releases of 'cross' have broken CI. So for now, we
|
||||||
|
# pin it. We also use their pre-compiled binary releases because cross
|
||||||
|
# has over 100 dependencies and takes a bit to compile.
|
||||||
|
dir="$RUNNER_TEMP/cross-download"
|
||||||
|
mkdir "$dir"
|
||||||
|
echo "$dir" >> $GITHUB_PATH
|
||||||
|
cd "$dir"
|
||||||
|
curl -LO "https://github.com/cross-rs/cross/releases/download/$CROSS_VERSION/cross-x86_64-unknown-linux-musl.tar.gz"
|
||||||
|
tar xf cross-x86_64-unknown-linux-musl.tar.gz
|
||||||
echo "CARGO=cross" >> $GITHUB_ENV
|
echo "CARGO=cross" >> $GITHUB_ENV
|
||||||
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
|
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
|
||||||
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
|
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
|
||||||
@@ -177,7 +194,6 @@ jobs:
|
|||||||
run: ci/test-complete
|
run: ci/test-complete
|
||||||
|
|
||||||
rustfmt:
|
rustfmt:
|
||||||
name: rustfmt
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -191,7 +207,6 @@ jobs:
|
|||||||
run: cargo fmt --all --check
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
name: Docs
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
@@ -10,7 +10,8 @@ Unreleased changes. Release notes have not yet been written.
|
|||||||
|
|
||||||
Feature enhancements:
|
Feature enhancements:
|
||||||
|
|
||||||
* Added or improved file type filtering for Ada, DITA, Elixir, Fuchsia, Gentoo, GraphQL, Markdown, Raku, TypeScript, USD, V
|
* Added or improved file type filtering for Ada, DITA, Elixir, Fuchsia, Gentoo,
|
||||||
|
Gradle, GraphQL, Markdown, Prolog, Raku, TypeScript, USD, V
|
||||||
* [FEATURE #1790](https://github.com/BurntSushi/ripgrep/issues/1790):
|
* [FEATURE #1790](https://github.com/BurntSushi/ripgrep/issues/1790):
|
||||||
Add new `--stop-on-nonmatch` flag.
|
Add new `--stop-on-nonmatch` flag.
|
||||||
* [FEATURE #2195](https://github.com/BurntSushi/ripgrep/issues/2195):
|
* [FEATURE #2195](https://github.com/BurntSushi/ripgrep/issues/2195):
|
||||||
@@ -38,6 +39,8 @@ Bug fixes:
|
|||||||
Fix bug when using inline regex flags with `-e/--regexp`.
|
Fix bug when using inline regex flags with `-e/--regexp`.
|
||||||
* [BUG #2523](https://github.com/BurntSushi/ripgrep/issues/2523):
|
* [BUG #2523](https://github.com/BurntSushi/ripgrep/issues/2523):
|
||||||
Make executable searching take `.com` into account on Windows.
|
Make executable searching take `.com` into account on Windows.
|
||||||
|
* [BUG #2574](https://github.com/BurntSushi/ripgrep/issues/2574):
|
||||||
|
Fix bug in `-w/--word-regexp` that would result in incorrect match offsets.
|
||||||
|
|
||||||
|
|
||||||
13.0.0 (2021-06-12)
|
13.0.0 (2021-06-12)
|
||||||
|
111
Cargo.lock
generated
111
Cargo.lock
generated
@@ -4,13 +4,19 @@ version = 3
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "1.0.2"
|
version = "1.0.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
|
checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "autocfg"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.20.0"
|
version = "0.20.0"
|
||||||
@@ -42,11 +48,12 @@ checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.79"
|
version = "1.0.83"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
|
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jobserver",
|
"jobserver",
|
||||||
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -88,12 +95,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encoding_rs"
|
name = "encoding_rs"
|
||||||
version = "0.8.32"
|
version = "0.8.33"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
|
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"packed_simd_2",
|
"packed_simd",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -119,7 +126,7 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "globset"
|
name = "globset"
|
||||||
version = "0.4.11"
|
version = "0.4.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"bstr",
|
"bstr",
|
||||||
@@ -148,7 +155,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "grep-cli"
|
name = "grep-cli"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bstr",
|
"bstr",
|
||||||
"globset",
|
"globset",
|
||||||
@@ -236,15 +243,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.8"
|
version = "1.0.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a"
|
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jemalloc-sys"
|
name = "jemalloc-sys"
|
||||||
version = "0.5.3+5.3.0-patched"
|
version = "0.5.4+5.3.0-patched"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f9bd5d616ea7ed58b571b2e209a65759664d7fb021a0819d7a790afc67e47ca1"
|
checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -252,9 +259,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jemallocator"
|
name = "jemallocator"
|
||||||
version = "0.5.0"
|
version = "0.5.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "16c2514137880c52b0b4822b563fadd38257c1f380858addb74a400889696ea6"
|
checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"jemalloc-sys",
|
"jemalloc-sys",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -283,21 +290,21 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libm"
|
name = "libm"
|
||||||
version = "0.1.4"
|
version = "0.2.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
|
checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.19"
|
version = "0.4.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
|
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.5.0"
|
version = "2.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
checksum = "76fc44e2588d5b436dbc3c6cf62aef290f90dab6235744a93dfe1cc18f451e2c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memmap2"
|
name = "memmap2"
|
||||||
@@ -308,6 +315,16 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-traits"
|
||||||
|
version = "0.2.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"libm",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.18.0"
|
version = "1.18.0"
|
||||||
@@ -315,13 +332,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "packed_simd_2"
|
name = "packed_simd"
|
||||||
version = "0.3.8"
|
version = "0.3.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282"
|
checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libm",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -355,27 +372,27 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.63"
|
version = "1.0.66"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb"
|
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.29"
|
version = "1.0.33"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105"
|
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.9.0"
|
version = "1.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484"
|
checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -385,9 +402,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-automata"
|
name = "regex-automata"
|
||||||
version = "0.3.0"
|
version = "0.3.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56"
|
checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -396,9 +413,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.7.3"
|
version = "0.7.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846"
|
checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ripgrep"
|
name = "ripgrep"
|
||||||
@@ -420,9 +437,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.14"
|
version = "1.0.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9"
|
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "same-file"
|
name = "same-file"
|
||||||
@@ -435,18 +452,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.166"
|
version = "1.0.188"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8"
|
checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.166"
|
version = "1.0.188"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6"
|
checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -455,9 +472,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.100"
|
version = "1.0.105"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c"
|
checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -472,9 +489,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.23"
|
version = "2.0.29"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737"
|
checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -511,9 +528,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.10"
|
version = "1.0.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73"
|
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
|
12
Cross.toml
12
Cross.toml
@@ -4,9 +4,11 @@ image = "burntsushi/cross:x86_64-unknown-linux-musl"
|
|||||||
[target.i686-unknown-linux-gnu]
|
[target.i686-unknown-linux-gnu]
|
||||||
image = "burntsushi/cross:i686-unknown-linux-gnu"
|
image = "burntsushi/cross:i686-unknown-linux-gnu"
|
||||||
|
|
||||||
[target.mips64-unknown-linux-gnuabi64]
|
[target.aarch64-unknown-linux-gnu]
|
||||||
image = "burntsushi/cross:mips64-unknown-linux-gnuabi64"
|
image = "burntsushi/cross:aarch64-unknown-linux-gnu"
|
||||||
build-std = true
|
|
||||||
|
|
||||||
[target.arm-unknown-linux-gnueabihf]
|
[target.powerpc64-unknown-linux-gnu]
|
||||||
image = "burntsushi/cross:arm-unknown-linux-gnueabihf"
|
image = "burntsushi/cross:powerpc64-unknown-linux-gnu"
|
||||||
|
|
||||||
|
[target.s390x-unknown-linux-gnu]
|
||||||
|
image = "burntsushi/cross:s390x-unknown-linux-gnu"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
FROM rustembedded/cross:arm-unknown-linux-gnueabihf
|
FROM rustembedded/cross:aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
COPY stage/ubuntu-install-packages /
|
COPY stage/ubuntu-install-packages /
|
||||||
RUN /ubuntu-install-packages
|
RUN /ubuntu-install-packages
|
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
mkdir -p stage
|
mkdir -p stage
|
||||||
cp ../../ubuntu-install-packages ./stage/
|
cp ../../ubuntu-install-packages ./stage/
|
||||||
docker build -t burntsushi/cross:arm-unknown-linux-gnueabihf .
|
docker build -t burntsushi/cross:aarch64-unknown-linux-gnu .
|
@@ -1,4 +1,4 @@
|
|||||||
FROM rustembedded/cross:mips64-unknown-linux-gnuabi64
|
FROM rustembedded/cross:powerpc64-unknown-linux-gnu
|
||||||
|
|
||||||
COPY stage/ubuntu-install-packages /
|
COPY stage/ubuntu-install-packages /
|
||||||
RUN /ubuntu-install-packages
|
RUN /ubuntu-install-packages
|
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
mkdir -p stage
|
mkdir -p stage
|
||||||
cp ../../ubuntu-install-packages ./stage/
|
cp ../../ubuntu-install-packages ./stage/
|
||||||
docker build -t burntsushi/cross:mips64-unknown-linux-gnuabi64 .
|
docker build -t burntsushi/cross:powerpc64-unknown-linux-gnu .
|
4
ci/docker/s390x-unknown-linux-gnu/Dockerfile
Normal file
4
ci/docker/s390x-unknown-linux-gnu/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
FROM rustembedded/cross:s390x-unknown-linux-gnu
|
||||||
|
|
||||||
|
COPY stage/ubuntu-install-packages /
|
||||||
|
RUN /ubuntu-install-packages
|
5
ci/docker/s390x-unknown-linux-gnu/build
Executable file
5
ci/docker/s390x-unknown-linux-gnu/build
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
mkdir -p stage
|
||||||
|
cp ../../ubuntu-install-packages ./stage/
|
||||||
|
docker build -t burntsushi/cross:s390x-unknown-linux-gnu .
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "grep-cli"
|
name = "grep-cli"
|
||||||
version = "0.1.8" #:version
|
version = "0.1.9" #:version
|
||||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||||
description = """
|
description = """
|
||||||
Utilities for search oriented command line applications.
|
Utilities for search oriented command line applications.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "globset"
|
name = "globset"
|
||||||
version = "0.4.11" #:version
|
version = "0.4.13" #:version
|
||||||
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||||
description = """
|
description = """
|
||||||
Cross platform single glob and glob set matching. Glob set matching is the
|
Cross platform single glob and glob set matching. Glob set matching is the
|
||||||
|
@@ -736,7 +736,7 @@ impl Tokens {
|
|||||||
// It is possible to have an empty set in which case the
|
// It is possible to have an empty set in which case the
|
||||||
// resulting alternation '()' would be an error.
|
// resulting alternation '()' would be an error.
|
||||||
if !parts.is_empty() {
|
if !parts.is_empty() {
|
||||||
re.push('(');
|
re.push_str("(?:");
|
||||||
re.push_str(&parts.join("|"));
|
re.push_str(&parts.join("|"));
|
||||||
re.push(')');
|
re.push(')');
|
||||||
}
|
}
|
||||||
@@ -1276,6 +1276,7 @@ mod tests {
|
|||||||
toregex!(re32, "/a**", r"^/a.*.*$");
|
toregex!(re32, "/a**", r"^/a.*.*$");
|
||||||
toregex!(re33, "/**a", r"^/.*.*a$");
|
toregex!(re33, "/**a", r"^/.*.*a$");
|
||||||
toregex!(re34, "/a**b", r"^/a.*.*b$");
|
toregex!(re34, "/a**b", r"^/a.*.*b$");
|
||||||
|
toregex!(re35, "{a,b}", r"^(?:b|a)$");
|
||||||
|
|
||||||
matches!(match1, "a", "a");
|
matches!(match1, "a", "a");
|
||||||
matches!(match2, "a*b", "a_b");
|
matches!(match2, "a*b", "a_b");
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
use serde::{
|
use serde::{
|
||||||
de::{Error, Visitor},
|
de::{Error, SeqAccess, Visitor},
|
||||||
{Deserialize, Deserializer, Serialize, Serializer},
|
{Deserialize, Deserializer, Serialize, Serializer},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::Glob;
|
use crate::{Glob, GlobSet, GlobSetBuilder};
|
||||||
|
|
||||||
impl Serialize for Glob {
|
impl Serialize for Glob {
|
||||||
fn serialize<S: Serializer>(
|
fn serialize<S: Serializer>(
|
||||||
@@ -16,7 +16,7 @@ impl Serialize for Glob {
|
|||||||
|
|
||||||
struct GlobVisitor;
|
struct GlobVisitor;
|
||||||
|
|
||||||
impl<'a> Visitor<'a> for GlobVisitor {
|
impl<'de> Visitor<'de> for GlobVisitor {
|
||||||
type Value = Glob;
|
type Value = Glob;
|
||||||
|
|
||||||
fn expecting(
|
fn expecting(
|
||||||
@@ -42,11 +42,43 @@ impl<'de> Deserialize<'de> for Glob {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct GlobSetVisitor;
|
||||||
|
|
||||||
|
impl<'de> Visitor<'de> for GlobSetVisitor {
|
||||||
|
type Value = GlobSet;
|
||||||
|
|
||||||
|
fn expecting(
|
||||||
|
&self,
|
||||||
|
formatter: &mut std::fmt::Formatter,
|
||||||
|
) -> std::fmt::Result {
|
||||||
|
formatter.write_str("an array of glob patterns")
|
||||||
|
}
|
||||||
|
|
||||||
|
fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
|
||||||
|
where
|
||||||
|
A: SeqAccess<'de>,
|
||||||
|
{
|
||||||
|
let mut builder = GlobSetBuilder::new();
|
||||||
|
while let Some(glob) = seq.next_element()? {
|
||||||
|
builder.add(glob);
|
||||||
|
}
|
||||||
|
builder.build().map_err(serde::de::Error::custom)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'de> Deserialize<'de> for GlobSet {
|
||||||
|
fn deserialize<D: Deserializer<'de>>(
|
||||||
|
deserializer: D,
|
||||||
|
) -> Result<Self, D::Error> {
|
||||||
|
deserializer.deserialize_seq(GlobSetVisitor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::Glob;
|
use crate::{Glob, GlobSet};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn glob_deserialize_borrowed() {
|
fn glob_deserialize_borrowed() {
|
||||||
@@ -85,4 +117,12 @@ mod tests {
|
|||||||
let de: Glob = serde_json::from_str(&ser).unwrap();
|
let de: Glob = serde_json::from_str(&ser).unwrap();
|
||||||
assert_eq!(test_glob, de);
|
assert_eq!(test_glob, de);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn glob_set_deserialize() {
|
||||||
|
let j = r#" ["src/**/*.rs", "README.md"] "#;
|
||||||
|
let set: GlobSet = serde_json::from_str(j).unwrap();
|
||||||
|
assert!(set.is_match("src/lib.rs"));
|
||||||
|
assert!(!set.is_match("Cargo.lock"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,6 +55,7 @@ pub const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
|
|||||||
(&["cs"], &["*.cs"]),
|
(&["cs"], &["*.cs"]),
|
||||||
(&["csharp"], &["*.cs"]),
|
(&["csharp"], &["*.cs"]),
|
||||||
(&["cshtml"], &["*.cshtml"]),
|
(&["cshtml"], &["*.cshtml"]),
|
||||||
|
(&["csproj"], &["*.csproj"]),
|
||||||
(&["css"], &["*.css", "*.scss"]),
|
(&["css"], &["*.css", "*.scss"]),
|
||||||
(&["csv"], &["*.csv"]),
|
(&["csv"], &["*.csv"]),
|
||||||
(&["cuda"], &["*.cu", "*.cuh"]),
|
(&["cuda"], &["*.cu", "*.cuh"]),
|
||||||
@@ -90,7 +91,10 @@ pub const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
|
|||||||
(&["gn"], &["*.gn", "*.gni"]),
|
(&["gn"], &["*.gn", "*.gni"]),
|
||||||
(&["go"], &["*.go"]),
|
(&["go"], &["*.go"]),
|
||||||
(&["gprbuild"], &["*.gpr"]),
|
(&["gprbuild"], &["*.gpr"]),
|
||||||
(&["gradle"], &["*.gradle"]),
|
(&["gradle"], &[
|
||||||
|
"*.gradle", "*.gradle.kts", "gradle.properties", "gradle-wrapper.*",
|
||||||
|
"gradlew", "gradlew.bat",
|
||||||
|
]),
|
||||||
(&["graphql"], &["*.graphql", "*.graphqls"]),
|
(&["graphql"], &["*.graphql", "*.graphqls"]),
|
||||||
(&["groovy"], &["*.groovy", "*.gradle"]),
|
(&["groovy"], &["*.groovy", "*.gradle"]),
|
||||||
(&["gzip"], &["*.gz", "*.tgz"]),
|
(&["gzip"], &["*.gz", "*.tgz"]),
|
||||||
@@ -197,6 +201,7 @@ pub const DEFAULT_TYPES: &[(&[&str], &[&str])] = &[
|
|||||||
(&["po"], &["*.po"]),
|
(&["po"], &["*.po"]),
|
||||||
(&["pod"], &["*.pod"]),
|
(&["pod"], &["*.pod"]),
|
||||||
(&["postscript"], &["*.eps", "*.ps"]),
|
(&["postscript"], &["*.eps", "*.ps"]),
|
||||||
|
(&["prolog"], &["*.pl", "*.pro", "*.prolog", "*.P"]),
|
||||||
(&["protobuf"], &["*.proto"]),
|
(&["protobuf"], &["*.proto"]),
|
||||||
(&["ps"], &["*.cdxml", "*.ps1", "*.ps1xml", "*.psd1", "*.psm1"]),
|
(&["ps"], &["*.cdxml", "*.ps1", "*.ps1xml", "*.psd1", "*.psm1"]),
|
||||||
(&["puppet"], &["*.epp", "*.erb", "*.pp", "*.rb"]),
|
(&["puppet"], &["*.epp", "*.erb", "*.pp", "*.rb"]),
|
||||||
@@ -326,7 +331,9 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn default_types_are_sorted() {
|
fn default_types_are_sorted() {
|
||||||
let mut names = DEFAULT_TYPES.iter().map(|(aliases, _)| aliases[0]);
|
let mut names = DEFAULT_TYPES.iter().map(|(aliases, _)| aliases[0]);
|
||||||
let Some(mut previous_name) = names.next() else { return; };
|
let Some(mut previous_name) = names.next() else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
for name in names {
|
for name in names {
|
||||||
assert!(
|
assert!(
|
||||||
name > previous_name,
|
name > previous_name,
|
||||||
|
@@ -128,6 +128,9 @@ impl WordMatcher {
|
|||||||
// The reason why we cannot handle the ^/$ cases here is because we
|
// The reason why we cannot handle the ^/$ cases here is because we
|
||||||
// can't assume anything about the original pattern. (Try commenting
|
// can't assume anything about the original pattern. (Try commenting
|
||||||
// out the checks for ^/$ below and run the tests to see examples.)
|
// out the checks for ^/$ below and run the tests to see examples.)
|
||||||
|
//
|
||||||
|
// NOTE(2023-07-31): After fixing #2574, this logic honestly still
|
||||||
|
// doesn't seem correct. Regex composition is hard.
|
||||||
let input = Input::new(haystack).span(at..haystack.len());
|
let input = Input::new(haystack).span(at..haystack.len());
|
||||||
let mut cand = match self.regex.find(input) {
|
let mut cand = match self.regex.find(input) {
|
||||||
None => return Ok(None),
|
None => return Ok(None),
|
||||||
@@ -136,8 +139,17 @@ impl WordMatcher {
|
|||||||
if cand.start() == 0 || cand.end() == haystack.len() {
|
if cand.start() == 0 || cand.end() == haystack.len() {
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
let (_, slen) = bstr::decode_utf8(&haystack[cand]);
|
// We decode the chars on either side of the match. If either char is
|
||||||
let (_, elen) = bstr::decode_last_utf8(&haystack[cand]);
|
// a word character, then that means the ^/$ matched and not \W. In
|
||||||
|
// that case, we defer to the slower engine.
|
||||||
|
let (ch, slen) = bstr::decode_utf8(&haystack[cand]);
|
||||||
|
if ch.map_or(true, regex_syntax::is_word_character) {
|
||||||
|
return Err(());
|
||||||
|
}
|
||||||
|
let (ch, elen) = bstr::decode_last_utf8(&haystack[cand]);
|
||||||
|
if ch.map_or(true, regex_syntax::is_word_character) {
|
||||||
|
return Err(());
|
||||||
|
}
|
||||||
let new_start = cand.start() + slen;
|
let new_start = cand.start() + slen;
|
||||||
let new_end = cand.end() - elen;
|
let new_end = cand.end() - elen;
|
||||||
// This occurs the original regex can match the empty string. In this
|
// This occurs the original regex can match the empty string. In this
|
||||||
|
@@ -791,6 +791,9 @@ rgtest!(f1466_no_ignore_files, |dir: Dir, mut cmd: TestCommand| {
|
|||||||
rgtest!(f2361_sort_nested_files, |dir: Dir, mut cmd: TestCommand| {
|
rgtest!(f2361_sort_nested_files, |dir: Dir, mut cmd: TestCommand| {
|
||||||
use std::{thread::sleep, time::Duration};
|
use std::{thread::sleep, time::Duration};
|
||||||
|
|
||||||
|
if crate::util::is_cross() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
dir.create("foo", "1");
|
dir.create("foo", "1");
|
||||||
sleep(Duration::from_millis(100));
|
sleep(Duration::from_millis(100));
|
||||||
dir.create_dir("dir");
|
dir.create_dir("dir");
|
||||||
|
@@ -1100,12 +1100,18 @@ rgtest!(sort_files, |dir: Dir, mut cmd: TestCommand| {
|
|||||||
});
|
});
|
||||||
|
|
||||||
rgtest!(sort_accessed, |dir: Dir, mut cmd: TestCommand| {
|
rgtest!(sort_accessed, |dir: Dir, mut cmd: TestCommand| {
|
||||||
|
if crate::util::is_cross() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
sort_setup(dir);
|
sort_setup(dir);
|
||||||
let expected = "a:test\ndir/c:test\nb:test\ndir/d:test\n";
|
let expected = "a:test\ndir/c:test\nb:test\ndir/d:test\n";
|
||||||
eqnice!(expected, cmd.args(["--sort", "accessed", "test"]).stdout());
|
eqnice!(expected, cmd.args(["--sort", "accessed", "test"]).stdout());
|
||||||
});
|
});
|
||||||
|
|
||||||
rgtest!(sortr_accessed, |dir: Dir, mut cmd: TestCommand| {
|
rgtest!(sortr_accessed, |dir: Dir, mut cmd: TestCommand| {
|
||||||
|
if crate::util::is_cross() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
sort_setup(dir);
|
sort_setup(dir);
|
||||||
let expected = "dir/d:test\nb:test\ndir/c:test\na:test\n";
|
let expected = "dir/d:test\nb:test\ndir/c:test\na:test\n";
|
||||||
eqnice!(expected, cmd.args(["--sortr", "accessed", "test"]).stdout());
|
eqnice!(expected, cmd.args(["--sortr", "accessed", "test"]).stdout());
|
||||||
|
@@ -1173,3 +1173,18 @@ rgtest!(r2480, |dir: Dir, mut cmd: TestCommand| {
|
|||||||
cmd.args(&["--only-matching", "-e", "(?i)notfoo", "-e", "bar", "file"]);
|
cmd.args(&["--only-matching", "-e", "(?i)notfoo", "-e", "bar", "file"]);
|
||||||
cmd.assert_err();
|
cmd.assert_err();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// See: https://github.com/BurntSushi/ripgrep/issues/2574
|
||||||
|
rgtest!(r2574, |dir: Dir, mut cmd: TestCommand| {
|
||||||
|
dir.create("haystack", "some.domain.com\nsome.domain.com/x\n");
|
||||||
|
let got = cmd
|
||||||
|
.args(&[
|
||||||
|
"--no-filename",
|
||||||
|
"--no-unicode",
|
||||||
|
"-w",
|
||||||
|
"-o",
|
||||||
|
r"(\w+\.)*domain\.(\w+)",
|
||||||
|
])
|
||||||
|
.stdout();
|
||||||
|
eqnice!("some.domain.com\nsome.domain.com\n", got);
|
||||||
|
});
|
||||||
|
@@ -464,19 +464,39 @@ fn dir_list<P: AsRef<Path>>(dir: P) -> Vec<String> {
|
|||||||
/// will have setup qemu to run it. While this is integrated into the Rust
|
/// will have setup qemu to run it. While this is integrated into the Rust
|
||||||
/// testing by default, we need to handle it ourselves for integration tests.
|
/// testing by default, we need to handle it ourselves for integration tests.
|
||||||
///
|
///
|
||||||
/// Thankfully, cross sets an environment variable that points to the proper
|
/// Now thankfully, cross sets `CROSS_RUNNER` to point to the right qemu
|
||||||
/// qemu binary that we want to run. So we just search for that env var and
|
/// executable. Or so one thinks. But it seems to always be set to `qemu-user`
|
||||||
/// return its value if we could find it.
|
/// and I cannot find `qemu-user` anywhere in the Docker image. Awesome.
|
||||||
|
///
|
||||||
|
/// Thers is `/linux-runner` which seems to work sometimes? But not always.
|
||||||
|
///
|
||||||
|
/// Instead, it looks like we have to use `qemu-aarch64` in the `aarch64`
|
||||||
|
/// case. Perfect, so just get the current target architecture and append it
|
||||||
|
/// to `qemu-`. Wrong. Cross (or qemu or whoever) uses `qemu-ppc64` for
|
||||||
|
/// `powerpc64`, so we can't just use the target architecture as Rust knows
|
||||||
|
/// it verbatim.
|
||||||
|
///
|
||||||
|
/// So... we just manually handle these cases. So fucking fun.
|
||||||
fn cross_runner() -> Option<String> {
|
fn cross_runner() -> Option<String> {
|
||||||
for (k, v) in std::env::vars_os() {
|
let runner = std::env::var("CROSS_RUNNER").ok()?;
|
||||||
let (k, v) = (k.to_string_lossy(), v.to_string_lossy());
|
if runner.is_empty() {
|
||||||
if !k.starts_with("CARGO_TARGET_") && !k.ends_with("_RUNNER") {
|
return None;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
if !v.starts_with("qemu-") {
|
if cfg!(target_arch = "powerpc64") {
|
||||||
continue;
|
Some("qemu-ppc64".to_string())
|
||||||
|
} else if cfg!(target_arch = "x86") {
|
||||||
|
Some("i386".to_string())
|
||||||
|
} else {
|
||||||
|
// Make a guess... Sigh.
|
||||||
|
Some(format!("qemu-{}", std::env::consts::ARCH))
|
||||||
}
|
}
|
||||||
return Some(v.into_owned());
|
}
|
||||||
}
|
|
||||||
None
|
/// Returns true if the test setup believes Cross is running and `qemu` is
|
||||||
|
/// needed to run ripgrep.
|
||||||
|
///
|
||||||
|
/// This is useful because it has been difficult to get some tests to pass
|
||||||
|
/// under Cross.
|
||||||
|
pub fn is_cross() -> bool {
|
||||||
|
std::env::var("CROSS_RUNNER").ok().map_or(false, |v| !v.is_empty())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user