# Cairo build fails on 0.6.0 (Windows)

**URL:** <https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440>\
**Category:** General Usage\
**Tags:** gadfly, build\
**Created:** [August 18, 2017, 1:45am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440 "2017-08-18T01:45:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arrigo\_Benedetti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arrigo_benedetti/32/25545_2.png) [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Post date:** [August 18, 2017, 1:45am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/1 "2017-08-18T01:45:20Z")

</div>

I am running Julia 0.6.0 under Windows 10. After Pkg.update() I am getting an error when I try to use Gadfly. I traced the problem to Cairo:

```julia

julia> Pkg.build("Cairo")
INFO: Building WinRPM
WARNING: Compat.KERNEL is deprecated.
  likely near C:\Users\me\.julia\v0.6\WinRPM\src\WinRPM.jl:4
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
INFO: Building Cairo
WARNING: Compat.KERNEL is deprecated.
  likely near C:\Users\me\.julia\v0.6\WinRPM\src\WinRPM.jl:4
INFO: Updating WinRPM package list
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml
INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml
INFO: Packages to update: zlib1
INFO: Packages to install: libxml2-2, libpng16-16, fontconfig, libpixman-1-0, libfreetype6, libharfbuzz0, libcairo2
INFO: Downloading: zlib1
INFO: Extracting: zlib1
====================================================[ERROR: Cairo]====================================================

LoadError: failed process: Process(`'C:\Users\me\AppData\Local\Julia-0.6.0\bin\7z.exe' x -y 'C:\Users\me\.julia\v0.6\WinRPM\cache\2\noarch%2Fmingw64-zlib1-1.2.8-8.11.noarch.cpio' '-oC:\Users\me\.julia\v0.6\WinRPM\deps'`, ProcessExited(2)) [2]
while loading C:\Users\me\.julia\v0.6\Cairo\deps\build.jl, in expression starting on line 162

```

Any ideas?

Thanks!

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [August 18, 2017, 5:55am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/2 "2017-08-18T05:55:38Z")

</div>

The LoadError seems to be a problem unpacking the downloaded zlib. You could try to remove the

C:\Users\me.julia\v0.6\WinRPM\cache\2\noarch%2Fmingw64-zlib1-1.2.8-8.11.noarch.cpio

and Pkg.build again for a new download.  
There’s also a small propability that this [https://github.com/JuliaGraphics/Cairo.jl/pull/196#issuecomment-320920826](https://github.com/JuliaGraphics/Cairo.jl/pull/196#issuecomment-320920826) shows up here.

---

<div class="post-metadata">

**Author:** ![Arrigo\_Benedetti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arrigo_benedetti/32/25545_2.png) [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Post date:** [August 19, 2017, 1:32am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/3 "2017-08-19T01:32:37Z")

</div>

The build folder does not contain a file with name “noarch%2Fmingw64-zlib1-1.2.8-8.11.noarch.cpio” but only a file with .rpm extension (“noarch%2Fmingw64-zlib1-1.2.8-8.11.noarch.rpm”). Maybe this is a clue to the problem? I am not familiar with the package build process…

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [August 19, 2017, 6:14am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/4 "2017-08-19T06:14:13Z")

</div>

I’m somehow familiar with the package build process and this is surely an indication that WinRPM got something wrong. I’ll try to reproduce this on some remote computer (i don’t have win10 available) and file an issue to WinRPM.

---

<div class="post-metadata">

**Author:** ![lobingera](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lobingera/32/211_2.png) [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Post date:** [August 19, 2017, 7:11am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/5 "2017-08-19T07:11:57Z")

</div>

i cannot reproduce. Please open an issue on Cairo, please post there:  
Pkg,status  
versioninfo

and please try to rebuild WinRPM

---

<div class="post-metadata">

**Author:** ![Arrigo\_Benedetti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arrigo_benedetti/32/25545_2.png) [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Post date:** [August 21, 2017, 6:32pm UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/6 "2017-08-21T18:32:14Z")

</div>

I tried to rebuild WinRPM and got no errors, but building Cairo gives the same error:

> julia\> Pkg.build(“Cairo”)  
> INFO: Building WinRPM  
> WARNING: Compat.KERNEL is deprecated.  
> likely near C:\Users\me.julia\v0.6\WinRPM\src\WinRPM.jl:4  
> INFO: Downloading [https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE\_Leap\_42.2/repodata/repomd.xml](https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml)  
> INFO: Downloading [https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE\_Leap\_42.2/repodata/repomd.xml](https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml)  
> INFO: Building Cairo  
> WARNING: Compat.KERNEL is deprecated.  
> likely near C:\Users\me.julia\v0.6\WinRPM\src\WinRPM.jl:4  
> INFO: Updating WinRPM package list  
> INFO: Downloading [https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE\_Leap\_42.2/repodata/repomd.xml](https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml)  
> INFO: Downloading [https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE\_Leap\_42.2/repodata/repomd.xml](https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2/repodata/repomd.xml)  
> INFO: Packages to update: zlib1  
> INFO: Packages to install: libxml2-2, libfreetype6, libpng16-16, libpixman-1-0, fontconfig, libharfbuzz0, libcairo2  
> INFO: Downloading: zlib1  
> INFO: Extracting: zlib1  
> ====================================================[ERROR: Cairo]====================================================
> 
> LoadError: failed process: Process(`'C:\Users\me\AppData\Local\Julia-0.6.0\bin\7z.exe' x -y 'C:\Users\me\.julia\v0.6\WinRPM\cache\2\noarch%2Fmingw64-zlib1-1.2.8-8.11.noarch.cpio' '-oC:\Users\me\.julia\v0.6\WinRPM\deps'`, ProcessExited(2)) [2]  
> while loading C:\Users\me.julia\v0.6\Cairo\deps\build.jl, in expression starting on line 162
> 
> ========================================================================================================================
> 
> ====================================================[BUILD ERRORS]====================================================
> 
> WARNING: Cairo had build errors.
> 
> - packages with build errors remain installed in C:\Users\me.julia\v0.6
> - build the package(s) and all dependencies with `Pkg.build("Cairo")`
> - build a single package by running its `deps/build.jl` script
> 
> ========================================================================================================================

Here is the Pkg status and versioninfo output:

> julia\> Pkg.status(“Cairo”)
> 
> - Cairo 0.3.1
> 
> julia\> Pkg.status(“Gadfly”)
> 
> - Gadfly 0.6.3
> 
> julia\> versioninfo  
> versioninfo (generic function with 4 methods)
> 
> julia\> versioninfo()  
> Julia Version 0.6.0  
> Commit 903644385b\* (2017-06-19 13:05 UTC)  
> Platform Info:  
> OS: Windows (x86\_64-w64-mingw32)  
> CPU: Intel(R) Core™ i7-6600U CPU @ 2.60GHz  
> WORD\_SIZE: 64  
> BLAS: libopenblas (USE64BITINT DYNAMIC\_ARCH NO\_AFFINITY Haswell)  
> LAPACK: libopenblas64\_  
> LIBM: libopenlibm  
> LLVM: libLLVM-3.9.1 (ORCJIT, skylake)

By the way, just to make sure this is clear: initially I was able to run Gadfly with Cairo with no errors. I think that this bug was triggered by a Pkg.update() although I can’t say that for sure. For now I switched to Julia Pro on the same machine and I don’t have any problems (not tried Pkg.update() yet !)

Thanks,

-Arrigo

---

<div class="post-metadata">

**Author:** ![PeterJacko](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@PeterJacko](https://discourse.julialang.org/u/PeterJacko)\
**Post date:** [September 20, 2017, 5:19pm UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/7 "2017-09-20T17:19:24Z")

</div>

I have exactly the same problem. I have just installed JuliaPro 0.6.0.1 on Win10, and when trying to use Gadfly, it gives me an error with Cairo. When building Cairo with Pkg.build(“Cairo”), I get a build error (as above). Obviously the problem is with extracting the zlib1 package. It tries to extract a file with extension “cpio”, but the file in the folder has extension “rpm” (as many other files there). I managed to extract it using PowerShell, running

C:\JuliaPro-0.6.0.1\Julia-0.6.0\bin\7z.exe x -y C:\JuliaPro-0.6.0.1\pkgs-0.6.0.1\v0.6\WinRPM\cache\2\noarch%2Fmingw64-zlib1-1.2.8-8.12.noarch.rpm -oC:\JuliaPro-0.6.0.1\pkgs-0.6.0.1\v0.6\WinRPM\deps

which gave me an OK. This has created a file with extension “cpio” in folder WinRPM/deps . However, when I build Cairo again, I get the same error (even if I copy this “cpio” file to the “cache/2” folder - from where it is deleted during the build).

Can anybody help to solve this?

---

<div class="post-metadata">

**Author:** ![PeterJacko](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@PeterJacko](https://discourse.julialang.org/u/PeterJacko)\
**Post date:** [September 22, 2017, 9:26am UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/8 "2017-09-22T09:26:18Z")

</div>

MY SOLUTION:

After a lot of trial and error I managed to solve the problem. I believe that this is what needs to be done:

1. Instead of running Pkg.build(“Cairo”), I opened Cairo\deps\build.jl, which gave me a more detailed ERROR: Can not delete output file C:\JuliaPro-0.6.0.1\pkgs-0.6.0.1\v0.6\WinRPM\deps\usr\x86\_64-w64-mingw32\sys-root\mingw\bin\zlib1.dll (so the problem was not in extracting itself)
2. after deleting it manually and re-running Cairo\deps\build.jl , it completes OK
3. then I run my script requiring Gadfly, I get another ERROR: Fontconfig.jl not properly installed. Please run `Pkg.build("Fontconfig")` and restart Julia.
4. running Pkg.build(“Fontconfig”) - OK
5. restarting Julia
6. running my script requiring Gadfly - OK

---

<div class="post-metadata">

**Author:** ![evanfields](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evanfields/32/1744_2.png) [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Post date:** [September 22, 2017, 6:23pm UTC](https://discourse.julialang.org/t/cairo-build-fails-on-0-6-0-windows/5440/9 "2017-09-22T18:23:26Z")

</div>

FWIW, I had a similar (maybe identical? didn’t save the log) error which was fixed by simpling restarting the computer. Sorry I can’t be of more help.
