From 073ab97ad700874c4fbd21c72663265a73355c07 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 12:56:52 -0400 Subject: [PATCH 1/9] ci: Run MinGW CI --- .github/workflows/rust.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e886852..9f4ee95 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -34,3 +34,16 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --verbose + build-mingw: + runs-on: windows-2025 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + with: + submodules: 'true' + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From ad39e17c4e4c574e8ed97ae651949d64b63b9ae6 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:03:54 -0400 Subject: [PATCH 2/9] add build.rs changes --- build.rs | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/build.rs b/build.rs index c604969..cf41d98 100644 --- a/build.rs +++ b/build.rs @@ -45,7 +45,22 @@ fn main() { sixel_prefix("build") } else { sixel_build_dir.clone().into_os_string().into_string().expect("Could not convert OS path to utf8") }; - { + if cfg!(windows) { + // https://github.com/AdnoC/sixel-sys/issues/1#issuecomment-3124493822 + + // Path to your Cygwin installation + let cygwin_prefix = Path::new("C:/msys64/mingw64/"); + + // Link to the prebuilt libsixel + println!("cargo:rustc-link-search=native={}/lib", cygwin_prefix.display()); + println!("cargo:rustc-link-lib=sixel"); // or "sixel-static" if you have a static lib + + // Optionally, tell bindgen where to find headers + println!("cargo:include={}/include", cygwin_prefix.display()); + + // Only rerun build.rs if the library changes + println!("cargo:rerun-if-changed={}/lib/libsixel.a", cygwin_prefix.display()); + } else { let mut bld = Config::new("libsixel"); if curl { bld.with("libcurl", None); @@ -83,7 +98,6 @@ fn main() { let dst = bld .reconf("-ivf") .build(); -println!("cargo::warning={}", dst.display()); println!("cargo:rustc-link-search=native={}", dst.join("lib").display()); println!("cargo:rustc-link-lib=static=sixel"); } @@ -162,11 +176,7 @@ fn has_feature(feature: &'static str) -> bool { } fn sixel_prefix(directory: &str) -> String { - let cmd = Command::new("pwd").output().expect("Could not run `pwd`"); - let base_path = std::str::from_utf8(&cmd.stdout) - .expect("Could not turn libsixel path into utf8") - .trim() - .to_string(); - let path = base_path + "/" + LIBSIXEL_DIR + "/" + "build"; - path + let cwd = env::current_dir().unwrap(); + let path = cwd.join(LIBSIXEL_DIR).join("build"); + path.display().to_string() } From 5b3afcc3ae5523f06202baecdb2398d06807bfb3 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:10:19 -0400 Subject: [PATCH 3/9] pacman autoreconf --- .github/workflows/rust.yml | 2 ++ build.rs | 17 +---------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9f4ee95..380b3e4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,6 +43,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' + - name: Install autotools + run: pacman -S base-devel - name: Build run: cargo build --verbose - name: Run tests diff --git a/build.rs b/build.rs index cf41d98..88cd6e1 100644 --- a/build.rs +++ b/build.rs @@ -45,22 +45,7 @@ fn main() { sixel_prefix("build") } else { sixel_build_dir.clone().into_os_string().into_string().expect("Could not convert OS path to utf8") }; - if cfg!(windows) { - // https://github.com/AdnoC/sixel-sys/issues/1#issuecomment-3124493822 - - // Path to your Cygwin installation - let cygwin_prefix = Path::new("C:/msys64/mingw64/"); - - // Link to the prebuilt libsixel - println!("cargo:rustc-link-search=native={}/lib", cygwin_prefix.display()); - println!("cargo:rustc-link-lib=sixel"); // or "sixel-static" if you have a static lib - - // Optionally, tell bindgen where to find headers - println!("cargo:include={}/include", cygwin_prefix.display()); - - // Only rerun build.rs if the library changes - println!("cargo:rerun-if-changed={}/lib/libsixel.a", cygwin_prefix.display()); - } else { + { let mut bld = Config::new("libsixel"); if curl { bld.with("libcurl", None); From 7c510959db75011221568de39adfab3e68185e82 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:12:14 -0400 Subject: [PATCH 4/9] choco make --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 380b3e4..1eb2868 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -44,7 +44,7 @@ jobs: with: submodules: 'true' - name: Install autotools - run: pacman -S base-devel + run: choco install make - name: Build run: cargo build --verbose - name: Run tests From 405be8bc4730025f1f8d581850a63bf9a57c63b2 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:19:55 -0400 Subject: [PATCH 5/9] setup-msys2 --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1eb2868..2b619f0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,6 +43,10 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' + - uses: mysy2/setup-msys2@v2 + - shell: msys2 {0} + run: | + pacman -S base-devel - name: Install autotools run: choco install make - name: Build From 9ba75555d388a1c07745d3ed4d61cca91672ae60 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:20:40 -0400 Subject: [PATCH 6/9] typo --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2b619f0..ea49270 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,7 +43,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: 'true' - - uses: mysy2/setup-msys2@v2 + - uses: msys2/setup-msys2@v2 - shell: msys2 {0} run: | pacman -S base-devel From c3e62c1989602ca221f432ef420ce74cb7e54e39 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:22:30 -0400 Subject: [PATCH 7/9] noconfirm --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ea49270..0b41f1f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -46,7 +46,7 @@ jobs: - uses: msys2/setup-msys2@v2 - shell: msys2 {0} run: | - pacman -S base-devel + pacman -S --noconfirm base-devel - name: Install autotools run: choco install make - name: Build From cf97fcf791aafc7e33dd0818f34dbc85fe80434b Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:25:39 -0400 Subject: [PATCH 8/9] test --- .github/workflows/rust.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0b41f1f..eb5818e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,11 +45,9 @@ jobs: submodules: 'true' - uses: msys2/setup-msys2@v2 - shell: msys2 {0} - run: | - pacman -S --noconfirm base-devel - - name: Install autotools - run: choco install make - - name: Build + run: pacman -S --noconfirm base-devel + - shell: msys2 {0} + name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose From 24b60b5c8c6fc14224caff3d8f85718229c0cfe1 Mon Sep 17 00:00:00 2001 From: AdnoC Date: Tue, 21 Oct 2025 13:27:38 -0400 Subject: [PATCH 9/9] test2 --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index eb5818e..cf39b05 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,7 +45,7 @@ jobs: submodules: 'true' - uses: msys2/setup-msys2@v2 - shell: msys2 {0} - run: pacman -S --noconfirm base-devel + run: pacman -S --noconfirm base-devel rust - shell: msys2 {0} name: Build run: cargo build --verbose