-
Notifications
You must be signed in to change notification settings - Fork 13
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
GLIBC_2.33 errors when trying to install zmq package #66
Comments
Thanks for reporting this issue - basically this boils down to (as you suggested) the host glibc version from Ubuntu 22.04 being different (newer in this case) than the one shipped in the emacs snap. When compiling the emacs-zmq.so module, it looks like it has used the host installed gcc and hence linked this against the host glibc. Then when emacs goes to load the module, there is a version mismatch as emacs itself was compiled against the glibc in the snap (which comes from Ubuntu 20.04). There is no good way around this from the emacs snap side - but you might be able to instead have zmq use the gcc that is shipped within the emacs snap and hence then have the module get linked against the glibc from the emacs snap. We take this approach for tree-sitter in the emacs snap - basically I patch the tree-sitter code to use the gcc from the snap instead via https://github.com/alexmurray/emacs-snap/blob/88538f290f140e896545ebd5497e7c9be6a0b7a4/treesit.patch It is a shame there is no support in emacs itself to say something like, whenever compiling any module, use this gcc / compiler arguments - instead it seems every package that wants to use a native module has to implement support for compiling the module itself (as tree-sitter does) and hence each then requires a bespoke solution from the emacs snap side. But given this is a third-party package I am not sure there is a lot I can do - I can provide a workaround though - with the following I was able to get zmq installed and the module correctly loaded in a fresh (let* ((emacs-snap-dir (file-name-as-directory (getenv "EMACS_SNAP_DIR")))
(process-environment (append process-environment `(,(concat "CC=" emacs-snap-dir "usr/bin/gcc-10" )
,(concat "CXX=" emacs-snap-dir "usr/bin/g++-10")
,(concat "CFLAGS=--sysroot=" emacs-snap-dir)
,(concat "CPPFLAGS=--sysroot=" emacs-snap-dir)
,(concat "LDFLAGS=--sysroot=" emacs-snap-dir " -L" emacs-snap-dir "/usr/lib")))))
;; load zmq package
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-refresh-contents)
(package-install 'zmq)
(require 'zmq)
(zmq-load)) |
Thanks so much for trying this. I just tried your sample code in a fresh install, and I'm still not being successful with it. The code you provided ran, and it did the compile etc, but it must still have linked to the wrong glibc for me. I've posted the errors below, but I recognize that this is third-party code that isn't your responsibility to figure out. As you say, it's too bad that emacs doesn't provide a better approach for combining these approaches together.
|
Did you remove the old emacs-zmq.so first? |
Wow, I guess that was it. I was completely convinced that I had nuked my .emacs.d and started from scratch, but I just did it again to prove it, and now it's working. :) Thank you! I'll now have to see if I can integrate the above into the rest of my workflow, but that's the nudge I needed. Much appreciated. |
No worries - I'll leave this issue open for now so that others can find if need be. |
Hello! unluckily this workaround did not work for me... Here is my minimal configuration with a single file, and I there is not a single other file/folder in my configuration directory (actully I use chemacs):
and here is the traceback of the error:
any clues of why this happens? Thank you, |
I notice it is loading |
I think I figured out my issue (it was completely my mistake, but I write it here in case it is useful for anyone else): when running emacs in the fresh environment, you need to answer "n" (No) to Check for compatible module binary to download? so that the module is compiled using the customized settings from your snippet above, i.e., answering "y" to ZMQ module not found. Build it?. |
With this I still meet the same error:
|
I'm trying to install package
zmq
, which is used withinjupyter
. Then when issuing(require 'zmq)
, I am prompted to build it, for which I respond yes.I keep getting this error:
Debugger entered--Lisp error: (module-open-failed "/home/<username>/.config/emacs-doom-chemacs/.local/elpa/zmq-20230608.1856/emacs-zmq.so" "/snap/emacs/2157/usr/bin/../../lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.33' not found (required by /home/<username>/.config/emacs-doom-chemacs/.local/elpa/zmq-20230608.1856/emacs-zmq.so)")
I'm running on Ubuntu 22.04, running in this snap.
I understand that this has something to do with the version of glibc being different between the system version and the snap version, but I'm not sure what to do about it. I see that there are other issues relating to glibc on other packages, but I'm not sure what to do about it in this particular case. Any advice?
The text was updated successfully, but these errors were encountered: