Could you elaborate which patch would solve this problem?
A patch to the `go_binary` rule to cause it not to ignore its cgo-related arguments. That would remove the main current issue, but could reveal more issues.
As I said there are two bugs.
One bug is that to build the go wrapper of libczmq you must have it installed on the host machine, and must be lucky for the host to be the same platform as target.
Now we mostly run these things on x86_64, so if you `sudo apt-get install libczmq4-dev` you will have the library installed and we can forget about it for now. For now. Ideally, the go wrapper would be built with a hermetic libzmq.
The other bug is, when you add `cdeps = [ "@libzmq//:libzmq"]`, this should cause the command line that builds your `//:zmq_server` and `//:zmq_client` to contain a flag `-L <path to libzmq.a that was built in the @libzmq repo>`. It should also cause the files comprising target `@libzmq//:libzmq` to be in the sandbox of the rule, so that the linker can actually find those files.
But, for some reason this does not happen. This is why linking fails.
But also, even if we fixed that, there is the problem that the cgo wrapper for the zmq library is built with the host's libzmq, while your code is built with the hermetic libzmq. This could break if the two are different enough. I didn't verify if this is the case, or we just got lucky, since it got late last night for me when I tried all of this and I had to stop trying.
F