Skip to content

build with binaryprovider #121

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

Merged
merged 1 commit into from
Jul 11, 2018
Merged

build with binaryprovider #121

merged 1 commit into from
Jul 11, 2018

Conversation

SimonDanisch
Copy link
Member

No description provided.

@SimonDanisch
Copy link
Member Author

Hm windows test failures are not present on master.. guess I build ImageMagick with less support for some operations.... Not really sure what's up with Linux! Seems to work locally and fails for the same tests as on windows...

@SimonDanisch
Copy link
Member Author

So seems like the problems lays with writing a png to a stream...
It fails when setting the format to "PNG" with an empty error string: https://github.com/JuliaIO/ImageMagick.jl/blob/master/src/libmagickwand.jl#L515.
When I put C_NULL as format, it actually gives the classic error: NoDecodeDelegateForThisImageFormat PNG @ error/constitute.c/ReadImage/504.
Is there any precedence for this behaviour?
I'm reading, that I need to compile ImageMagick with some delegates, but what I don't understand is, that tiff, jpg, png works just fine in the tests, it only doesn't work when writing to a stream.

@SimonDanisch
Copy link
Member Author

Ok, something is really weird with the tests :D They all pass, but actually trying to just save/load pngs and any other file doesn't work in isolation :D So I think the compile with delegate theory actually holds...

@SimonDanisch
Copy link
Member Author

pretty clear now:

 .\identify.exe -list format
---------------------------------------------------------------------------
      3FR  DNG       r--   Hasselblad CFV/H3D39II
      3G2  MPEG      r--   Media Container
      3GP  MPEG      r--   Media Container
        A* RAW       rw+   Raw alpha samples
      AAI* AAI       rw+   AAI Dune image
       AI  PDF       rw-   Adobe Illustrator CS2
      ART* ART       rw-   PFS: 1st Publisher Clip Art
      ARW  DNG       r--   Sony Alpha Raw Image Format
      AVI  MPEG      r--   Microsoft Audio/Visual Interleaved
      AVS* AVS       rw+   AVS X image
        B* RAW       rw+   Raw blue samples
      BGR* BGR       rw+   Raw blue, green, and red samples
     BGRA* BGR       rw+   Raw blue, green, red, and alpha samples
     BGRO* BGR       rw+   Raw blue, green, red, and opacity samples
      BMP* BMP       rw-   Microsoft Windows bitmap image
     BMP2* BMP       rw-   Microsoft Windows bitmap image (V2)
     BMP3* BMP       rw-   Microsoft Windows bitmap image (V3)
      BRF* BRAILLE   -w-   BRF ASCII Braille format
        C* RAW       rw+   Raw cyan samples
      CAL* CALS      r--   Continuous Acquisition and Life-cycle Support Type 1
           Specified in MIL-R-28002 and MIL-PRF-28002
     CALS* CALS      r--   Continuous Acquisition and Life-cycle Support Type 1
           Specified in MIL-R-28002 and MIL-PRF-28002
   CANVAS* XC        r--   Constant image uniform color
  CAPTION* CAPTION   r--   Caption
      CIN* CIN       rw-   Cineon Image File
      CIP* CIP       -w-   Cisco IP phone image format
     CLIP* CLIP      rw+   Image Clip Mask
