Hi! Newish to Racket and I hope this is appropriate. I am going thought the material in Berkeley's CS61A and I am running into the following error when I run their autograder locally as in racket -tm grader.rkt -- hw1-tests.rkt hw1.rkt
An error occurred:
file-or-directory-modify-seconds: `read' access denied for /Users/bernardino/Library/Preferences/org.racket-lang.prefs.rktd
I looked around and did find some Github issue but it wasn't helpful. I could just extract all their tests but I would like to understand what's off.
I'm not sure how or why this happened, but I would check the permissions on ~/Library/Preferences/org.racket-lang.prefs.rktd and try to adjust them with chmod.
If that doesn't work, maybe removing that file will cause it to be re-created? Or re-installing Racket?
Thanks everyone for the support and apologies for the late feedback... I tried changing permissions and even running as sudo. Nothing. Then deleted the incriminated file and finally reinstalled everything. Still getting that error. @soegaard I'm running MacOS Ventura13.0 on an Apple M1 Silicon MacBook Air. Racket was installed with the provided installer from the racket-lang site for the Silicon architecture ....
At this stage I am just being stubborn I guess, it's not a huge deal.
A possibility, related to @soegaard 's diagnosis,a is that the solution you're trying to run through the autograder is using a library that the homework's authors did not intend (e.g., the framework) and that library is, behind the scenes, trying to use the preferences file.
Yes, I am already running the tests manually (as I mentioned in the first post) but like I said I'd be interested in just solving what's wrong for the sake of it
Also, reading over that issue, it looks like you might simply need to add (require racket/gui/base) to the grading script (outside the sandbox, so not in your sample solution).
Just my two cents after facing the same issue (but for hw2.rkt of the same course) - what I had to do to make the tests run was change the sandbox-path-permissions in the grader.rkt from [sandbox-path-permissions (list '(exists "/"))]
to [sandbox-path-permissions (list '(execute "/"))]
after looking at this part of the documentation.
Still don't understand the why, but I hope this will help anyone facing the same issue.
UPDATE: Actually, now that I thought this through, the less permissive [sandbox-path-permissions (list '(read "/"))]
can be used, with the same success.