Reputation: 53
im building android 10 on an ubuntu machine. the source is custom and not googles' specifically. the source is hard-coded for a prebuilt clang to use ccache. i have installed ccache and added to bashrc these variables:
_CCACHE_EXEC=/usr/bin/ccache
_CCACHE_EXEC -M 50G
export USE_CCACHE=1
chmod and chown the ~/.ccache has the same results during the build, the actual error is:
ccache: error: Failed to create directory /home/brandonabandon/.ccache/tmp: Read -only file system.
i cannot contact the owner of the source. i have attempted disabling ccache which leads to errors further on due to recent hard-coded ccache commits. i could build fine before. ive been stumped for a week. any ideas?
Upvotes: 5
Views: 16173
Reputation: 1
create a new mount point using
sudo mkdir /mnt/ccache
then bind ccache directory to that mount point using
sudo mount --bind /home/<your_account_username>/.cache/ccache /mnt/ccache
replace <your_account_username>
with the appropriate value. After this, add the following
nano ~/.bashrc
file and adds:
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
export CCACHE_DIR=/mnt/ccache
save and exit
Terminal: ccache -M 50G
add auto mount
sudo nano /etc/fstab
/home/<your_account_username>/.cache/ccache /mnt/ccache none defaults,bind,users,noauto 0 0
save and exit
nano ~/.profile
mount /mnt/ccache
save and exit
You should not see these errors ever again.
Upvotes: 0
Reputation: 1
mkdir $HOME/.ccachetmp
export CCACHE_DIR=$HOME/.ccachetmp
You can additionally add
export CCACHE_DIR=$HOME/.ccachetmp
In ~/.bashrc
Upvotes: 0
Reputation: 318
Not what the OP was looking for, but: If someone ends up here looking for a similar ccache error msg issue with arch/manjaro using
sudo pamac build <thing>
Then instead do
pamac build <thing>
and then type in password when prompted.
Upvotes: 0
Reputation: 6636
Improving the accepted answer here as I hit this the second time: PS: I am running as root
mkdir /mnt/ccache
mount --bind ~/.ccache /mnt/ccache
and env variables are the same as above:
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
export CCACHE_DIR=/mnt/ccache
ccache -M 100G -F 0
In addition, I suggest putting those in .profile
file using following command:
echo -e "\nexport USE_CCACHE=1\nexport CCACHE_EXEC=/usr/bin/ccache\nexport CCACHE_DIR=/mnt/ccache\nccache -M 100G -F 0" >> ~/.profile
Upvotes: 0
Reputation: 166
It looks that you have your ccache on the same partition as your source code. soong sandboxing mechanism does not like it:( you have two options:
Here is a list of steps for the second option:
sudo mkdir /mnt/ccache
sudo mount --bind /home/<your_current_path>/ccache /mnt/ccache
and needed env:
export USE_CCACHE=1
export CCACHE_EXEC=/usr/bin/ccache
export CCACHE_DIR=/mnt/ccache
ccache -M 100G -F 0
Upvotes: 15