CLIPBOARD* CLIPBOARD rw-   The system clipboard
     CMYK* CMYK      rw+   Raw cyan, magenta, yellow, and black samples
    CMYKA* CMYK      rw+   Raw cyan, magenta, yellow, black, and alpha samples
      CR2  DNG       r--   Canon Digital Camera Raw Image Format
      CRW  DNG       r--   Canon Digital Camera Raw Image Format
      CUR* ICON      rw-   Microsoft icon
      CUT* CUT       r--   DR Halo
     DATA* INLINE    rw+   Base64-encoded inline images
      DCM* DCM       r--   Digital Imaging and Communications in Medicine image
           DICOM is used by the medical community for images like X-rays.  The
           specification, "Digital Imaging and Communications in Medicine
           (DICOM)", is available at http://medical.nema.org/.  In particular,
           see part 5 which describes the image encoding (RLE, JPEG, JPEG-LS),
           and supplement 61 which adds JPEG-2000 encoding.
      DCR  DNG       r--   Kodak Digital Camera Raw Image File
      DCX* PCX       rw+   ZSoft IBM PC multi-page Paintbrush
      DDS* DDS       rw+   Microsoft DirectDraw Surface
    DFONT* TTF       ---   Multi-face font package
      DNG  DNG       r--   Digital Negative
      DPX* DPX       rw-   SMPTE 268M-2003 (DPX 2.0)
           Digital Moving Picture Exchange Bitmap, Version 2.0.
           See SMPTE 268M-2003 specification at http://www.smtpe.org

     DXT1* DDS       rw+   Microsoft DirectDraw Surface
     DXT5* DDS       rw+   Microsoft DirectDraw Surface
      EMF  EMF       r--   Windows Enhanced Meta File
     EPDF  PDF       rw-   Encapsulated Portable Document Format
      EPI  PS        rw-   Encapsulated PostScript Interchange format
      EPS  PS        rw-   Encapsulated PostScript
     EPS2  PS2       -w-   Level II Encapsulated PostScript
     EPS3  PS3       -w+   Level III Encapsulated PostScript
     EPSF  PS        rw-   Encapsulated PostScript
     EPSI  PS        rw-   Encapsulated PostScript Interchange format
      ERF  DNG       r--   Epson Raw Format
      FAX* FAX       rw+   Group 3 FAX
           FAX machines use non-square pixels which are 1.5 times wider than
           they are tall but computer displays use square pixels, therefore
           FAX images may appear to be narrow unless they are explicitly
           resized using a geometry of "150x100%".

     FILE* URL       r--   Uniform Resource Locator (file://)
     FITS* FITS      rw-   Flexible Image Transport System
  FRACTAL* PLASMA    r--   Plasma fractal image
      FTP* URL       ---   Uniform Resource Locator (ftp://)
      FTS* FITS      rw-   Flexible Image Transport System
        G* RAW       rw+   Raw green samples
       G3* FAX       rw-   Group 3 FAX
       G4* FAX       rw-   Group 4 FAX
      GIF* GIF       rw+   CompuServe graphics interchange format
    GIF87* GIF       rw-   CompuServe graphics interchange format (version 87a)
 GRADIENT* GRADIENT  r--   Gradual linear passing from one shade to another
     GRAY* GRAY      rw+   Raw gray samples
    GRAYA* GRAY      rw+   Raw gray and alpha samples
        H* MAGICK    -w-   Image expressed as a 'C/C++' char array
     HALD* HALD      r--   Identity Hald color lookup table image
      HDR* HDR       rw+   Radiance RGBE image format
HISTOGRAM* HISTOGRAM -w-   Histogram of the image
      HRZ* HRZ       rw-   Slow Scan TeleVision
      HTM* HTML      -w-   Hypertext Markup Language and a client-side image map
     HTML* HTML      -w-   Hypertext Markup Language and a client-side image map
     HTTP* URL       ---   Uniform Resource Locator (http://)
    HTTPS* URL       ---   Uniform Resource Locator (https://)
      ICB* TGA       rw-   Truevision Targa image
      ICO* ICON      rw+   Microsoft icon
     ICON* ICON      rw-   Microsoft icon
      IIQ  DNG       r--   Phase One Raw Image Format
     INFO  INFO      -w+   The image format and characteristics
   INLINE* INLINE    rw+   Base64-encoded inline images
      IPL* IPL       rw+   IPL Image Sequence
   ISOBRL* BRAILLE   -w-   ISO/TR 11548-1 format
  ISOBRL6* BRAILLE   -w-   ISO/TR 11548-1 format 6dot
      JNX* JNX       r--   Garmin tile format
     JSON  JSON      -w+   The image format and characteristics
        K* RAW       rw+   Raw black samples
      K25  DNG       r--   Kodak Digital Camera Raw Image Format
      KDC  DNG       r--   Kodak Digital Camera Raw Image Format
    LABEL* LABEL     r--   Image label
        M* RAW       rw+   Raw magenta samples
      M2V  MPEG      rw+   MPEG Video Stream
      M4V  MPEG      rw+   Raw MPEG-4 Video
      MAC* MAC       r--   MAC Paint
   MAGICK* MAGICK    rw-   Predefined Magick Image (LOGO, ROSE, etc.); output same as 'H'
      MAP* MAP       rw-   Colormap intensities and indices
     MASK* MASK      rw+   Image Clip Mask
      MAT  MAT       rw+   MATLAB level 5 image format
    MATTE* MATTE     -w+   MATTE format
      MEF  DNG       r--   Mamiya Raw Image File
     MIFF* MIFF      rw+   Magick Image File Format
      MKV  MPEG      rw+   Multimedia Container
     MONO* MONO      rw-   Raw bi-level bitmap
      MOV  MPEG      rw+   MPEG Video Stream
      MP4  MPEG      rw+   MPEG-4 Video Stream
      MPC* MPC       rw+   Magick Persistent Cache image format
     MPEG  MPEG      rw+   MPEG Video Stream
      MPG  MPEG      rw+   MPEG Video Stream
      MRW  DNG       r--   Sony (Minolta) Raw Image File
      MSL* MSL       ---   Magick Scripting Language
     MSVG  SVG       -w+   ImageMagick's own SVG internal renderer
      MTV* MTV       rw+   MTV Raytracing image format
      MVG* MVG       rw-   Magick Vector Graphics
      NEF  DNG       r--   Nikon Digital SLR Camera Raw Image File
      NRW  DNG       r--   Nikon Digital SLR Camera Raw Image File
     NULL* NULL      rw-   Constant image of uniform color
        O* RAW       rw+   Raw opacity samples
      ORF  DNG       r--   Olympus Digital Camera Raw Image File
      OTB* OTB       rw-   On-the-air bitmap
      OTF* TTF       ---   Open Type font
      PAL* UYVY      rw-   16bit/pixel interleaved YUV
     PALM* PALM      rw+   Palm pixmap
      PAM* PNM       rw+   Common 2-dimensional bitmap format
    PANGO* PANGO     ---   Pango Markup Language
  PATTERN* PATTERN   r--   Predefined pattern
      PBM* PNM       rw+   Portable bitmap format (black and white)
      PCD* PCD       rw-   Photo CD
     PCDS* PCD       rw-   Photo CD
      PCL  PCL       rw+   Printer Control Language
      PCT* PICT      rw-   Apple Macintosh QuickDraw/PICT
      PCX* PCX       rw-   ZSoft IBM PC Paintbrush
      PDB* PDB       rw+   Palm Database ImageViewer Format
      PDF  PDF       rw+   Portable Document Format
     PDFA  PDF       rw+   Portable Document Archive Format
      PEF  DNG       r--   Pentax Electronic File
      PES* PES       r--   Embrid Embroidery Format
      PFA* TTF       ---   Postscript Type 1 font (ASCII)
      PFB* TTF       ---   Postscript Type 1 font (binary)
      PFM* PFM       rw+   Portable float format
      PGM* PNM       rw+   Portable graymap format (gray scale)
      PGX* PGX       rw-   JPEG 2000 uncompressed format
    PICON* XPM       rw-   Personal Icon
     PICT* PICT      rw-   Apple Macintosh QuickDraw/PICT
      PIX* PIX       r--   Alias/Wavefront RLE image format
   PLASMA* PLASMA    r--   Plasma fractal image
      PNM* PNM       rw+   Portable anymap
      PPM* PNM       rw+   Portable pixmap format (color)
       PS  PS        rw+   PostScript
      PS2  PS2       -w+   Level II PostScript
      PS3  PS3       -w+   Level III PostScript
      PSB* PSD       rw+   Adobe Large Document Format
      PSD* PSD       rw+   Adobe Photoshop bitmap
      PWP* PWP       r--   Seattle Film Works
        R* RAW       rw+   Raw red samples
RADIAL-GRADIENT* GRADIENT  r--   Gradual radial passing from one shade to another
      RAF  DNG       r--   Fuji CCD-RAW Graphic File
      RAS* SUN       rw+   SUN Rasterfile
      RAW  DNG       r--   Raw
      RGB* RGB       rw+   Raw red, green, and blue samples
     RGBA* RGB       rw+   Raw red, green, blue, and alpha samples
     RGBO* RGB       rw+   Raw red, green, blue, and opacity samples
      RGF* RGF       rw-   LEGO Mindstorms EV3 Robot Graphic Format (black and white)
      RLA* RLA       r--   Alias/Wavefront image
      RLE* RLE       r--   Utah Run length encoded image
      RMF  DNG       r--   Raw Media Format
      RW2  DNG       r--   Panasonic Lumix Raw Image
      SCR* SCR       r--   ZX-Spectrum SCREEN$
SCREENSHOT* SCREENSHO r--   Screen shot
      SCT* SCT       r--   Scitex HandShake
      SFW* SFW       r--   Seattle Film Works
      SGI* SGI       rw+   Irix RGB image
    SHTML* HTML      -w-   Hypertext Markup Language and a client-side image map
      SIX* SIXEL     rw-   DEC SIXEL Graphics Format
    SIXEL* SIXEL     rw-   DEC SIXEL Graphics Format
SPARSE-COLOR* TXT       -w+   Sparse Color
      SR2  DNG       r--   Sony Raw Format 2
      SRF  DNG       r--   Sony Raw Format
  STEGANO* STEGANO   r--   Steganographic image
      SUN* SUN       rw+   SUN Rasterfile
      SVG  SVG       -w+   Scalable Vector Graphics
     SVGZ  SVG       -w+   Compressed Scalable Vector Graphics
     TEXT* TXT       rw+   Text
      TGA* TGA       rw-   Truevision Targa image
THUMBNAIL* THUMBNAIL -w+   EXIF Profile Thumbnail
     TILE* TILE      r--   Tile image with a texture
      TIM* TIM       r--   PSX TIM
      TTC* TTF       ---   TrueType font collection
      TTF* TTF       ---   TrueType font
      TXT* TXT       rw+   Text
     UBRL* BRAILLE   -w-   Unicode Text format
    UBRL6* BRAILLE   -w-   Unicode Text format 6dot
      UIL* UIL       -w-   X-Motif UIL table
     UYVY* UYVY      rw-   16bit/pixel interleaved YUV
      VDA* TGA       rw-   Truevision Targa image
    VICAR* VICAR     rw-   VICAR rasterfile format
      VID* VID       rw+   Visual Image Directory
     VIFF* VIFF      rw+   Khoros Visualization image
     VIPS* VIPS      rw+   VIPS image
      VST* TGA       rw-   Truevision Targa image
     WBMP* WBMP      rw-   Wireless Bitmap (level 0) image
      WMF  EMF       r--   Windows Meta File
      WMV  MPEG      rw+   Windows Media Video
      WPG* WPG       r--   Word Perfect Graphics
      X3F  DNG       r--   Sigma Camera RAW Picture File
      XBM* XBM       rw-   X Windows system bitmap (black and white)
       XC* XC        r--   Constant image uniform color
      XCF* XCF       r--   GIMP image
      XPM* XPM       rw-   X Windows system pixmap (color)
      XPS  XPS       r--   Microsoft XML Paper Specification
       XV* VIFF      rw+   Khoros Visualization image
        Y* RAW       rw+   Raw yellow samples
    YCbCr* YCbCr     rw+   Raw Y, Cb, and Cr samples
   YCbCrA* YCbCr     rw+   Raw Y, Cb, Cr, and alpha samples
      YUV* YUV       rw-   CCIR 601 4:1:1 or 4:2:2

I mean, that's kind of expected ;) We just seem to have written the tests in a way, that they still pass. Maybe related to the mimewriter changes in FileIO (since I definitely don't have another jpg loader library installed)!

@SimonDanisch
Copy link
Member Author

Aw, almost... I can't reproduce the failure on travis with my local linux machine. On all PCs I have available this new version passes all tests! If people can try this out on their machine and see if they can reproduce the failure, that'd help a lot :)

@SimonDanisch
Copy link
Member Author

Seems like /usr/lib/x86_64-linux-gnu/libgomp.so.1: version GOMP_4.0' not found is the problem

Copy link
Member

@timholy timholy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I hadn't even followed BinaryProvider/BinaryBuilder. Is there some discussion somewhere that summarizes the main advantages over BinDeps? (Does BinDeps need a deprecation message on its README?)

At any rate, thanks so much for tackling this!

REQUIRE Outdated
FileIO
@osx Homebrew
BinDeps
BinaryProvider
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the comment at the top of deps/build.jl this needs a minimum version number

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

deps/build.jl Outdated

is_windows() && pop!(BinDeps.defaults)
# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will all the dependencies as well as ImageMagick itself try to create the same deps.jl file? Is that bad?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering about this as well, but since it works and I'm not sure how to do it differently I was leaving it like that for now.. @staticfloat ?!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably you could have them each write their own foo_deps.jl file and then have one deps.jl that includes them all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's necessary, so I'd just follow @staticfloat recommendation, if he has any ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having multiple deps.jl files is only necessary if you want to manually dlopen() files from the other projects; right now you're only going to have access to variables that define the libwand variable; you won't get variables that point to the location of zlib, libpng, etc... I don't think you care about those, so this is fine, but this user experience is high on our list of things to improve. :)

MagickRelinquishMemory[] = loadsym(:MagickRelinquishMemory)
MagickQueryConfigureOptions[] = loadsym(:MagickQueryConfigureOptions)
MagickQueryConfigureOption[] = loadsym(:MagickQueryConfigureOption)
libversion() = v"6.9.10-4"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be provided by the builder script? Otherwise I worry we will forget to update it and it will get out-of-sync.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, there isn't any infrastructure in place in binaryprovider right now, so I figured that any hacky workaround I do would be as bad as this;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As further background, the call to get the version from ImageMagick directly segfaulted, which I was too tired to debug especially since all other calls worked :D So I just assumed it came naturally from the different build process ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we've seen that before and it seems to correlate with problematic initialization. Can you post what you tried somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigating it right now! Might have found a problematic flag in the configure ;) Seems like there is a flag to make ImageMagick find all configuration files itself instead of having them hardcoded at compile time.

@@ -25,117 +25,15 @@ else
error("ImageMagick not properly installed. Please run Pkg.build(\"ImageMagick\") then restart Julia.")
end

const libmagick = Ref{Ptr{Void}}()

const MagickWandGenesis = Ref{Ptr{Void}}()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In light of #93, I'd like it if @musm or @Allardvm would comment here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that we don't need those shenanigans anymore, now that the windows binaries are pretty much identical to the unix ones - instead of using this weird windows installer, that messes with the registry and loads everything dynamically from an xml file^^
And I've been mainly testing this on windows and appveyor passes, so this might just be the end to windows being crazy with ImageMagick :)

@SimonDanisch
Copy link
Member Author

Seems like /usr/lib/x86_64-linux-gnu/libgomp.so.1: version GOMP_4.0' not found is the problem

I'm testing to build the binaries with OpenMP disabled right now which might fix this issue :)

@timholy
Copy link
Member

timholy commented Jul 5, 2018

This passes tests for me.

@SimonDanisch
Copy link
Member Author

Yeah, it seems like most linux distributions have GOMP_4 installed... Might be coming with a modern version of gcc, or so ;) But seems like a real problem on old / clean distributions like travis, so I hope the new binaries I'm compiling right now will fix it!

deps/build.jl Outdated
# it's a bit faster to run the build in an anonymous module instead of
# starting a new julia process
m = Module(:__anon__)
eval(m, :(include($(joinpath(@__DIR__, elem)))))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Main.include to prevent an UndefVarError: include not defined on 0.7.
And Core.eval will avoid a warning.
Both work on 0.6.

@timholy
Copy link
Member

timholy commented Jul 9, 2018

Looking close now!

@SimonDanisch
Copy link
Member Author

Oh boi, tests are turning green :)
I'll add @visr recommendation and then let's see if we can merge this :) Maybe we should find some people on each platform for a quick test? Or we could still merge, but do those tests before actually tagging!

@SimonDanisch
Copy link
Member Author

Weird, wasn't coverage improving before?! In any case, I mostly deleted code, so I don't really see how this can be relevant to this PR

@SimonDanisch
Copy link
Member Author

Hm, still can't query the options. Also, it doesn't give me any debug output, even though I see some logging calls in the C code I'm hitting...

julia> ENV["MAGICK_DEBUG"] = "All"
"All"

julia> using ImageMagick

julia> option = "LIB_VERSION_NUMBER"
"LIB_VERSION_NUMBER"

julia> p = ccall((:MagickQueryConfigureOption, ImageMagick.libwand), Ptr{UInt8}, (Ptr{UInt8},), option)

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x11310e64 -- MagickQueryConfigureOption at /workspace/srcdir/ImageMagick6\wand\magick-wand.c:424
while loading no file, in expression starting on line 0
MagickQueryConfigureOption at /workspace/srcdir/ImageMagick6\wand\magick-wand.c:424
anonymous at .\<missing> (unknown line)
jl_call_fptr_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:358 [inlined]
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:589
jl_toplevel_eval_in at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\builtins.c:496
eval at .\boot.jl:235
unknown function (ip: 0000000004B5E3A5)
jl_call_fptr_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1926
eval_user_input at .\REPL.jl:66
unknown function (ip: 0000000004BF4EC5)
jl_call_fptr_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1926
macro expansion at .\REPL.jl:97 [inlined]
#1 at .\event.jl:73
unknown function (ip: 00000000105527E3)
jl_call_fptr_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:339 [inlined]
jl_call_method_internal at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia_internal.h:358 [inlined]
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1926
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1424 [inlined]
start_task at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\task.c:267
Allocations: 4461360 (Pool: 4459572; Big: 1788); GC: 7

@timholy
Copy link
Member

timholy commented Jul 9, 2018

It is sometimes a little strange. For example, the __init__ function calls magickgenesis but that function (which is a simple ccall) isn't credited. (But of course ccall is a bit special, so perhaps that's unsurprising.) https://codecov.io/gh/JuliaIO/ImageMagick.jl/compare/cb7c2d4569a1fb681de842e1df961b1c0525fc31...f644e905dc27dedc908dbb31e97fddd506e9b9f3/src/src/libmagickwand.jl?before=src/libmagickwand.jl

I do note that queryoption is now untested. The good news it's not totally borked:

julia> ImageMagick.queryoptions("*")
3-element Array{String,1}:
 "FEATURES"    
 "NAME"        
 "QuantumDepth"

julia> ImageMagick.queryoption("FEATURES")
"OpenMP "

julia> ImageMagick.queryoption("NAME")
"ImageMagick"

julia> ImageMagick.queryoption("QuantumDepth")
"16"

So it's really just that LIB_VERSION_NUMBER isn't compiled in. The segfault seems like it should be due to the fact that we don't check the pointer for a null (my fault 😢, see JuliaImages/Images.jl@89c29cf). But in fact even if I add

diff --git a/src/libmagickwand.jl b/src/libmagickwand.jl
index 6b3c982..61b871d 100644
--- a/src/libmagickwand.jl
+++ b/src/libmagickwand.jl
@@ -543,5 +543,6 @@ end
 # queries the value of a particular option
 function queryoption(option::AbstractString)
     p = ccall(MagickQueryConfigureOption[], Ptr{UInt8}, (Ptr{UInt8},), option)
+    p == C_NULL && error("option $option not found")
     unsafe_string(p)
 end

to the current master branch then it still crashes if you ask for any invalid option. This suggests some kind of bug in ImageMagick itself.

I guess if everyone is using the same binaries then it isn't too much of a concern. But I worry that once https://github.com/JuliaIO/ImageMagickBuilder/releases has multiple versions available, this is going to cause problems---we'll ask people to tell us what version they are running and the answer will be unreliable in terms of its usefulness. If nothing else, can you make sure the build.jl script and the call to libversion() in src/libmagickwand.jl can't possibly disagree with one another?

@SimonDanisch
Copy link
Member Author

Hm, I'm surprised that this is working:

julia> run(`convert.exe -version`)
Version: ImageMagick 6.9.10-4 Q16 x86_64 2018-07-09 https://www.imagemagick.org
Copyright: ┬® 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): gslib jng jpeg png ps tiff zlib

@timholy
Copy link
Member

timholy commented Jul 9, 2018

This looks great, thanks! I just tested it locally and it works flawlessly. Can folks on other platforms give this a whirl?

Pkg.checkout("ImageMagick")   # hopefully this will fetch the updated list of available branches
Pkg.checkout("ImageMagick", "sd/binaryprovider")  # this is the branch you actually want
Pkg.build("ImageMagick")
Pkg.test("ImageMagick")

