cargo-contract icon indicating copy to clipboard operation
cargo-contract copied to clipboard

permission denied error while trying to create a verifiable build

Open abhijeetbhagat opened this issue 1 year ago • 3 comments

getting a permission denied error:

(rust:nightly) ↪ cargo contract build --verifiable
 [1/3] Image does not exist. Pulling one from the registry
4.0.0-alpha: Pulling from paritytech/contracts-verifiable
7eaf8c23e6d5: Pull complete
6f3e3b4845f0: Pull complete
ac4d710538ca: Pull complete
01f0e1379a81: Pull complete
Digest: sha256:a3cc95b6e3d54981774e20760da094ba038e666190c57bb01f932c145f1b4f71
Status: Downloaded newer image for paritytech/contracts-verifiable:4.0.0-alpha
 [2/3] Started the build inside the container: ink-verified-verifiablecontract-34568
warning: nothing to print.

To find dependencies that require specific target platforms, try to use option `--target all` first, and then narrow your search scop
e accordingly.
 [1/*] Building cargo project
warning: You are using a rustc version that might emit unsupported wasm instructions. Build using a version lower than 1.70.0 to make
 sure your contract will deploy.
    Updating crates.io index
  Downloaded cc v1.0.77
  Downloaded dlmalloc v0.2.3
  Downloaded getopts v0.2.21
  Downloaded rustc-demangle v0.1.21
  Downloaded hashbrown v0.13.1
  Downloaded compiler_builtins v0.1.92
  Downloaded libc v0.2.143
  Downloaded 7 crates (1.1 MB) in 0.56s
error: failed to create directory `/contract/target`

Caused by:
  Permission denied (oERROR: command ["/usr/local/rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo", "build", "--color=alw
ays", "--target=wasm32-unknown-unknown", "-Zbuild-std=core,alloc", "--no-default-features", "--release", "--target-dir=/contract/targ
et/ink", "-Zbuild-std-features=panic_immediate_abort"] exited with code 101
ERROR: Failed to read build result from docker build

To Reproduce Steps to reproduce the behavior:

  1. cargo contract new verifiablecc
  2. cd verifiablecc
  3. cargo contract build --verifiable

Expected behavior a verifiable build should be created.

Environment (please complete the following information):

  • OS: Ubuntu 22.04.3 LTS
  • cargo-contract version: cargo-contract-contract 4.0.0-alpha-78a2473-x86_64-unknown-linux-gnu
  • ink! version: 4.2.0

Additional warning

warning: You are using a rustc version that might emit unsupported wasm instructions. Build using a version lower than 1.70.0 to make sure your contract will deploy.

abhijeetbhagat avatar Aug 08 '23 08:08 abhijeetbhagat

Since we are modifying files with cargo, docker process and user must be in the same Linux group. Have you done docker post-installation steps?

SkymanOne avatar Aug 08 '23 16:08 SkymanOne

yes, i am running docker as a non-root user i.e. without needing sudo.

abhijeetbhagat avatar Aug 09 '23 05:08 abhijeetbhagat

Are you running as a user with sudo privileges?

SkymanOne avatar Aug 10 '23 15:08 SkymanOne