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

bin2coff exists with code 1, executed with invalid path #72

Open
swip3798 opened this issue Jul 17, 2023 · 4 comments
Open

bin2coff exists with code 1, executed with invalid path #72

swip3798 opened this issue Jul 17, 2023 · 4 comments

Comments

@swip3798
Copy link

When trying to add the mupdf crate to an empty project and building it on windows, I get the following error:

C:\dev\Rust\mupdf-test\target\debug\build\mupdf-sys-61a5ef3cbd8e3793\out\build\platform\win32\bin2coff.targets(76,5): error MSB3721: The command "Release\bin2coff.exe "C:\dev\Rust\mupdf-test\target\debug\build\mupdf-sys-61a5ef3cbd8e3793\out\build\resources\fonts\droid\DroidSansFallback.ttf" "x64\Release\libresources\DroidSansFallback_ttf.obj" _binary_DroidSansFallback_ttf x64" exited with code 1. [C:\dev\Rust\mupdf-test\target\debug\build\mupdf-sys-61a5ef3cbd8e3793\out\build\platform\win32\libresources.vcxproj]

The mentioned directory for the font "C:\dev\Rust\mupdf-test\target\debug\build\mupdf-sys-61a5ef3cbd8e3793\out\build\resources\fonts\droid\DroidSansFallback.ttf" doesn't exists in the build directory.

I couldn't find something similar online, so I thought I might ask here.

@kusaanko
Copy link

kusaanko commented Aug 7, 2023

I have same problem. When I put resouces/fonts on https://github.com/ArtifexSoftware/mupdf in mupdf-rs-sys-0.4.2/src, I can compile mupdf-rs.

I found these fonts files are excluded in Cargo.toml of mupdf-rs.

[package]
edition = "2018"
name = "mupdf-sys"
version = "0.4.2"
authors = ["messense <messense@icloud.com>"]
links = "mupdf-wrapper"
exclude = [
    "mupdf/resources/cmaps/*",
    "mupdf/resources/icc/*",
    "mupdf/resources/fonts/droid/*",
    "mupdf/resources/fonts/han/*",
    "mupdf/resources/fonts/noto/*",
    "mupdf/resources/fonts/sil/*",
    "mupdf/resources/fonts/urw/input/*",

@messense
Copy link
Owner

Unfortunately crates.io has a size limit, so we can't include all of the fonts.

For now, you can try to use git dependency instead.

@meanjellybean1
Copy link

Hey i have the same issues with the driod sans fallback.ttf - what was the work around in this case??

@namespaceYcZ
Copy link

Those experiencing similar issue on Windows machines can try the following suggestion:
(Thanks to kusaanko for this solution, I just fixed the directory name and repository name)

  1. execute
git clone https://github.com/ArtifexSoftware/mupdf.git
cd mupdf
git checkout {hash}
cd resources/fonts

where {hash} is the hash of the c mupdf repository commit used in the mupdf-sys repository, e.g. the current mupdf-sys repository uses commit 31b25c5 from the c mupdf repository.

Image

  1. find the location of the mupdf-sys library codes downloaded by cargo on your machine, for me the location is D:\UserApps\rust\\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\mupdf -sys-0.4.4. The directory may looks much different for people who have not changed the registry settings like I did.
  2. Copy all directories under resources/fonts in the c mupdf repository you downloaded in step 1 into the mupdf\resources\fonts directory of the mupdf-sys library codebase you found in step 2.
  3. Go back to your own project and run cargo build to check whether the problem is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants