freechipsproject / chisel-bootcamp

Generator Bootcamp Material: Learn Chisel the Right Way
Apache License 2.0
976 stars 277 forks source link

Latest docker image has bad permissions, results in cell run errors, manual temporary fix available #180

Open n-kremeris opened 1 year ago

n-kremeris commented 1 year ago

Hi All,

After updating to the latest docker image (docker pull ucbbar/chisel-bootcamp), running the setup cell on any of the pages no longer works due to a permission problem, as you can see below

val path = System.getProperty("user.dir") + "/source/load-ivy.sc"

interp.load.module(ammonite.ops.Path(java.nio.file.FileSystems.getDefault().getPath(path)))

Compiling /chisel-bootcamp/Main.sc

Checking https://repo1.maven.org/maven2/edu/berkeley/cs/chisel3_2.12/maven-metadata.xml
Checked https://repo1.maven.org/maven2/edu/berkeley/cs/chisel3_2.12/maven-metadata.xml
Checking https://repo1.maven.org/maven2/edu/berkeley/cs/chisel-iotesters_2.12/maven-metadata.xml
Checked https://repo1.maven.org/maven2/edu/berkeley/cs/chisel-iotesters_2.12/maven-metadata.xml
Checking https://repo1.maven.org/maven2/edu/berkeley/cs/chiseltest_2.12/maven-metadata.xml
Checked https://repo1.maven.org/maven2/edu/berkeley/cs/chiseltest_2.12/maven-metadata.xml
Downloading https://repo1.maven.org/maven2/edu/berkeley/cs/chiseltest_2.12/maven-metadata.xml
Downloaded https://repo1.maven.org/maven2/edu/berkeley/cs/chiseltest_2.12/maven-metadata.xml

ammonite.util.CompilationError: Failed to resolve ivy dependencies:/coursier_cache/.structure.lock (Permission denied)
  ammonite.interp.Interpreter$$anon$1$load$.module(Interpreter.scala:716)
  ammonite.$sess.cmd0$Helper.<init>(cmd0.sc:2)
  ammonite.$sess.cmd0$.<init>(cmd0.sc:7)
  ammonite.$sess.cmd0$.<clinit>(cmd0.sc:-1)

The problem can be temporarily fixed manually by logging in to the container as root and changing ownership of the /coursier_cache folder from root to bootcamp

docker exec -u 0 -it 0227231b93fd bash
chown -R bootcamp:bootcamp /coursier_cache