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

Fail to compile rust library on linux #47

Closed
abailly-iohk opened this issue Nov 17, 2021 · 4 comments
Closed

Fail to compile rust library on linux #47

abailly-iohk opened this issue Nov 17, 2021 · 4 comments
Labels
bug ⚠️ Something isn't working

Comments

@abailly-iohk
Copy link
Collaborator

When I try to cargo build inside the rust directory, I get the following error:

error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/curry/mithril/rust/target/debug/deps/libzeroize_derive-f42e2238bc0119fb.so)
   --> /home/curry/.cargo/registry/src/github.com-1ecc6299db9ec823/zeroize-1.4.1/src/lib.rs:220:9
    |
220 | pub use zeroize_derive::Zeroize;
    |         ^^^^^^^^^^^^^^

error: could not compile `zeroize` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

I have tried googling and found issues related to static linking suggesting musl should be used instead but even removing the staticlib target does not fix it.

@abailly-iohk abailly-iohk added the bug ⚠️ Something isn't working label Nov 17, 2021
@abailly-iohk
Copy link
Collaborator Author

More information:

$ uname -a
Linux haskell-dev-vm-1 5.11.0-1022-gcp #24~20.04.1-Ubuntu SMP Thu Oct 21 16:03:19 UTC 2021 x86_64 GNU/Linux
$ rustc -vV
rustc 1.55.0 (c8dfcfe04 2021-09-06)
binary: rustc
commit-hash: c8dfcfe046a7680554bf4eb612bad840e7631c4b
commit-date: 2021-09-06
host: x86_64-unknown-linux-gnu
release: 1.55.0
LLVM version: 12.0.1

@abailly-iohk
Copy link
Collaborator Author

It works fine on local Mac OS, perhaps something related to nix env?

@abailly-iohk
Copy link
Collaborator Author

@iquerejeta @abakst Any suggestion on how to solve this?

@abailly-iohk
Copy link
Collaborator Author

rust code depends on a specific glibc version which was not present on the VM where I compiled it apparently. Bumping the VM's version to 21.10 fixed the issue, as well as explicitly installing a glibc 2.32 on earlier Ubuntu versions. Perhaps there's a way to ensure the right version is installed trough shell.nix?
We should run CI as a matrix build across various OSes to catch those issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ⚠️ Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant