-
Notifications
You must be signed in to change notification settings - Fork 409
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
Compiling inside a nix-shell does not work #970
Comments
Try using the following I had similar glibc errors but from using rustup to manage Rust toolchains on nixOS. |
Does rust-lang/futures-rs#2242 (comment) help? |
@efx Holy shit, that worked perfectly! I started with your # Use nixpkgs with oxalica rust-bin overlay
let
rust_overlay = import (builtins.fetchTarball
"https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
nixpkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
rust_channel = nixpkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
in
# Avoid typing `nixpkgs.` before each package name
with nixpkgs;
# Define the shell
pkgs.mkShell {
nativeBuildInputs = [
rust_channel # Full rust from overlay, includes cargo
nodePackages.npm # For all node packages
wasm-pack # Compiling to WASM and packing with web-stuff
];
} And my [toolchain]
channel = "stable"
components = [ "rust-src" ]
targets = [ "x86_64-unknown-linux-gnu", "wasm32-unknown-unknown" ] |
@listx I'm not on NixOS, I'm using the Nix package manager on Ubuntu and Manjaro. I did try fully re-installing everything relating to Rust, but as opposed to NixOS, that doesn't change anything about what glibc version is installed, so I didn't help. |
🐛 Bug description
When trying to compile my rust library using
wasm-pack
inside a nix shell, I get errors about glibc missing, despite it being installed via nix. I do not get those errors when compiling other libraries to my native target.🤔 Expected Behavior
I get those same errors when trying to compile with the natively installed cargo, where my glibc is severely outdated, but I would expect the compilation to work inside the isolated environment of nix.
So this may be an issue with Ubuntu 18.04LTS, where ldd is
ldd (Ubuntu GLIBC 2.27-3ubuntu1.3) 2.27
from 2018.This may also be an issue with the nix-package itself, I created an issue for that as well.
👟 Steps to reproduce
Optional: Install nix as single-user install. This is easily reversible by
sudo rm -rf /nix; rm -rf ~/.nix-profile
.Only do this if you want to reproduce this inside the nix environment.
Log out and back in.
Clone the repo and try to build.
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: wasm-pack 0.9.1
rustc version: rustc 1.49.0 (e1884a8e3 2020-12-29)
OS: Ubuntu 18.04LTS
The text was updated successfully, but these errors were encountered: