matrix-org / sydent

Sydent: Reference Matrix Identity Server

Home Page:http://matrix.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cargo/rust permission denied

tseeling opened this issue · comments

I try to build sydent 2.5.5 with the supplied Dockerfile but I receive permission denied while compiling cryptography.
When removing the USER definition from the Dockerfile (i.e. running the build step as root) works but I'm not sure if the venv is complete when doing it this way.

cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --
          Updating crates.io index
       Downloading crates ...
        Downloaded parking_lot_core v0.9.7
      error: failed to download replaced source registry `crates-io`
      
      Caused by:
        failed to create directory `/cargo/registry/cache/index.crates.io-d11c229612889eed`
      
      Caused by:
        Permission denied (os error 13)
      
          =============================DEBUG ASSISTANCE=============================
...
          Python: 3.11.4
          platform: Linux-4.18.0-425.19.2.el8_7.s390x-s390x-with-glibc2.31
          pip: n/a
          setuptools: 68.0.0
          setuptools_rust: 1.6.0
          rustc: 1.70.0 (90c541806 2023-05-31)
          =============================DEBUG ASSISTANCE=============================
      
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101
      [end of output]
      ```

Using some ls -lA for debugging I noticed that all files and directories belong to sydent:sydent except the /home/sydent/src which belonged root:root. I added a chown and could build the container with python 3.11.4 and rust 1.70.

any chance you'd be happy to open a PR with the specific chown you used? :)