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

precompile fails with Julia < 1.6 #236

Closed
minrk opened this issue May 28, 2024 · 4 comments · Fixed by #237
Closed

precompile fails with Julia < 1.6 #236

minrk opened this issue May 28, 2024 · 4 comments · Fixed by #237

Comments

@minrk
Copy link
Contributor

minrk commented May 28, 2024

The use of bind('tcp://localhost:*') fails precompile on zmq < 4.3.5, because binding to hostnames is not supported in zmq 4.3.2, the latest version packaged by ZeroMQ_jll for Julia < 1.6.

Using 127.0.0.1 will almost always work. I think * / 0.0.0.0 will always work, but binding to public interfaces may not be desirable.

You could also lookup localhost's ip with Sockets.getaddrinfo("localhost"), which is ultimately what the current code is doing, but the getaddrinfo is in libzmq itself in the supported versions.

@minrk
Copy link
Contributor Author

minrk commented May 28, 2024

Forgot repro:

docker run --rm julia:1.5

then:

using Pkg
Pkg.add("ZMQ")
pkg"precompile"

fails with:

julia> pkg"precompile"
Precompiling project...
[ Info: Precompiling ZMQ [c2297ded-f4af-51ae-bb23-16f91089e4e1]
ERROR: LoadError: ZMQ.StateError("No such device")
Stacktrace:
 [1] bind(::ZMQ.Socket, ::String) at /root/.julia/packages/ZMQ/s0VKZ/src/socket.jl:91
 [2] macro expansion at /root/.julia/packages/ZMQ/s0VKZ/src/ZMQ.jl:61 [inlined]
 [3] top-level scope at /root/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:85
 [4] include(::Function, ::Module, ::String) at ./Base.jl:380
 [5] include(::Module, ::String) at ./Base.jl:368
 [6] top-level scope at none:2
 [7] eval at ./boot.jl:347 [inlined]
 [8] eval(::Expr) at ./client.jl:467
 [9] top-level scope at ./none:3
in expression starting at /root/.julia/packages/ZMQ/s0VKZ/src/ZMQ.jl:47

@JamesWrigley
Copy link
Member

Interesting 🤔 I'm not that inclined to keep supporting versions less than 1.6 since it's the LTS, but if this is all we need for compatibility then it's ok. I'll have a look.

@minrk
Copy link
Contributor Author

minrk commented May 28, 2024

I've tested that #237 fixes pre-compile on 1.3 and 1.5 in docker.

FWIW, I'd be totally okay making a release with #237 and then immediately dropping support for < 1.6. The only issue right now is that the current version claims to support 1.3 but doesn't actually install on < 1.6.

@JamesWrigley
Copy link
Member

Yes, makes sense. I'll keep compatibility for now because this is quite an old package and I'm aware that there are people using it on older Julia versions. If compatibility is trickier later I'll bump the compat bounds.

Anyway, thank you very much for the report and the bug fix ❤️ I've registered a new version which should be available soon: JuliaRegistries/General#107787

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 a pull request may close this issue.

2 participants