Hi. When trying to generate a zome, I get a message saying I should install Rust. I copied the Linux command from https://rustup.rs/ and got an error message. See below. (The instructions with “nix-env…” were saying that that would install Rust…)
[vagrant@nixos:/vagrant/my_first_app]$ hc generate zomes/my_zome
This command requires the cargo command, which is part of the Rust toolchain.
Generating a Rust based Zome depends on having Rust installed.
As a first step, get Rust installed by using rustup https://rustup.rs/.
Holochain requires you use the nightly-2019-07-14 toolchain.
With Rust already installed switch to it by running the following commands:
$ rustup toolchain install nightly-2019-07-14
$ rustup default nightly-2019-07-14
Having taken those steps, retry this command.
[vagrant@nixos:/vagrant/my_first_app]$ curl --proto ‘=https’ --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer main: line 356: /tmp/tmp.IeYyA2X6kE/rustup-init: No such file or directory
Just in case this would help to answer my question, I found this online for a similar error message (from Jan 2017):
NixOS has libraries in non-standard places; rustup-init executable has to be patched or recompiled on this system… Other solution I see is to precompile it with every release. How to patch: http://unix.stackexchange.com/a/252232
Under “Build your first DNA”, there is this: If you are using nix-shell, enter it before continuing.
What does it mean to enter nix-shell? If I type “nix-shell”, that results in an error (“no such file…”). Or am I in nix-shell no matter what, after I SSH into the VM?
@sachaweb those instructions from inside hc are wrong
they are just very old
when you are inside a nix shell the right version of rust will be there, but of course this is what the nix env approach is trying to avoid
yegor was saying there’s a way to wrap hc in a mini shell of its own provided by nix env that would magically fix this, i’m putting an issue in holonix to chase that up
There, you recommended I change the Vagrant file, with a link to some instructions. So now I added this bit to the end of my Vagrantfile:
Vagrant.configure(“2”) do |config|
config.vm.box = “debian/stretch64”
config.disksize.size = “20GB”
end
Then I exited SSH and Vagrant, not being sure how to make sure the new Vagrantfile is executed. However, I still got the same disk space error (my HD has plenty of space of course).
Last lines of the output:
tar: Exiting with failure status due to previous errors
do not know how to unpack source archive /nix/store/qf8ks81hjncyrycsqjj3vqlhjb8pp19z-rust-nightly-x86_64-unknown-linux-gnu.tar.xz
builder for ‘/nix/store/j8j2vnskqhd8x8sc46qnl8x1bqdk7nwd-rust.drv’ failed with exit code 1
note: build failure may have been caused by lack of free disk space
cannot build derivation ‘/nix/store/sqll2fajnq18cjxcjnxf1bgyrjlspn4i-rust-1.38.0-nightly-2019-07-13-69656fa4c.drv’: 1 dependencies couldn’t be built
error: build of ‘/nix/store/sqll2fajnq18cjxcjnxf1bgyrjlspn4i-rust-1.38.0-nightly-2019-07-13-69656fa4c.drv’ failed
Hi David (or anyone), could you please elaborate how to do the “black magic” trick with the micro-shell (or any other workaround)?
I’ll be preparing some people for the Prague hackathon tomorrow so it’s critical for me to make the environment work.
(I’m using the Vagrant/NixOS on Windows10.)
Yeh I recommend just using nix-shell and avoiding nix-env. I think we are going to remove nix-env from the quick start as it’s causing some confusion.
Also @sachaweb In that Vagrant file there is a 16gig swap so I think you might actually need more then 20gig or lower the swap size.
So either try lowering this line:
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
vb.gui = false
# Customize the amount of memory on the VM:
vb.memory = "4096"
vb.cpus = "4"
vb.customize ["modifyvm", :id, "--hwvirtex", "off"]
end
to
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
vb.gui = false
# Customize the amount of memory on the VM:
vb.memory = "4096"
vb.cpus = "4"
vb.customize ["modifyvm", :id, "--hwvirtex", "off"]
vb.disksize.size = '40GB'
end
That should hopefully allow you to gain enough space to use nix-shell.
@freesig@sachaweb from memory, messing with the disk size and/or swap may need a full vagrant rebuild
vagrant destroy
vagrant up
smaller config changes only need a reprovision
vagrant provision
both are much faster than the initial box download as it can use the box cached locally as a starting point
the only reason for the large swap was that several months ago we had a test runner that would not kill already-run tests, so we bumped the memory right up as a workaround - if the runner is cleaning up now we can bring it down quite a lot, or if you’re not planning to do the “everything in one” test suite you’re also fine - @maackle and @lucksus know more about the current state of this i’d say
Sure @dhtnetwork, it can be moved to Holonix but then perhaps there should be some mention of that here because people installing Holochain might be looking mainly at the threads under ‘getting started’.
I first tried adding the diskspace line in the vagrantfile, as shown by @dhtnetwork above. That resulted in an error already when doing vagrant destroy (@thedavidmeister). Error message:
VirtualBox Provider:
The following settings shouldn’t exist: disksize
So I removed the diskspace line and just changed the swap file size from 16384 to 8192 (@dhtnetwork) .
Then vagrant destroy, and building everything from the ground up. (That took some time! Is it not enough to do vagrant provision or halt in order to apply the changes in the vagrantfile?)
Unfortunately, when nix-shell https://holochain.love completed, it still had the same disk space error.
I could reduce the swap file’s size even more (to how much?) but I am not sure if that would cut it…
Hey @sachaweb could you share any system spec? Screenshot would be helpful.
At the root, I believe there are way too many files. I believe there are 1.5 M files? @thedavidmeister is it possible to pair down the file size?
I understand this challenge as I have a Mac and a Windows. At times, it could be long/drawn out process on a Windows platform. But we have to provide a better solution for Windows users.