@visr
Copy link

visr commented Jul 9, 2018

Can folks on other platforms give this a whirl?

Flawless here as well :)

Julia Version 0.6.3
Commit d55cadc350* (2018-05-28 20:20 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4710MQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

@nico202
Copy link

nico202 commented Jul 9, 2018

Pkg.test("ImageMagick"); using ImageMagick working on NixOS!

Julia Version 0.6.2                                                                                                                                                                              
Commit d386e40 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-unknown-linux-gnu)                                                                                                                                                           
  CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz                                                                                                                                                  
  WORD_SIZE: 64                                                                                                                                                                                  
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY USE_OPENMP Haswell MAX_THREADS=64)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake-avx512)

@SimonDanisch
Copy link
Member Author

Anything we still want to address before merging?

@timholy
Copy link
Member

timholy commented Jul 10, 2018

I'm good with it. But are there any OSX testers out there?

@bjarthur
Copy link
Member

works for me on OS X

@timholy
Copy link
Member

timholy commented Jul 10, 2018

Thanks to all testers. I'm personally satisfied if you are, merge at will @SimonDanisch (probably with a squash, or manually separate commits into logical chunks).

@SimonDanisch
Copy link
Member Author

removed the Images -> ImageCore commit and squashed the rest into one commit!

@timholy timholy merged commit 92ed10d into master Jul 11, 2018
@timholy
Copy link
Member

timholy commented Jul 11, 2018

Thanks a ton for doing this! Let's hope it ends the flakiness.

@timholy
Copy link
Member

timholy commented Jul 11, 2018

That was a lot of closed issues, @SimonDanisch 🎆

@SimonDanisch
Copy link
Member Author

Yeah, that was satisfying! :) Was quite a bit of work, but actually still much less work than I invested into trying to make BinDeps + that flaky windows installer work ;)
Let's keep our fingers crossed that this is finally a stable solution!

Btw, a lot of thanks to @staticfloat & @RalphAS to fix windows + osx issues!

@RalphAS RalphAS mentioned this pull request Jul 13, 2018
@SimonDanisch
Copy link
Member Author

Cool, seems like the configuration issue got fixed:
ImageMagick/ImageMagick6#13 (comment)
I'll try to rebuild the binaries with the fix later this week!

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

Successfully merging this pull request may close these issues.

6 participants