Stuck with Cargo Install Workspace Inheritance

Hello. I am looking for answers. I am setting up a node and I cannot seems to get past the Cargo Install --path . Yes, I've tried using Sudo Cargo Install --path . but that didn't solve it. I've tried uninstalling Rust and Cargo and reinstall, no success. I've reinstalled the OS but the same message pops up.

So the initial errors were: failed to compile 'snarkos v2.0.2 (/home/ubuntu/snarkOS), intermediate artifacts can be found at ...snarkOS/target
Caused by: failed to open: /home/.../release/.cargo-lock
Caused by: Permission denied (os error 13).

So then I tried running Sudo Cargo Install --path . And the errors were:

failed to load manifest for workspace member '/home/../snarkOS/account'
Caused by: failed to parse manifest at '/home/../account/Cargo.toml'
feature 'workspace-inheritance' is required.
The package requires the Cargo feature called 'workspace-inheritance', but that feature is not stabilized in this version of Cargo (1.61.0). Consider adding 'cargo-features= ["workspace-inheritance"] to the top of Cargo.toml to tell Cargo you are opting in to use this unstable feature.

I tried just using Cargo Build --release but it just gave me a permission denied(os error 13)

So then I nano the Cargo.toml and added the feature at the top of it with: cargo-features = ["workspace-inheritance"] and then ran sudo cargo install --path . and I got more errors: :expressionless:

Failed to load manifest for workspace member '/home/../account'
Caused by: failed to parse manifest at '/home/ubuntu/../Cargo.toml'
Caused by: error reading 'dependencies.snarkvm' from workspace root manifest's 'workspace.dependencies.snarkvm'
Caused by: inheriting from a parent workspace is not implemented yet.

So this is where I am stuck at. I cannot run the cargo install --path or sudo cargo install --path or cargo build --release. I've tried reinstalling the OS, uninstall and reinstall rust and cargo. I did see some warning msg when installing rust however. It said, it looks like you have an existing installation of Rust at /usr/bin....But I even uninstall the rust in the /usr/bin and can't move forward with the cargo install.

Any help or advice or recommendations, I'd would be grateful. Thank you. :grinning:

You shouldn't run cargo install as root. You probably messed up permissions by doing that. What does ls -l /home/ubuntu/snarkOS/ show? Try sudo chown -R ubuntu:ubuntu /home/ubuntu/snarkOS to reset the owner of all files in /home/ubuntu/snarkOS from root back to your own user.

How did you install Rust? The most recent release is 1.65. Workspace inheritance was stabilized as part of the 1.64 release. If you install Rust through the official https://rustup.rs/ installation, you'll get the most recent version.

You shouldn't typically shouldn't be installing Rust from the distro package manager. For reasonable enough reasons, the version in the distro is always going to be older than the current supported version of Rust, and should generally only be used for the purpose of building other packages provided by the distro. For any other use case the rustup distribution channel should generally be preferred.

Since snarkos is apparently using workspace inheritance, building it requires at a minimum Rust 1.64 whereas you're using 1.61.

Hi. Thank you for your help. You are awesome! That fixed it. I was able to successfully run cargo install --path . and move forward with the node setup. :pray:

Hi. Thank you for your response. The RUST install was: curl --proto '=http' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

I'm not sure why it says I was using 1.61 when I did a rustc --version, it shows 1.65 and for Cargo as well. I also uninstalled and reinstalling it. But @bjorn3 gave me the solution to this problem. It was some kind of permissions issues and in leu of sudo I just did a Cargo Install with his commands for resetting the owner of all files. :pray:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.