I created a small file that exports some stuff and renames signatures from deinprogramm/sdp/image.rkt to match the upper-case style that BSL uses.
Things seemed to be working okay (except that students are so used to Chromebooks and saving stuff in the cloud that they don't understand what "Save the file in the same folder as your file, and make sure you've saved your file, so that DrRacket knows what it is, and no 'apcsp (1).rkt' is not the same name as 'apcsp.rkt', etc.), except that today I asked them to update the file.
Several students (and I) had our computers go into an endless loop where we'd run the main file that had (require "apcsp.rkt") and DrRacket would ask if we wanted to restore files from the previous session, would open a new window, and then do weird things like run out of memory or just say that Interactions was disabled.
The only thing I could think was that maybe an old version of apcsp.rkt was hanging around and DrRacket thought it was an auto-saved file, but I couldn't figure out what was happening.
Any ideas what might be going on? I know the way to actually deal with this is to package up the file so that the require could depend on a package version, and I'm hoping to do that soon, but haven't gotten around to it, yet.
Students had downloaded and used this file for a while. I then added the line
(print-boolean-long-form #f)
after the require and before the provide to get #t and #f instead of #true and #false. It's entirely possible that I'm doing that wrong, because I've never tried to set a parameter, before.
When I did that and asked students to replace the old apcsp.rkt with the new one, every time they ran a file that had (require "apcsp.rkt") in it, DrRacket would ask if they wanted to restore files from the previous session, and no matter what you responded with, a new file would open and the file that you'd clicked Run in would say that execution had halted.
I can't reproduce it on my home computer, can't find any auto-saved files (other places, besides the home folder and the folder where the student's file is saved, I should look for them, btw?), and even creating a brand new folder and opening from there sometimes causes the problem.
I'm a little stumped. I guess the next thing to try is to delete ~/.config/racket folder and see if that fixes anything. If I can reproduce the error again, I'll try to post a video.
OK. I have a screencast of what is going on. Student clicks Run on short file that requires apcsp.rkt. DrRacket asks if she wants to restore previous files. No matter what she clicks, a new file gets opened and she gets the error "Evaluation thread is no longer running." When she goes back to the original file, Interactions are disabled.
I've seen this on MacOS, Windows, and Linux. I've looked for hidden files in the directories and deleted them. I've deleted the compiled folder. I can't figure out what is going on, but it's driving me crazy.
Watching the video it seems likely that @stde-epro has correctly diagnosed the problem. As DrRacket is itself written in Racket, you can run it inside itself, so it really looks like we're seeing the inner one start up in the video.
That said, when I do what you're doing with the apscp.rkt file you posted, I don't see the same behavior. Is it possible that there is another require that got inserted somewhere? If not, maybe there is some other piece of the puzzle we're missing?
If you're up for some debugging, then we can add some printfs into the function that shows the autosave dialog to find out how it is being called and maybe that'll shed some light. Specifically, open up the file (use cmd-shift-o) framework/private/autosave and at the top of the function restore-autosave-files/gui put these lines:
(define (restore-autosave-files/gui [table #f])
(printf "restore-autosave-files/gui called\n")
(for ([x (in-list (continuation-mark-set->context
(current-continuation-marks)))])
(printf " ~s\n" x))
.... rest of the function goes here, as it was before
then we'll be able to see how we're getting to the autosave dialog and maybe that'll give us a hint how the inner drracket is getting started.
OK. For some reason it stopped doing it on my computer, so I need to get it started again or figure out how to do this on a student's laptop. Stay tuned.
default-load-handler: expected a `module' declaration, but found something else
file: /usr/share/racket/pkgs/gui-lib/framework/private/autosave.rkt
context...:
body of "/usr/share/racket/pkgs/drracket-core-lib/drracket/private/drracket-normal.rkt"
body of "/usr/share/racket/pkgs/drracket-core-lib/drracket/drracket.rkt"
Here's what the top of that function looks like now:
;; restore-autosave-files/gui : -> void?
;; opens a frame that lists the autosave files that have changed.
(define (restore-autosave-files/gui [table #f])
(printf "restore-autosave-files/gui called\n")
(for ([x (in-list (continuation-mark-set->context
(current-continuation-marks)))])
(printf " ~s\n" x))
(cond
[table (restore-autosave-files/gui/table table)]
[else
(define toc-path (current-toc-path))
(when (file-exists? toc-path)
;; Load table from file, and check that the file was not corrupted
(define raw-read-table
looks to me like the code that is evaluating a program for the user and is ligit. That is, you get to *init, whose source code is here and then you get to the call-with-exception-handler which is probably what one of the things in the body of that function expands into and then the next thing is running drracket/tool-lib which suggests that something is requiring it.
Maybe a good next step is to add a few more printfs, changing this:
(define (*init)
(parameterize ([current-namespace (current-namespace)])
;; the prompt makes it continue after an error
(call-with-continuation-prompt
(λ () (with-stack-checkpoint
(begin
(*do-module-specified-configuration)
(namespace-require modspec)
(for ([submod (in-list (module-language-settings-submodules-to-run settings))])
(define submod-spec `(submod ,modspec ,@submod))
(when (module-declared? submod-spec)
(dynamic-require submod-spec #f))))))))
(current-namespace (module->namespace modspec))
(check-interactive-language))
Which part of the printouts were present when the dialog appeared and which parts of the printouts were after the dialog appeared? (Or are you saying it all showed up before the dialog did?)
I can't tell if they're before or after the new window opens. (It blocks the previous window.) But the lines are there either before or soon after the new window opens.
OK. I have deleted every copy except one of the file and I'm going to use symbolic links from now on so I don't have to worry about multiple versions. (Except, of course, the ones the students have downloaded to their own machines, which will continue to vex me.)
THANK YOU AGAIN!
I think I was trying to set the syntactic coverage setting, only to realize it couldn't be done and then forgot to remove the require.