From 0b174a7e8aa219f9ce026cc29de241e21c7c2a01 Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Wed, 18 Sep 2024 11:16:29 +0800 Subject: [PATCH 1/2] Remove Windows-specific invocation of MagickCore-config --- build.rs | 27 ++++++++------------------- src/wand/pixel.rs | 2 +- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/build.rs b/build.rs index eb0f632..d642656 100644 --- a/build.rs +++ b/build.rs @@ -113,25 +113,14 @@ impl bindgen::callbacks::ParseCallbacks for RemoveEnumVariantSuffixes { } fn main() { - let check_cppflags = if cfg!(all(target_os = "windows", not(target_env = "msvc"))) { - // Resolve bash from directories listed in the PATH environment variable in the - // order they appear. - Command::new("cmd") - .arg("/C") - .arg("bash") - .arg("MagickCore-config") - .arg("--cppflags") - .output() - } else { - Command::new("MagickCore-config") - .arg("--cppflags") - .output() - .or_else(|_| { - Command::new("pkg-config") - .args(["--cflags", "MagickCore"]) - .output() - }) - }; + let check_cppflags = Command::new("MagickCore-config") + .arg("--cppflags") + .output() + .or_else(|_| { + Command::new("pkg-config") + .args(["--cflags", "MagickCore"]) + .output() + }); if let Ok(ok_cppflags) = check_cppflags { let cppflags = ok_cppflags.stdout; let cppflags = String::from_utf8(cppflags).unwrap(); diff --git a/src/wand/pixel.rs b/src/wand/pixel.rs index d7af6dc..044a8b9 100644 --- a/src/wand/pixel.rs +++ b/src/wand/pixel.rs @@ -93,7 +93,7 @@ impl PixelWand { set_get_unchecked!( get_color_count, set_color_count, PixelGetColorCount, PixelSetColorCount, usize - get_index, set_index, PixelGetIndex, PixelSetIndex, f32 + get_index, set_index, PixelGetIndex, PixelSetIndex, bindings::Quantum get_fuzz, set_fuzz, PixelGetFuzz, PixelSetFuzz, f64 ); From eaf8c333e0dcd146e56baeed1ec3e1d0d73eff47 Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Wed, 18 Sep 2024 15:28:00 +0800 Subject: [PATCH 2/2] Switch from mingw64 to ucrt64 --- .github/workflows/test-msys2.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-msys2.yaml b/.github/workflows/test-msys2.yaml index bb3e8f2..7425953 100644 --- a/.github/workflows/test-msys2.yaml +++ b/.github/workflows/test-msys2.yaml @@ -1,4 +1,4 @@ -name: Run tests on Windows +name: Run tests on Windows (MSYS2) on: workflow_dispatch: @@ -14,12 +14,12 @@ jobs: - name: Install dependencies shell: C:\msys64\usr\bin\bash.exe --login '{0}' run: | - export PATH="/mingw64/bin:$PATH" - pacman --noconfirm -S mingw-w64-x86_64-imagemagick mingw-w64-x86_64-pkg-config + export PATH="/ucrt64/bin:$PATH" + pacman --noconfirm -S mingw-w64-ucrt-x86_64-imagemagick mingw-w64-ucrt-x86_64-pkg-config - uses: Swatinem/rust-cache@v2 with: cache-on-failure: true - name: Test run: | - $env:PATH = "C:\msys64\usr\bin;C:\msys64\mingw64\bin;$env:PATH" - cargo test -- --skip background --skip negate_image + $env:PATH = "C:\msys64\usr\bin;C:\msys64\ucrt64\bin;$env:PATH" + cargo test -- --skip test_set_background_color