Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build script on gnu environment #96

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:

Expand All @@ -18,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- run: cargo check
Expand All @@ -33,7 +34,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- name: Install LLVM
Expand All @@ -52,36 +53,41 @@ jobs:
- name: Test package mupdf-sys
if: matrix.os == 'ubuntu-latest'
run: cargo package --manifest-path mupdf-sys/Cargo.toml

test-msys:
name: Test Suite (MSYS2)
runs-on: windows-2019
defaults:
run:
shell: msys2 {0}
strategy:
matrix:
include:
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: ucrt64, env: ucrt-x86_64 }
- { sys: mingw64, env: x86_64 }
# - { sys: mingw32, env: i686 }
- { sys: mingw32, env: i686 }
- { sys: clang64, env: clang-x86_64 }
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
install: mingw-w64-${{matrix.env}}-rust base base-devel unzip git
install: mingw-w64-${{matrix.env}}-rust mingw-w64-${{matrix.env}}-clang base base-devel unzip git

- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- run: cargo test

- run: |
rustc --version --verbose
cargo test

asan:
name: Address Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@nightly
with:
Expand All @@ -98,7 +104,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
fetch-depth: 500
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@valgrind
Expand Down
6 changes: 3 additions & 3 deletions mupdf-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn build_libmupdf() {
let mut make_flags = vec![
"libs".to_owned(),
format!("build={}", profile),
format!("OUT={}", build_dir.display()),
format!("OUT={}", &build_dir_str),
#[cfg(feature = "sys-lib-freetype")]
"USE_SYSTEM_FREETYPE=yes".to_owned(),
#[cfg(feature = "sys-lib-gumbo")]
Expand Down Expand Up @@ -253,15 +253,15 @@ fn build_libmupdf() {
};
let output = Command::new(make)
.args(&make_flags)
.current_dir(&build_dir)
.current_dir(&build_dir_str)
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.output()
.expect("make failed");
if !output.status.success() {
panic!("Build error, exit code {}", output.status.code().unwrap());
}
println!("cargo:rustc-link-search=native={}", build_dir.display());
println!("cargo:rustc-link-search=native={}", &build_dir_str);
println!("cargo:rustc-link-lib=static=mupdf");
// println!("cargo:rustc-link-lib=static=mupdf-pkcs7");
println!("cargo:rustc-link-lib=static=mupdf-third");
Expand Down