summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYounes El-karama <yelkarama@users.noreply.github.com>2024-01-05 01:06:42 -0500
committerAndrew Gallant <jamslam@gmail.com>2024-01-06 10:21:34 -0500
commit827082a33ae7d86846a103ef14fb9ff297587049 (patch)
treed67fe58453214c65448d60c742490db37f150b0d
parent6c2a550e1ed190351707dbcb28d5085a89ac0710 (diff)
ci: add more ARM build configurations to CI and release workflows
... it turns out that rustembedded/cross:armv7-unknown-linux-musleabi doesn't exist. And looking more closely, it looks like the Cross project has decided to shake things up and publish images to ghcr instead. So we migrate everything over to that.
-rw-r--r--.github/workflows/ci.yml12
-rw-r--r--.github/workflows/release.yml34
-rw-r--r--tests/feature.rs4
-rw-r--r--tests/misc.rs4
-rw-r--r--tests/regression.rs2
-rw-r--r--tests/util.rs30
6 files changed, 70 insertions, 16 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b37753e7..d21b85ab 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -75,6 +75,18 @@ jobs:
os: ubuntu-latest
rust: stable
target: aarch64-unknown-linux-gnu
+ - build: stable-arm-gnueabihf
+ os: ubuntu-latest
+ rust: stable
+ target: armv7-unknown-linux-gnueabihf
+ - build: stable-arm-musleabihf
+ os: ubuntu-latest
+ rust: stable
+ target: armv7-unknown-linux-musleabihf
+ - build: stable-arm-musleabi
+ os: ubuntu-latest
+ rust: stable
+ target: armv7-unknown-linux-musleabi
- build: stable-powerpc64
os: ubuntu-latest
rust: stable
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b10c0761..f6ea3d92 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -80,6 +80,24 @@ jobs:
target: aarch64-unknown-linux-gnu
strip: aarch64-linux-gnu-strip
qemu: qemu-aarch64
+ - build: stable-arm-gnueabihf
+ os: ubuntu-latest
+ rust: stable
+ target: armv7-unknown-linux-gnueabihf
+ strip: arm-linux-gnueabihf-strip
+ qemu: qemu-arm
+ - build: stable-arm-musleabihf
+ os: ubuntu-latest
+ rust: stable
+ target: armv7-unknown-linux-musleabihf
+ strip: arm-linux-musleabihf-strip
+ qemu: qemu-arm
+ - build: stable-arm-musleabi
+ os: ubuntu-latest
+ rust: stable
+ target: armv7-unknown-linux-musleabi
+ strip: arm-linux-musleabi-strip
+ qemu: qemu-arm
- build: stable-powerpc64
os: ubuntu-latest
rust: stable
@@ -175,9 +193,9 @@ jobs:
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.strip }}" \
- "/target/${{ matrix.target }}/release/rg"
+ "/$BIN"
- name: Determine archive name
shell: bash
@@ -210,31 +228,31 @@ jobs:
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.qemu }}" "/$BIN" --version
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.qemu }}" "/$BIN" \
--generate complete-bash > "$ARCHIVE/complete/rg.bash"
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.qemu }}" "/$BIN" \
--generate complete-fish > "$ARCHIVE/complete/rg.fish"
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.qemu }}" "/$BIN" \
--generate complete-powershell > "$ARCHIVE/complete/_rg.ps1"
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.qemu }}" "/$BIN" \
--generate complete-zsh > "$ARCHIVE/complete/_rg"
docker run --rm -v \
"$PWD/target:/target:Z" \
- "rustembedded/cross:${{ matrix.target }}" \
+ "ghcr.io/cross-rs/${{ matrix.target }}:main" \
"${{ matrix.qemu }}" "/$BIN" \
--generate man > "$ARCHIVE/doc/rg.1"
diff --git a/tests/feature.rs b/tests/feature.rs
index b0a70acc..5a2cff4f 100644
--- a/tests/feature.rs
+++ b/tests/feature.rs
@@ -972,7 +972,7 @@ rgtest!(f1404_nothing_searched_warning, |dir: Dir, mut cmd: TestCommand| {
cmd.assert_err();
// Test that we actually get an error message that we expect.
- let output = cmd.cmd().output().unwrap();
+ let output = cmd.raw_output();
let stderr = String::from_utf8_lossy(&output.stderr);
let expected = "\
No files were searched, which means ripgrep probably applied \
@@ -995,7 +995,7 @@ rgtest!(f1404_nothing_searched_ignored, |dir: Dir, mut cmd: TestCommand| {
// But since --no-messages is given, there should not be any error message
// printed.
- let output = cmd.cmd().output().unwrap();
+ let output = cmd.raw_output();
let stderr = String::from_utf8_lossy(&output.stderr);
let expected = "";
eqnice!(expected, stderr);
diff --git a/tests/misc.rs b/tests/misc.rs
index 40779056..f1091b92 100644
--- a/tests/misc.rs
+++ b/tests/misc.rs
@@ -411,7 +411,7 @@ rgtest!(include_zero, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--count", "--include-zero", "nada"]);
cmd.assert_err();
- let output = cmd.cmd().output().unwrap();
+ let output = cmd.raw_output();
let stdout = String::from_utf8_lossy(&output.stdout);
let expected = "sherlock:0\n";
@@ -423,7 +423,7 @@ rgtest!(include_zero_override, |dir: Dir, mut cmd: TestCommand| {
cmd.args(&["--count", "--include-zero", "--no-include-zero", "nada"]);
cmd.assert_err();
- let output = cmd.cmd().output().unwrap();
+ let output = cmd.raw_output();
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(stdout.is_empty());
});
diff --git a/tests/regression.rs b/tests/regression.rs
index dc463aa3..ef0a3339 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -399,7 +399,7 @@ rgtest!(r428_unrecognized_style, |dir: Dir, mut cmd: TestCommand| {
cmd.arg("--colors=match:style:").arg("Sherlock");
cmd.assert_err();
- let output = cmd.cmd().output().unwrap();
+ let output = cmd.raw_output();
let stderr = String::from_utf8_lossy(&output.stderr);
let expected = "\
error parsing flag --colors: \
diff --git a/tests/util.rs b/tests/util.rs
index b7fc9f78..bac5f2e6 100644
--- a/tests/util.rs
+++ b/tests/util.rs
@@ -9,6 +9,8 @@ use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;
use std::time::Duration;
+use bstr::ByteSlice;
+
static TEST_DIR: &'static str = "ripgrep-tests";
static NEXT_ID: AtomicUsize = AtomicUsize::new(0);
@@ -325,13 +327,21 @@ impl TestCommand {
/// Gets the output of a command. If the command failed, then this panics.
pub fn output(&mut self) -> process::Output {
- let output = self.cmd.output().unwrap();
+ let output = self.raw_output();
self.expect_success(output)
}
+ /// Gets the raw output of a command after filtering nonsense like jemalloc
+ /// error messages from stderr.
+ pub fn raw_output(&mut self) -> process::Output {
+ let mut output = self.cmd.output().unwrap();
+ output.stderr = strip_jemalloc_nonsense(&output.stderr);
+ output
+ }
+
/// Runs the command and asserts that it resulted in an error exit code.
pub fn assert_err(&mut self) {
- let o = self.cmd.output().unwrap();
+ let o = self.raw_output();
if o.status.success() {
panic!(
"\n\n===== {:?} =====\n\
@@ -479,7 +489,7 @@ fn dir_list<P: AsRef<Path>>(dir: P) -> Vec<String> {
/// So... we just manually handle these cases. So fucking fun.
fn cross_runner() -> Option<String> {
let runner = std::env::var("CROSS_RUNNER").ok()?;
- if runner.is_empty() {
+ if runner.is_empty() || runner == "empty" {
return None;
}
if cfg!(target_arch = "powerpc64") {
@@ -500,3 +510,17 @@ fn cross_runner() -> Option<String> {
pub fn is_cross() -> bool {
std::env::var("CROSS_RUNNER").ok().map_or(false, |v| !v.is_empty())
}
+
+/// Strips absolutely fucked `<jemalloc>:` lines from the output.
+///
+/// In theory this only happens under qemu, which is where our tests run under
+/// `cross`. But is messes with our tests, because... they don't expect the
+/// allocator to fucking write to stderr. I mean, what the fuck? Who prints a
+/// warning message with absolutely no instruction for what to do with it or
+/// how to disable it. Absolutely fucking bonkers.
+fn strip_jemalloc_nonsense(data: &[u8]) -> Vec<u8> {
+ let lines = data
+ .lines_with_terminator()
+ .filter(|line| !line.starts_with_str("<jemalloc>:"));
+ bstr::concat(lines)
+}