Error: Unable to create cache directory

オープン
#386 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cmake, docker, rust

調査の方向性

cargo component build の呼び出しと、CARGO_COMPONENT_CACHE_DIR に関連するキャッシュディレクトリの処理から始めます。説明されている Docker セットアップで、非 root ユーザーとして wasm32-unknown-unknown の release ビルドを再現します。ビルドが権限エラーなしでキャッシュを作成または使用でき、文書化された回避策を必要としなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

Description

I build my repository in CI/CD by checking out the repository, and then mounting it into a docker container in which I execute the build using CMake/Make.
The image for the container used to have cargo-component v0.15.0, and everything worked fine.
I am in the process of trying to upgrade my build image to use cargo-component v0.21.1, and I suddenly started getting the following error:

[ 50%] Performing build step for 'MyComponent'
cd /home/.../src/MyComponent-build && cargo component build -r --target wasm32-unknown-unknown --manifest-path /home/.../my-component/Cargo.toml --target-dir /home/.../build/MyComponent
Error: Unable to create cache directory

Caused by:
    Permission denied (os error 13) 
Root cause

Presumably this is because I am running the build as a non-root user within the docker container and code was added that attempts to create a cache directory in a permissioned space.

Workaround

For anyone else experiencing this issue, I've found the following workaround:
Manually set a value for the CARGO_COMPONENT_CACHE_DIR environment variable. e.g. export CARGO_COMPONENT_CACHE_DIR=.cargo-component-cache

主要言語
Rust
スター
593
フォーク
68
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bytecodealliance/cargo-component のほかの issue

bytecodealliance/cargo-component の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。