uwdb / Cosette

Cosette is an automated SQL solver.
BSD 2-Clause "Simplified" License
662 stars 54 forks source link

Broken FrontendDockerfile #68

Closed primeapple closed 5 years ago

primeapple commented 5 years ago

Hey there!

Problem When playing around with your tool, I found something not working correctly in Docker. The problem was that Cosette would always return errors, because Racket couldn't find Rosette. The actual problem is, that this error only happened with new creations of the docker container, older ones (~4 months old) worked just fine.

Explanation However, I'm happy to present you the fix to this problem. It is in line 27 in Cosette/FrontendDockerfile: RUN raco pkg install rosette; exit 0 First of all, it is kind of bad practice to exit 0. It will just ignore errors in the command before and makes sure the building of the Docker container is done. However the actual problem is, that raco changed it's default behaviour in version 6.1.1.5 and 6.1.1.6. raco pkg install X no longer automatically installs the dependencies for X but waits for an input of the user in interactive mode. This does not work in Docker and so paco pkg install rosette never installed the dependencies --> Rosette did not work.

Fix: I recommend the following fix: RUN raco pkg install rosette; exit 0 becomes RUN raco pkg install --batch --auto rosette; exit 0

--batch disables interactive mode, --auto automatically installs dependencies.

Afterthoughts: I think it would be nice to remove the exit 0 from the line too. This is currently there to "ignore" a warning about missing librarys, which are only for gui, so not needed for Cosette. Still, to make it easier to find certain issues you could probably install them anyways, since they are not that big (~10MB). So my suggestion is to change line 5 from RUN apt-get -y install build-essential curl zlib1g-dev libgmp3-dev libedit2 python to RUN apt-get -y install build-essential curl zlib1g-dev libgmp3-dev libedit2 python libpangocairo-1.0-0 libjpeg62 This way everything should be fine and we can also remove ; exit 0 from line 27.

Conclusion Tell me if you want me to make a pull request or if you want to have a look and fix the errors on your own. I know you work on Cosette 2.0, but I still would like to see a fix for these problems since they are not that big :)

Greetings!

stechu commented 5 years ago

@primeapple Thanks for such a well written issue! Mind creating a PR?