Compare commits

...

9 Commits

Author SHA1 Message Date
Andrew Gallant
6cdea9a631 ci: replace mips with powerpc64, aarch64 and s390x
We drop our MIPS target because it no longer works.[1] We were
previously using it as a means of testing ripgrep in a big endian
environment. So to achieve that without MIPS, we test on powerpc64 and
s390x. (No particular reason to do both, but why not.)

We also add aarch64 as a proxy for at least ensuring everything works
for the same architecture as Apple silicon. It's not a guarantee that
everything works, but it seems better than nothing until we can actually
test Apple silicon in CI.

[1]: c788378d6f
2023-08-28 22:35:04 -04:00
Andrew Gallant
51765f2f4c ignore: apply rustfmt
I believe this happened because rustfmt now knows how to format `let ...
else` constructs.
2023-08-28 20:09:26 -04:00
Andrew Gallant
67abd49678 deps: bump everything else 2023-08-28 20:00:41 -04:00
Andrew Gallant
a7fe296772 deps: bump regex, regex-automata and regex-syntax 2023-08-28 19:59:09 -04:00
Andrew Gallant
f75991538b deps: bump memchr to 2.6.0
This in particular brings in a PR[1] that provides huge speedups on
aarch64 (e.g., Apple silicon).

[1]: https://github.com/BurntSushi/memchr/pull/129
2023-08-28 19:56:59 -04:00
mataha
962d47e6a1 ignore/types: add Prolog file types
This improves the Prolog file type rules.

* `.pl` is the most common extension in the wild, though `.pro` is
   preferred in places where file extension may clash with Perl[1].
* `.P` is used for compatibility with XSB Prolog dialect[2].

PR #2590

[1]: https://www.swi-prolog.org/pldoc/man?section=fileext
[2]: https://www.swi-prolog.org/pldoc/man?section=xsb-source
2023-08-21 10:53:56 -04:00
mataha
19b6a45abb ignore/types: tweak Gradle file types
This PR extends Gradle file types with the following:

 - Kotlin DSL buildscripts (`*.gradle.kts`)
 - Gradle Java properties (`gradle.properties`)
 - wrapper files (`gradle-wrapper.*`)
 - wrapper scripts (`gradlew`, `gradlew.bat`)

PR #2587
2023-08-20 18:49:02 -04:00
Andrew Gallant
c51790b56d deps: update everything 2023-08-15 11:09:46 -04:00
Andrew Gallant
2af3734e0c deps: update aho-corasick
This brings in [1,2], which improves memory usage substantially when
Aho-Corasick is used.

[1]: https://github.com/BurntSushi/aho-corasick/pull/120
[2]: https://github.com/BurntSushi/aho-corasick/pull/121
2023-08-15 11:08:41 -04:00
14 changed files with 186 additions and 107 deletions

View File

@@ -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

View File

@@ -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):

107
Cargo.lock generated
View File

@@ -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]]
@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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 .

View File

@@ -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

View File

@@ -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 .

View File

@@ -0,0 +1,4 @@
FROM rustembedded/cross:s390x-unknown-linux-gnu
COPY stage/ubuntu-install-packages /
RUN /ubuntu-install-packages

View File

@@ -0,0 +1,5 @@
#!/bin/sh
mkdir -p stage
cp ../../ubuntu-install-packages ./stage/
docker build -t burntsushi/cross:s390x-unknown-linux-gnu .

View File

@@ -91,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"]),
@@ -198,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"]),
@@ -327,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,

View File

@@ -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");

View File

@@ -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());

View File

@@ -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())
} }