diff --git a/Manifest.toml b/Manifest.toml new file mode 100644 index 0000000..ec5d837 --- /dev/null +++ b/Manifest.toml @@ -0,0 +1,74 @@ +# This file is machine-generated - editing it directly is not advised + +[[Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[LibGit2]] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[Pkg]] +deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" + +[[Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[Random]] +deps = ["Serialization"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" + +[[Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[Test]] +deps = ["Distributed", "InteractiveUtils", "Logging", "Random"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[ZeroMQ_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "a22171d073707dbcc99a1dfefc2c6e823beb9664" +uuid = "8f1865be-045e-5c20-9c9f-bfbfb0764568" +version = "4.3.1+0" diff --git a/Project.toml b/Project.toml index fe30df0..763104e 100644 --- a/Project.toml +++ b/Project.toml @@ -3,14 +3,12 @@ uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1" version = "1.1.0" [deps] -BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232" FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" -Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" +ZeroMQ_jll = "8f1865be-045e-5c20-9c9f-bfbfb0764568" [compat] -BinaryProvider = "≥ 0.3.0" -julia = "1" +julia = "1.3" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index 769c6ce..0000000 --- a/deps/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -builds/ -downloads/ -src/ -usr/ -deps.jl -build.log diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index a31b5cb..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,64 +0,0 @@ -using BinaryProvider # requires BinaryProvider 0.3.0 or later -include("compile.jl") - -# env var to force compilation from source, for testing purposes -const forcecompile = get(ENV, "FORCE_COMPILE_ZMQ", "no") == "yes" - -# Parse some basic command-line arguments -const verbose = "--verbose" in ARGS || forcecompile -const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) -products = [ - LibraryProduct(prefix, String["libzmq"], :libzmq), -] - -# Download binaries from hosted location -bin_prefix = "https://github.com/JuliaInterop/ZMQBuilder/releases/download/v4.2.5+6" - -# Listing of files generated by BinaryBuilder: -download_info = Dict( - Linux(:aarch64, :glibc) => ("$bin_prefix/ZMQ.aarch64-linux-gnu.tar.gz", "ce637adc7f8bbd0a628d1d468e790236b64dc0f41e4c3ead991842a564b413b9"), - Linux(:aarch64, :musl) => ("$bin_prefix/ZMQ.aarch64-linux-musl.tar.gz", "13a1695fa47fb4d7ffdad55dfcd0fa4a66aad16235331aa7af4995be83f4e556"), - Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/ZMQ.arm-linux-gnueabihf.tar.gz", "c7050cc3eb8e1ad81b9eedbb41a4b2a89383d698dd4931cc1b90239c3640ffe5"), - Linux(:armv7l, :musl, :eabihf) => ("$bin_prefix/ZMQ.arm-linux-musleabihf.tar.gz", "e80977a6e6695846de6553448aa9d9d6482bfa52e5fcf536e227162e16322fb8"), - Linux(:i686, :glibc) => ("$bin_prefix/ZMQ.i686-linux-gnu.tar.gz", "18f043e1179a2db4dc2867c9da73cbccf1b2fc6851280b07891898951fd8a950"), - Linux(:i686, :musl) => ("$bin_prefix/ZMQ.i686-linux-musl.tar.gz", "9f2425ec361ecadc0e836ea8cb7f378839ae5dcef8205a85d42f513368f2b6a7"), - Windows(:i686) => ("$bin_prefix/ZMQ.i686-w64-mingw32.tar.gz", "960cd3ee0443389e35614dbd5954f68fe969abc42b9b5d26c0339bf449854473"), - Linux(:powerpc64le, :glibc) => ("$bin_prefix/ZMQ.powerpc64le-linux-gnu.tar.gz", "51eb2313e6552a7d2eaf4bb2167b3498fbc16dfbab070bfb9a0a3788a2e64f6d"), - MacOS(:x86_64) => ("$bin_prefix/ZMQ.x86_64-apple-darwin14.tar.gz", "ee0aa673e4fdb1574ac2d6c7c3a22c3c03f8ca75928968f051f78a2c32941b20"), - Linux(:x86_64, :glibc) => ("$bin_prefix/ZMQ.x86_64-linux-gnu.tar.gz", "59266a7b62b74da29389e058fe014bef31ff47ed83c021a6d0fd59053f428cd3"), - Linux(:x86_64, :musl) => ("$bin_prefix/ZMQ.x86_64-linux-musl.tar.gz", "7a88e5c5f933dd1b67b23ae70a4c78e27324170140f0f42a355b5ae53a8794c4"), - FreeBSD(:x86_64) => ("$bin_prefix/ZMQ.x86_64-unknown-freebsd11.1.tar.gz", "34c1c5077c114417b893ae8048b71ed3b7812875b9c789b33407e56fed5e3646"), - Windows(:x86_64) => ("$bin_prefix/ZMQ.x86_64-w64-mingw32.tar.gz", "ba1e0394919d6e6eeda13e201278f754069d33967ee96043cb52505e05a9128b"), -) - -# source code tarball and hash for fallback compilation -source_url = "https://github.com/zeromq/libzmq/releases/download/v4.2.5/zeromq-4.2.5.tar.gz" -source_hash = "cc9090ba35713d59bb2f7d7965f877036c49c5558ea0c290b0dcc6f2a17e489f" - -# Install unsatisfied or updated dependencies: -unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) -if haskey(download_info, platform_key()) && !forcecompile - url, tarball_hash = download_info[platform_key()] - if !isinstalled(url, tarball_hash; prefix=prefix) - # Download and install binaries - install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) - - # check again whether the dependency is satisfied, which - # may not be true if dlopen fails due to a libc++ incompatibility (#176) - unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) - end -end - -if unsatisfied || forcecompile - # Fall back to building from source, giving the library a different name - # so that it is not overwritten by BinaryBuilder downloads or vice-versa. - libname = "libzmq_from_source" - products = [ LibraryProduct(prefix, [libname], :libzmq) ] - source_path = joinpath(prefix, "downloads", "src.tar.gz") - if !isfile(source_path) || !verify(source_path, source_hash; verbose=verbose) || !satisfied(products[1]; verbose=verbose) - compile(libname, source_url, source_hash, prefix=prefix, verbose=verbose) - end -end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products) diff --git a/deps/compile.jl b/deps/compile.jl deleted file mode 100644 index 391cda7..0000000 --- a/deps/compile.jl +++ /dev/null @@ -1,28 +0,0 @@ -using BinaryProvider -using Libdl: dlext - -function compile(libname, tarball_url, hash; prefix=BinaryProvider.global_prefix, verbose=false) - # download to tarball_path - tarball_path = joinpath(prefix, "downloads", "src.tar.gz") - download_verify(tarball_url, hash, tarball_path; force=true, verbose=verbose) - - # unpack into source_path - tarball_dir = joinpath(prefix, "downloads", split(first(list_tarball_files(tarball_path)), '/')[1]) # e.g. "zeromq-4.2.5" - source_path = joinpath(prefix, "downloads", "src") - verbose && @info("Unpacking $tarball_path into $source_path") - rm(tarball_dir, force=true, recursive=true) - rm(source_path, force=true, recursive=true) - unpack(tarball_path, dirname(tarball_dir); verbose=verbose) - mv(tarball_dir, source_path) - - install_dir = joinpath(source_path, "julia_install") - verbose && @info("Compiling in $source_path...") - cd(source_path) do - run(`./configure --prefix=$install_dir --without-docs --disable-libunwind --disable-perf --disable-eventfd --without-gcov --disable-curve-keygen`) - run(`make`) - run(`make install`) - mkpath(libdir(prefix)) - cp("$install_dir/lib/libzmq.$dlext", joinpath(libdir(prefix), libname*"."*dlext), - force=true, follow_symlinks=true) - end -end diff --git a/src/ZMQ.jl b/src/ZMQ.jl index 1c260b0..f57be26 100644 --- a/src/ZMQ.jl +++ b/src/ZMQ.jl @@ -1,20 +1,14 @@ # Support for ZeroMQ, a network and interprocess communication library module ZMQ +using ZeroMQ_jll -import Libdl using Base.Libc: EAGAIN using FileWatching: UV_READABLE, uv_pollcb, _FDWatcher import Sockets using Sockets: connect, bind, send, recv import Base.GC: @preserve -const depsjl_path = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl") -if !isfile(depsjl_path) - error("Blosc not installed properly, run Pkg.build(\"ZMQ\"), restart Julia and try again") -end -include(depsjl_path) - export #Types StateError,Context,Socket,Message, @@ -36,7 +30,6 @@ include("message.jl") include("comm.jl") function __init__() - check_deps() major = Ref{Cint}() minor = Ref{Cint}() patch = Ref{Cint}()